Code with Cosmos: Building Stateful and Multi-Agent Systems
Marko Hotti and Madeline Egan show how to build AI agents that keep durable, shared memory across sessions using Azure Cosmos DB, so a multi-agent travel planner can remember user preferences, share context between agents, and continue work after handoffs instead of restarting from scratch.
Overview
The episode focuses on building stateful, multi-agent applications where agents can:
- Remember user preferences over time (durable memory)
- Coordinate across tasks by sharing context
- Hand off work between specialized agents
- Resume across sessions without losing state
Azure Cosmos DB is positioned as the durable, shared storage layer that enables this “agent memory” pattern.
Multi-agent travel planner scenario
The video uses a travel planner example with multiple specialized agents, including:
- A research agent
- A hotel agent
- A restaurant agent
These agents persist and retrieve user preferences and shared context so the system can pick up where the user left off.
Azure Cosmos DB as durable, shared agent memory
Key idea: Cosmos DB provides a durable store that multiple agents can read/write to, enabling:
- Persisting preferences (so the system doesn’t start from a blank slate each session)
- Shared context between agents working on different parts of the plan
- Agent handoffs where one agent can continue from another agent’s state
The episode references the Azure Cosmos DB Agent Memory Toolkit as the mechanism used to implement these memory behaviors.
Links
- GitHub repo: https://aka.ms/cosmos-travel-planner
- Playlist: https://aka.ms/CodeWithCosmosPlaylist
- Try Azure Cosmos DB: https://aka.ms/trycosmosfree