Memory Features
PraisonAI agents support several memory features that make conversations smarter over time. Each feature is opt-in — disabled by default for zero overhead.Quick Comparison
Auto-Save Sessions
Automatically saves the full conversation history to disk after eachstart() / run() call.
- Simple
- Preset
History Injection
Automatically loads past session history into context so the agent remembers previous conversations.- Basic
- With Limit
- Preset
When
history=True, a session ID is auto-generated per project — it combines the workspace (git repo root or the current directory) with the agent name. Two Agent(name="assistant") calls in different projects get separate history files and never mix.Set session_id="..." for explicit control over which session to resume, or opt back into name-only global sessions by exporting PRAISONAI_GLOBAL_SESSIONS=true.Where sessions live
Every auto-generated session is scoped to your workspace, so the same agent name in a different project starts fresh instead of leaking history.
The final on-disk id is:
~/.praisonai/sessions/ (or wherever PRAISONAI_HOME points).
Read the resolved identity from Python:
Opt out with PRAISONAI_GLOBAL_SESSIONS
Opt out with PRAISONAI_GLOBAL_SESSIONS
history_<sha256("global:<name>")[:8]> and same-named agents in any project share one history file. Accepted values (case-insensitive): 1, true, yes.Upgrading from name-only sessions
Upgrading from name-only sessions
Existing
history_<name-only>.json files are not adopted automatically when running in workspace scope — otherwise Project A’s history would leak into Project B.- To keep using an old file everywhere, set
PRAISONAI_GLOBAL_SESSIONS=true. - To keep it in one specific project, rename it to the new workspace-scoped id (or set
session_id="..."explicitly). - Otherwise, agents start fresh in each new workspace.
Explicit session_id still wins
Explicit session_id still wins
Passing
session_id="..." is unchanged — it always overrides the auto id and stays global, so use it for deliberate cross-project continuity.Auto-Memory Extraction
Automatically extracts memorable facts (names, preferences, roles) from conversations and stores them in long-term memory.- Enable
- How It Works
Manual Memory Storage
You can also store memories manually using thestore_memory() method.
Memory Presets
Use string shortcuts instead ofMemoryConfig for common configurations.
Custom Memory Backend
Implement theAgentMemoryProtocol to create your own memory backend.
Any object with
get_context() and save_session() methods works as a memory backend.
No inheritance required — PraisonAI uses duck typing via AgentMemoryProtocol.Architecture
FileMemory persists to ~/.praisonai/memory/. Writes are atomic — see Storage → Durability.
Session Persistence
Resume conversations across restarts
Storage Backends
File, SQLite, Redis, PostgreSQL, MongoDB
Advanced Memory
Long-term, short-term, entity memory
Graph Memory
Relationship-aware memory

