Memory

Examples of persisting user memories in a database and sharing them across runs, sessions, and multiple agents.

ExampleDescription
Agent With Persistent MemoryUse persistent memory with an Agent.
Memory Tools With Web SearchUse MemoryTools alongside WebSearchTools so an agent can store and use user memory while planning a trip.
Agentic Memory ManagementUse agentic memory with an Agent.
Agents Sharing MemoryTwo agents sharing the same user memory.
Custom Memory Manager ConfigurationConfigure a MemoryManager separately from the Agent and apply custom memory capture instructions.
Multi-User Multi-Session ChatA multi-user, multi-session chat flow where user memory is shared across sessions for the same user.
Concurrent Multi-User Multi-Session ChatRun three user conversations concurrently with asyncio.gather while a shared agent persists user memories across sessions.
Share Memory and History Between AgentsTwo agents sharing both conversation history and user memory through a common database, user ID, and session ID.
Memory ManagerThe Memory Manager handles user memory CRUD and retrieval operations.
Optimize MemoriesThis directory demonstrates memory optimization strategies.