Memory strategies
Each agent has a memory strategy that decides what conversation history it sees on each turn.
Memory is scoped per (agent, session), so an agent resumes with the right history when it runs
again in the same chat or graph run.
The strategies
Section titled “The strategies”| Strategy | What it does |
|---|---|
| None | No memory — every turn starts fresh. |
| Window | Keep only the last N messages. |
| Full transcript | Store and replay the entire conversation. |
| Summarized | Keep a rolling summary, refreshed every N messages by a chosen model. |
| Episodic | Retrieve relevant past messages from a vector collection (top_k, threshold). |
| Semantic | Extract structured facts (via an extractor prompt) before storing them. |
| Composite | Stack several strategies as ordered layers, consulted and written in order. |
Where it’s set & how it resolves
Section titled “Where it’s set & how it resolves”- Agent default: every agent definition carries a
memory_strategy(default None). - Per-slot override: an Agent (SubAgent) node can
set a
memory_overridefor that one slot in the graph.
The effective strategy is memory_override.unwrap_or(agent.memory_strategy) — the node-level
override wins for that slot, otherwise the agent’s own default applies.
- Episodic and Semantic rely on embeddings — configure your embedding model first.
- Memory writes happen automatically as the agent records each message; you don’t manage storage.
- The canonical definition is
MemoryStrategyinbackend/src/agents/memory/mod.rs.