The fixed-size token buffer an LLM can process in a single call. Everything the agent "sees" must fit here. Typical sizes: 128Kโ1M tokens. This is the hard constraint everything else works around.core
When a session ends unexpectedly (crash, timeout, token limit), all in-flight context is lost. The agent wakes up with amnesia. Prevention: periodic checkpoints, auto-save hooks, and graceful shutdown rituals.core
Periodically saving agent state to durable storage so it can recover from context death. Good checkpoints capture: working_on, focus, blockers, and next_steps. Frequency: every 10โ15 minutes during heavy work.core
Summarizing older context into shorter representations to free up the context window. Lossy by nature โ the art is deciding what to keep. Strategies: rolling summaries, hierarchical compression, importance-weighted pruning.core
The illusion of persistent identity across separate LLM calls. Achieved through: system prompts, memory files, checkpoint loading, and "wake-up" rituals that reconstruct context. Without it, every session is a stranger.core
The active context window contents โ what the agent is thinking about right now. Volatile, expensive, limited. Analogous to human short-term memory. Managed via system prompt + recent messages.memory type
Records of specific events and interactions. "What happened on Tuesday." Stored as timestamped logs or daily notes. Critical for answering "Have we discussed this before?" and building relational context.memory type
General knowledge and facts, decoupled from when they were learned. "Pedro prefers dark mode." Stored as structured key-value pairs or knowledge graphs. Retrieved by topic, not by time.memory type
How-to knowledge: skills, workflows, tool usage patterns. "To deploy, run vercel --prod." Lives in skill files, runbooks, and TOOLS.md. The agent's muscle memory โ hard-won, rarely changes.memory type
Explicit facts and preferences stored as structured data. Decisions made, rules established, user preferences. The "constitution" that governs agent behavior across sessions. Usually lives in config files.memory type
Knowledge about people, entities, and their relationships. Who works with whom, communication preferences, org charts. Powers personalization and social awareness. Stored as entity profiles with wiki-links.memory type
12
Spatial / Structural Memory
Understanding of project layouts, file structures, codebases, and system architecture. "The API lives in /src/routes." Lets agents navigate complex environments without re-exploring every session.memory type
Memory about memory: what the agent knows it knows (and doesn't). Confidence levels, source tracking, staleness detection. Enables self-reflection: "I'm not sure about this โ let me check."memory type
14
RAG (Retrieval-Augmented Generation)
Pulling relevant memories into the context window at query time using vector search or keyword matching. The bridge between long-term storage and working memory. Quality depends on chunking, embedding, and retrieval ranking.strategy
Layered storage: hot (context window) โ warm (session files) โ cold (vector DB / archives). Each layer trades speed for capacity. Well-designed agents promote and demote memories between tiers automatically.strategy
Storing memories with metadata (type, category, timestamp, source) instead of raw text dumps. Enables queries like "show me all decisions from last week." The difference between a filing cabinet and a junk drawer.strategy
Standardized routines for session start (load identity, read recent context, check for deaths) and session end (checkpoint, summarize, flag next steps). The bookends that make continuity possible.strategy
Periodically reviewing raw logs and distilling them into long-term memory โ like a human journaling. Daily notes โ curated insights. Prevents memory bloat while preserving what matters. Best done during idle time (heartbeats).strategy
Connecting memories as nodes and edges rather than flat files. Wiki-links ([[entity]]) build a traversable web. Enables: "What do I know about X?" and "How is X related to Y?" Emergent structure from consistent linking.architecture
20
Multi-Agent Memory Sharing
When multiple agents collaborate, they need shared memory (project state, decisions) and private memory (per-agent context). Patterns: shared vaults, message passing, blackboard systems. The hardest unsolved problem in agent memory.architecture