Feat/removing postgresql - #11
Open
quentinP-hexamind wants to merge 5 commits into
Open
Conversation
… sqlite for displaying conversations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop Postgres as the default & delegate conversation history to the backend
Summary
Two related simplifications to how the platform stores state:
What changed
Datastore (proxy)
PLATFORM_DATABASE_URL] →sqlite+aiosqlite:///./hexa.sqlite(config.py).aiosqlitepromoted to a core dependency;asyncpgmoved behind a new postgres extra (pip install '.[postgres]') (pyproject.toml).docker-compose.yml, .env.example, andQUICKSTART.mdreframed: Postgres is now optional, with the opt-in steps documented.*.sqlitegit-ignored.Conversation memory (proxy)
[{role: user, content: …}], the prior_assemble_historyDB read is gone ([chat.py]). Stored user/assistant rows are now explicitly the display transcript, never model context./forget(best-effort, a down/unimplemented backend never fails the delete) ([conversations.py], [runtime_client.py]).Reference & template backends
/forgetroute in the referenceagent-server([memory.py], [routes/agents.py]), with_assistant_textcapturing the reply across all framework event shapes.starter-agentandhexgate-agenttemplates.verify_backend.pynow probes/forget.Contract
CONTRACT.md§5 documents the new ownership model, theconversation_idmemory key, cold-id handling, and the/forgetlifecycle.Behavior contractual change
Any custom backend must now:
input.messagesas the new turn only and own its own memory keyed bycontext.conversation_id(accepting unseen ids without error);implement
POST /agents/{id}/forget{conversation_id} → {forgotten: bool}Testing
proxy-server: 92 passing,test_chat.pyupdated to assert only the new turn is forwarded while the full display transcript is still stored;test_conversations.pyadds delete→/forgetcoverage incl. the best-effort failure path.agent-server: 25 passing (new suite),memory.py, the stream route's transcript reconstruction,/forget, and_assistant_textper framework. Wired intomake test(so it runs in CI).Follow-ups (not in this PR)
starter-agent/hexgate-agentmemory logic is currently untested.run_id(documented simplification); a missingconversation_idcurrently yields empty history rather than falling back toinput.messages