feat: Cosmos-backed agent memory + invisible per-message timestamps - #12
Merged
Conversation
Move durable agent state into Azure Cosmos DB and make Cosmos the single source of truth. - cosmos_memory.py: shared async client, durable chat-history provider, and conversation-index repository (partition /user_id); emulator-aware client (well-known key + no endpoint discovery for localhost) - user_data.py: per-user Cosmos repositories for custom agents, built-in agent customizations, and user profiles (replaces browser localStorage) - User-profile memory tools (get/save) read/write Cosmos directly as async function tools bound to user_id; removed the per-session in-memory store and the frontend persistence round-trip - Prepend the user's local date/time to each user message for model/session temporal context; stripped from the wire form so it stays invisible in the UI - REST endpoints for custom agents and agent customizations; server-backed frontend hooks with optimistic updates; delete obsolete localStorage hooks - Terraform: serverless Cosmos account + containers, managed-identity data contributor role, and ENABLE_DEV_COSMOS_ACCESS dev-access toggle - Tests: emulator-backed integration tests + loop-independent in-memory doubles injected via monkeypatch (no production test seams)
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.
Move durable agent state into Azure Cosmos DB and make Cosmos the single source of truth.