$npx -y skills add muratcankoylan/Agent-Skills-for-Context-Engineering --skill memory-systemsThis skill should be used for persistent semantic memory in agent systems: cross-session knowledge retention, entity tracking, temporal validity, graph or vector retrieval, memory consolidation, and memory benchmark selection. Route file-backed scratchpads to filesystem-context,
| 1 | # Memory System Design |
| 2 | |
| 3 | Memory provides the persistence layer that allows agents to maintain continuity across sessions and reason over accumulated knowledge. Simple agents rely entirely on context for memory, losing all state when sessions end. Sophisticated agents implement layered memory architectures that balance immediate context needs with long-term knowledge retention. The evolution from vector stores to knowledge graphs to temporal knowledge graphs represents increasing investment in structured memory for improved retrieval and reasoning. |
| 4 | |
| 5 | ## When to Activate |
| 6 | |
| 7 | Activate this skill when: |
| 8 | - Building agents that must persist knowledge across sessions |
| 9 | - Choosing between memory frameworks (Mem0, Zep/Graphiti, Letta, LangMem, Cognee) |
| 10 | - Needing to maintain entity consistency across conversations |
| 11 | - Implementing reasoning over accumulated knowledge |
| 12 | - Designing memory architectures that scale in production |
| 13 | - Evaluating memory systems against benchmarks (LoCoMo, LongMemEval, DMR) |
| 14 | - Building dynamic memory with automatic entity/relationship extraction and self-improving memory (Cognee) |
| 15 | |
| 16 | Do not activate this skill for adjacent work owned by other skills: |
| 17 | - File-backed scratchpads, run logs, and tool-output offloading: `filesystem-context`. |
| 18 | - Conversation compaction or human-readable handoff summaries: `context-compression`. |
| 19 | - Masking, prefix caching, token budgets, or retrieval scoping inside one trajectory: `context-optimization`. |
| 20 | - Formal belief/desire/intention models over RDF state: `bdi-mental-states`. |
| 21 | |
| 22 | ## Core Concepts |
| 23 | |
| 24 | Think of memory as a spectrum from volatile context window to persistent storage. Default to the simplest layer that meets retrieval needs, because benchmark evidence suggests tool complexity matters less than reliable retrieval for some memory workloads (claim-memory-locomo-filesystem-baseline). Add structure (graphs, temporal validity) only when retrieval quality degrades or the agent needs multi-hop reasoning, relationship traversal, or time-travel queries. |
| 25 | |
| 26 | ## Detailed Topics |
| 27 | |
| 28 | ### Production Framework Landscape |
| 29 | |
| 30 | Select a framework based on the dominant retrieval pattern the agent requires. Use this table to narrow the shortlist, then validate with the benchmark data below. |
| 31 | |
| 32 | | Framework | Architecture | Best For | Trade-off | |
| 33 | |-----------|-------------|----------|-----------| |
| 34 | | **Mem0** | Vector store + graph memory, pluggable backends | Multi-tenant systems, broad integrations | Less specialized for multi-agent | |
| 35 | | **Zep/Graphiti** | Temporal knowledge graph, bi-temporal model | Enterprise requiring relationship modeling + temporal reasoning | Advanced features cloud-locked | |
| 36 | | **Letta** | Self-editing memory with tiered storage (in-context/core/archival) | Full agent introspection, stateful services | Complexity for simple use cases | |
| 37 | | **Cognee** | Multi-layer semantic graph via customizable ECL pipeline with customizable Tasks | Evolving agent memory that adapts and learns; multi-hop reasoning | Heavier ingest-time processing | |
| 38 | | **LangMem** | Memory tools for LangGraph workflows | Teams already on LangGraph | Tightly coupled to LangGraph | |
| 39 | | **File-system** | Plain files with naming conventions | Simple agents, prototyping | No semantic search, no relationships | |
| 40 | |
| 41 | Choose Zep/Graphiti when the agent needs bi-temporal modeling (tracking both when events occurred and when they were ingested) because its three-tier knowledge graph (episode, semantic entity, community subgraphs) excels at temporal queries. Choose Mem0 when the priority is fast time-to-production with managed infrastructure. Choose Letta when the agent needs deep self-introspection through its Agent Development Environment. Choose Cognee when the agent must build dense multi-layer semantic graphs — it layers text chunks and entity types as nodes with detailed relationship edges, and every core piece (ingestion, entity extraction, post-processing, retrieval) is customizable. |
| 42 | |
| 43 | **Benchmark Performance Comparison** |
| 44 | |
| 45 | Consult these benchmarks to set expectations, but treat them as source-specific signals for retrieval dimensions rather than absolute rankings. No single benchmark is definitive. |
| 46 | |
| 47 | | System | DMR Accuracy | LoCoMo | HotPotQA (multi-hop) | Latency | |
| 48 | |--------|-------------|--------|---------------------|---------| |
| 49 | | Cognee | — | — | Published high score | Variable | |
| 50 | | Zep (Temporal KG) | Published high score | — | Mid-range across metrics | Low-latency reported | |
| 51 | | Letta (filesystem) | — | Published filesystem baseline | — | — | |
| 52 | | Mem0 | — | Published specialized-tool baseline | Lower in one comparison | |