Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add AnthonyAlcaraz/agentic-graph-rag-skills --skill hierarchical-memorygit clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/hierarchical-memory)<a href="https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/hierarchical-memory"><img src="https://agentmods.dev/badge/skills/anthonyalcaraz/agentic-graph-rag-skills/hierarchical-memory/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/hierarchical-memory"><img src="https://agentmods.dev/badge/skills/anthonyalcaraz/agentic-graph-rag-skills/hierarchical-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00151 | $0.02108 |
| Opus 5.5 | $0.00060 | $0.00843 |
| Sonnet 5.5 | $0.00030 | $0.00422 |
| Haiku 4.5 | $0.00015 | $0.00211 |
Grade A, and why
hierarchical-memory scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hierarchical Memory (Letta / MemGPT)
Overview
Letta popularizes a three-tier memory architecture that mirrors human cognition and CPU memory hierarchy. The architectural decomposition (Ch4):
- Core memory (cache layer): small, fast, structured. The agent's
active reasoning context. Bounded (
core_limitparameter). Once full, eviction is forced — you cannot have everything in core. This is the forcing function that pushes the agent to declare what is durably important. - Recall memory (raw interaction layer): the literal conversation history. Append-only. Answers "what did we talk about yesterday."
- Archival memory (persistent layer): effectively unlimited storage for evicted-but-still-relevant facts. Searchable. Not deleted.
Eviction is the key discipline. Naive FIFO (oldest goes first) loses high-value durable facts that were learned early. Naive LRU (least-recently- used) loses background-but-relevant context. The chapter recommends a combined score: access frequency × recency, with explicit handling for "durable attributes" (peanut allergy) vs "short-lived states" (having coffee right now).
When to Use
- Long-running personal assistant agents — multi-session, must feel consistent over time
- Multi-day DevOps incident investigation where some facts (production region, on-call rotation) are durably important and others (current shell history) rotate fast
- Customer-support agents that need both "what we know about this customer" (core) and "what was said in last week's tickets" (archival)
Phrases that should invoke this skill: "the agent needs memory across sessions", "core context", "evict old memory", "MemGPT", "Letta hierarchy", "working memory vs long-term memory".
When NOT to Use
- One-shot agents. Single-prompt, no persistence — flat context is correct. The eviction overhead pays for nothing.
- Event logs / audit trails. Use append-only kafka-style logs. The recall layer here is interaction-oriented, not event-oriented.
- Every fact equally important. Then a flat KV store is right. The hierarchy exists because some facts are more important than others; if that gradient doesn't exist, the hierarchy is overhead.
- Hard real-time eviction is too slow. Default impl is O(n) on
eviction. Production needs a heap for
evict_least_used. Swap the internal index at the seam noted inlib.py.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 145 lines · 151 tokens per session scan A 339fbc19df56
hierarchical-memory is a skill published in the GitHub repository AnthonyAlcaraz/agentic-graph-rag-skills (28 stars, last pushed 3mo ago), licensed MIT. It adds 151 tokens to every session and 2,108 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
hierarchical-memory compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| hierarchical-memoryAnthonyAlcaraz/agentic-graph-rag-skills | Skill | 28 | 3mo ago | MIT | A | 151 | Claude Code, Codex |
| lemmalogJordyZomer/lemmalog | Skill | 346 | 1mo ago | MIT | A | 105 | Claude Code, Codex |
| brain-ai-memoryHahyun-Lee/brain-ai-memory | Skill | 5 | 18d ago | MIT | A | 39 | Codex |
| graph-askstevepridemore/graph-memory | Skill | 2 | 3d ago | MIT | A | 43 | Claude Code |
| ingest-audiostevepridemore/graph-memory | Skill | 2 | 3d ago | MIT | A | 56 | Claude Code |
| ingeststevepridemore/graph-memory | Skill | 2 | 3d ago | MIT | A | 62 | Claude Code |
| graph-backupstevepridemore/graph-memory | Skill | 2 | 3d ago | MIT | A | 25 | Claude Code, Codex |