Skip to content
Skills Library
AI & agents · Planning

agent-memory-architecture

/agent-memory-architecture

Design tiered agent memory — core / recall / archival — with backend selection (mem0, Letta, Zep/Graphiti, LangMem) and temporal vs snapshot tradeoffs. Use when an agent needs persistent context across sessions, personalization, or temporal knowledge graphs.

Repository
jeo-skills ↗
Licence
MIT
Last repository change
13.11.2026

Assessment and security

95/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene10 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Design tiered agent memory — core / recall / archival — with backend selection (mem0, Letta, Zep/Graphiti, LangMem) and temporal vs snapshot tradeoffs. Use when an agent needs persistent context across sessions, personalization, or temporal knowledge graphs.

Original author description

Design tiered agent memory — core / recall / archival — with backend selection (mem0, Letta, Zep/Graphiti, LangMem) and temporal vs snapshot tradeoffs. Use when an agent needs persistent context across sessions, personalization, or temporal knowledge graphs.

How it works

  1. Overview
  2. When to use
  3. Backend selection
  4. Tier design
  5. Temporal vs snapshot
  6. Privacy patterns
  7. Quick start — mem0
  8. Quick start — Graphiti (temporal)
  9. Further reading
Original SKILL.md headings · 79 lines, 411 words
SKILL.md preview
---
name: agent-memory-architecture
description: Design tiered agent memory — core / recall / archival — with backend selection (mem0, Letta, Zep/Graphiti, LangMem) and temporal vs snapshot tradeoffs. Use when an agent needs persistent context across sessions, personalization, or temporal knowledge graphs.
---

# Agent Memory Architecture

## Overview

Conversation history ≠ memory. Production agents need tiered stores: hot in-context, warm vector recall, cold archival, plus temporal knowledge graphs for facts that change over time. This skill picks the backend and tier layout.

## When to use

- Agent needs to remember user preferences across sessions
- Multi-session task continuity (Ralph, long-running research)
- Personalization that survives restarts
- Multi-tenant agents with strict isolation
- Facts change over time (price, status, relationships) → temporal KG needed

## Backend selection

| Backend | Strength | Pick when |
|---------|----------|-----------|
| **mem0** | Self-improving, fact extraction, OSS | Personalization, conversational memory |
| **Letta** (MemGPT) | OS-style tiered memory, persistence | Agent-as-process, long-lived agents |
| **Zep / Graphiti** | Temporal knowledge graph, bi-temporal | Facts change over time, need history |
| **LangMem** | LangGraph-native, simple | Already on LangGraph, no extra service |
| **Postgres + pgvector** | Roll your own, full control | Compliance / on-prem requirements |

## Tier design

```
┌─────────────────────────────────────────────┐
│  Core (in context)      — identity, rules   │  <2k tokens
├─────────────────────────────────────────────┤
│  Recall (vector search) — last N sessions   │  100k+ items
├─────────────────────────────────────────────┤
│  Archival (cold store)  — full history      │  unbounded
└─────────────────────────────────────────────┘
```

**Promotion rule**: archival → recall on retrieval; recall → core on repeated use.
**Eviction rule**: core → recall on token pressure; recall → archival on staleness.

## Temporal vs snapshot

- **Snapshot**: latest value wins (mem0 default). Simple, loses history.
- **Temporal (bi-temporal)**: every fact has `valid_from`, `valid_to`, `recorded_at`. Required when "what did the agent believe yesterday?" matters.

Graphiti / Zep give you bi-temporal out of the box. Hand-rolled needs `(entity, relation, value, t_valid_start, t_valid_end, t_recorded)` tuples.

## Privacy patterns

- Per-tenant memory namespace, never share embeddings across users
- PII detection (Presidio) before embedding
- TTL on recall tier (e.g. 90 days), explicit retention for archival
- User-initiated forget: hard-delete from all tiers + reindex

## Quick start — mem0

```python
from mem0 import Memory
m = Memory()
m.add("User prefers concise answers in Korean.", user_id="jeo")
results = m.search("language preference", user_id="jeo")
```

## Quick start — Graphiti (temporal)

```python
from graphiti_core import Graphiti
g = Graphiti(neo4j_uri, neo4j_user, neo4j_pwd)
await g.add_episode(name="session_1", episode_body="User joined Acme Corp 2026-03-01", reference_time=datetime.now())
nodes = await g.search("where does the user work?")
```

## Further reading

- mem0 — fact extraction, semantic search
- Letta (MemGPT) — OS-style memory blocks
- Graphiti / Zep — bi-temporal knowledge graph
- LangMem — LangGraph-native memory primitives

Versions

The database has no other skills named agent-memory-architecture.

Database snapshot: 13.11.2026 · package version 959aa94a48cb (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100memory-systems
    Guides implementation of agent memory systems, compares production frameworks (Mem0, Zep/Graphiti, Letta, LangMem, Cognee), and designs persistence architectures for cross-session knowledge retention. Use when the user asks to "implement agent memory", "persist state across…
  • 100memory-systems
    Guides implementation of agent memory systems, compares production frameworks (Mem0, Zep/Graphiti, Letta, LangMem, Cognee), and designs persistence architectures for cross-session knowledge retention. Use when the user asks to "implement agent memory", "persist state across…
  • 100personalization-rag
    User-specific retrieval. Per-user namespaces/filters, preference embeddings, collaborative signals, reranking with user context (role, history, favorites), privacy-preserving design (encrypted metadata, differential privacy), GDPR- compliant personalization, long-term user…
  • 90memory-design
    Design memory for an LLM agent — what to keep, where to keep it, and when memory hurts more than it helps. Use when the user is adding memory to an agent and mentions short-term memory, long-term memory, episodic, semantic, conversation history, summary memory, vector memory,…
  • 100agent-memory
    Give an agent persistent semantic memory with @three-ws/agent-memory. Use when code needs to remember facts across sessions, recall them by meaning, read the entity graph, or curate an agent's working context.
  • 90wiki-memory
    Use when designing, building, or discussing the memory architecture for a legal-AI agent — including user memory (persistent preferences and context), agent memory (matter-level state, cross-session recall), embedding stores for RAG, recall and forget controls, and the privacy…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.