Skip to content

feat: Cosmos-backed agent memory + invisible per-message timestamps - #12

Merged
bcperry merged 1 commit into
mainfrom
011-cosmos-agent-memory
Jun 18, 2026
Merged

feat: Cosmos-backed agent memory + invisible per-message timestamps#12
bcperry merged 1 commit into
mainfrom
011-cosmos-agent-memory

Conversation

@bcperry

@bcperry bcperry commented Jun 18, 2026

Copy link
Copy Markdown
Owner

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)

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)
@bcperry
bcperry merged commit 73f9fde into main Jun 18, 2026
@bcperry
bcperry deleted the 011-cosmos-agent-memory branch June 18, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant