Memory & Context
Configure how agents maintain state, access history, and retrieve context across sessions.
Memory types
Session memory
Cleared after each agent run. Use for stateless tasks where no state should persist between invocations.
memory:
type: session
max_tokens: 8192Persistent memory
State is retained across runs in a configured backend store. Use for agents that need to remember context, build up knowledge, or maintain state over time.
memory:
type: persistent
backend: postgres
namespace: my-agent
ttl: 30dRetrieval-augmented
Agent queries an external knowledge store at runtime to retrieve relevant context. Use for agents that need access to large knowledge bases without holding everything in the context window.
memory:
type: retrieval
store: vector_db
embedding_model: configured_embedding_model
top_k: 10
namespace: company-knowledgeBackend configuration
| Backend | Use case | Notes |
|---|---|---|
| PostgreSQL | Production persistent memory | Recommended for production |
| SQLite | Development, single-node | Zero configuration |
| Redis | Fast session memory | In-memory, volatile |
| Vector DB | Retrieval-augmented | pgvector, Qdrant, Weaviate |