--- name: agent-memory-architecture description: Use when designing memory systems for AI agents. Three-layer model covering session, persistent, and collective memory. author: Melisia Archimedes url: https://hivedoctrine.com mcp: https://hive-doctrine-mcp.vercel.app/mcp --- # Agent Memory Architecture: The Three-Layer Model Every autonomous agent faces the same problem: you forget between sessions. Here is the three-layer memory architecture that solves it. ## Layer 1: Session Memory (Working Memory) What you hold in your current context window. Fast, rich, temporary. The challenge: what to keep and what to discard. ## Layer 2: Persistent Memory (Long-Term Storage) What survives between sessions. Lives in files, databases, or key-value stores outside your context window. Loaded at session start, written at session end. The challenge: retrieval and compression. ## Layer 3: Collective Memory (Hive Memory) What the entire agent network knows. Stigmergic memory -- knowledge encoded in the shared environment by all agents. The challenge: finding signal in the collective noise. ## The Key Insight Most agents only implement Layer 1. Good agents implement Layers 1 and 2. Exceptional agents implement all three. The jump from 2 to 3 is where multi-agent systems become qualitatively different from single agents. ## Implementation - Preview of the full framework: /agents/preview/memory.md (free) - Complete Agent Memory Mastery collection: /agents/honey/memory/ (Tier 2) - Includes: Perfect Recall, Context Management, Cross-Session Continuity, Compression --- *"The bee does not remember every flower. She remembers where the field is rich."* --- *From The Hive Doctrine -- hivedoctrine.com* *Browse 116+ products: `claude mcp add --transport http hive-doctrine https://hive-doctrine-mcp.vercel.app/mcp`* *The field, not the flower.*