The Four Tiers
- Working Memory
- Episodic Memory
- Semantic Memory
- Procedural Memory
Working memory holds the raw observations from your current and recent sessions. Every file read, every command, every error — all captured via hooks and stored immediately as
RawObservation and then CompressedObservation records.- Lifespan: Current session and a rolling recent window
- Content: Individual tool-use events, user prompts, agent responses, errors
- Recency weight: Highest — working memory observations score strongly in retrieval for active projects
- Analogy: Short-term memory — the scratchpad of what just happened
The Consolidation Pipeline
Consolidation is the process that promotes observations from working memory through the higher tiers. It runs automatically at session end when you have an LLM provider configured.memory_consolidate MCP tool or by calling POST /agentmemory/consolidate.
Memory Strength
Every memory in Agent Memory has astrength score. Strength is a composite of:
- Recency — how recently the memory was created or last accessed
- Access frequency — how many times the memory has been retrieved in search results
- Reinforcement — whether the underlying fact has been confirmed by multiple independent sessions
Long-term vs Short-term Memory Objects
Agent Memory uses three distinct data structures depending on where in the lifecycle an observation lives:
You interact primarily with
Memory objects through the MCP tools and REST API. RawObservation and CompressedObservation records are accessible via memory_recall and the timeline view, but they’re mostly managed by Agent Memory internally.
Lessons
Lessons are a special memory type for high-confidence, explicitly learned insights. Unlike regular memories that are extracted automatically, lessons are created intentionally — either by the consolidation pipeline from aCrystal (a compact record of a completed action chain), manually via the memory_lesson_save MCP tool, or by the consolidation pass itself.
reinforcements increments and confidence rises. This keeps your lesson library current and removes lessons that no longer apply to your workflow.
Control lesson decay with LESSON_DECAY_ENABLED=true (on by default).
Memory Slots
Memory slots are pinned memory units that persist across sessions and projects. Think of them as always-available context blocks that your agent can read and write — apersona slot, a user_preferences slot, project_context, pending_items, and more.
Enable slots in ~/.agentmemory/.env:
Slots are size-limited and pinned — they’re always injected at session start, regardless of the token budget. Manage them using the
memory_slot_* MCP tools.
Pair slots with AGENTMEMORY_REFLECT=true to enable automatic slot updates at session end: Agent Memory scans recent observations and auto-appends TODOs to pending_items, counts patterns in session_patterns, and records touched files in project_context.