Overview
When memory is enabled, your agents will:- Retrieve relevant memories before responding (injected into context)
- Process the user’s message with full memory context
- Save new information to memory automatically in the background
- Learn continuously from every interaction
Memory saving is completely asynchronous — users never wait for memory operations. The agent responds immediately, and memories are saved in the background.
Quick Start
Add amemory_config block to your YAML configuration:
Memory Scopes
Scopes control who can access stored memories and how they are isolated:| Scope | Description | Shared With | Best For |
|---|---|---|---|
user | Personal to each user | Only that user | Preferences, personal history |
agent | Specific to one agent | Only that agent + user | Learned strategies, agent knowledge |
session | Current conversation only | Current session | Temporary context |
company | Organization-wide | Everyone in the company | Policies, shared knowledge |
space | Team or project-specific | Users in that space | Project decisions, team knowledge |
Scope Examples
Personal memory (each user gets their own):Configuration Reference
Global Settings
These fields go directly undermemory_config:
| Field | Type | Default | Description |
|---|---|---|---|
auto_save | bool | true | Enable automatic memory saving |
auto_save_trigger | string | on_interval_turns | When to trigger: on_interval_turns or manual |
auto_save_interval | integer | 10 | Save every N conversation turns |
num_results | integer | 10 | Maximum memories to retrieve (1-100) |
llm_model | string | env default | Model for entity extraction (e.g., gemini-2.5-flash) |
Module Settings
Each entry in themodules list supports:
| Field | Type | Default | Description |
|---|---|---|---|
name | string | auto-generated | Unique identifier for the module |
scope | string | required | Isolation level: user, agent, session, company, space |
auto_save | bool | true | Auto-save this module, or use Memory Tool |
auto_save_interval | integer | inherit global | Override global save interval for this module |
relevance_prompt | string | scope template | Guide what information to extract and save |
space_id | string | — | Required when scope: space (alphanumeric, underscores, dashes only) |
Auto-Save Configuration
How Auto-Save Works
Auto-save checks happen after each agent execution. For each module:- The system checks how many conversation turns have occurred since the last check
- If the turn count reaches the module’s
auto_save_interval, evaluation begins - An LLM evaluates the conversation for relevant information to save
- New facts are deduplicated against existing memories
- Only genuinely new information is persisted
Save Frequency Examples
Manual Save Only
Setauto_save: false to disable automatic saving for a module. The agent can then save to it explicitly using the Memory Tool:
Relevance Prompts
Therelevance_prompt guides what information gets extracted from conversations. It’s the most important field for memory quality.
user scope: extract concrete personal facts, preferences, and decisions).
Per-Agent Memory
Each agent can define its own memory modules that are combined with global modules. Agent-level modules are restricted toagent and session scopes.
support_agent has access to both user_prefs (from global) and agent_strategies (from agent config).
Scope Rules
| Scope | Global Config | Agent Config |
|---|---|---|
company | ✅ | ❌ |
user | ✅ | ❌ |
space | ✅ | ❌ |
agent | ❌ | ✅ |
session | ✅ | ✅ |
Memory Tool
The Memory Tool gives agents explicit control over what gets saved. Add it to an agent’s tools:How It Works
- Without
config.modules: Exposes all modules withauto_save: false - With
config.modules: Exposes only the named modules, regardless ofauto_savesetting
Complete Example
Here is a production-ready configuration:FAQ
How much does memory cost?
How much does memory cost?
Memory has minimal costs:
- Storage: ~5 KB per episode in the graph database
- LLM calls: Entity extraction uses a small model (~200-500 tokens per save)
- Cost tip: Use
gemini-2.5-flashor similar efficient model (~$0.0001 per save)
What happens if memory retrieval fails?
What happens if memory retrieval fails?
The agent continues without memory context. Memory failures are logged but never block the agent’s response.
Can I see what's stored in memory?
Can I see what's stored in memory?
Yes — Atthene provides a built-in memory visualization with an interactive graph view showing entities, relationships, and facts. You can also edit or delete individual memory entries from the UI.
Does memory work across different agents?
Does memory work across different agents?
Yes, if they share the same scope. For example, all agents with a
user-scoped module can access the same user’s memories. Agent-scoped modules are private to each agent.How do I disable memory?
How do I disable memory?
Remove the
memory_config block entirely from your YAML configuration.