Quick Start
1
Level 1 — Bool (simplest)
Turn on memory with a single flag — the agent remembers across turns using the default file backend.
2
Level 2 — String (pick a backend)
Pass a backend name to choose where memories are stored.
3
Level 3 — Config class (full control)
Use
MemoryConfig to scope memory per user and auto-extract facts.4
Level 4 — Config with continuous learning
Add
LearnConfig to build a long-term persona alongside session memory.How It Works
Which Backend to Choose?
Configuration Options
Full list of options, types, and defaults —
MemoryConfigCommon Patterns
Pattern 1 — User-scoped memory
Pattern 2 — History injection for conversation continuity
Best Practices
Always set user_id for multi-user apps
Always set user_id for multi-user apps
Without
user_id, all users share the same memory store. Set user_id to a unique identifier per user to keep memories properly scoped and private.Use auto_memory for fact extraction
Use auto_memory for fact extraction
Enable
auto_memory=True to have the agent automatically identify and store important facts from each conversation — names, preferences, decisions — without extra code.Combine memory with learning
Combine memory with learning
Set
learn=True inside MemoryConfig to enable continuous learning alongside session memory. This gives agents both short-term context (memory) and long-term pattern recognition (learn).Backend scaling path
Backend scaling path
Start with
file, move to sqlite when you need durability, then redis when you deploy multiple agent instances that share memory.Related
Learn
Learn — continuous learning from conversations
Knowledge
Knowledge — add documents and URLs as agent knowledge

