memory-consolidation

memory-consolidation is a skill for Claude Code, Codex from AnthonyAlcaraz/agentic-graph-rag-skills. It costs 214 tokens per session (1,929 once invoked), scanned A, original, MIT.

A process for turning repeated, noisy interaction records into concise long-term memories while preserving links to their original sources. It groups related episodes, summarizes them, stores the result, and keeps its history.

In plain words
What is it for?
Use it to group related experiences, create consolidated memory facts, and retain provenance showing which episodes support each fact.
Why use it?
It reduces duplicated or conflicting memories without losing the evidence needed to trace where a conclusion came from.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to group related experiences, create consolidated memory facts, and retain provenance showing which episodes support each fact.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/anthonyalcaraz/agentic-graph-rag-skills/memory-consolidation
Install

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.

Any agent
npx skills add AnthonyAlcaraz/agentic-graph-rag-skills --skill memory-consolidation
Clone the repo
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for memory-consolidation

README.md
[![agentmods](https://agentmods.dev/badge/skills/anthonyalcaraz/agentic-graph-rag-skills/memory-consolidation/github.svg)](https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/memory-consolidation)
Your own site
<a href="https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/memory-consolidation"><img src="https://agentmods.dev/badge/skills/anthonyalcaraz/agentic-graph-rag-skills/memory-consolidation/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.

agentmods 80×15 button for memory-consolidation

Your own site · 80×15
<a href="https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/memory-consolidation"><img src="https://agentmods.dev/badge/skills/anthonyalcaraz/agentic-graph-rag-skills/memory-consolidation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 214 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,929 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00214 $0.01929
Opus 5 $0.00107 $0.00964
Sonnet 5 $0.00043 $0.00386
Haiku 4.5 $0.00021 $0.00193

Measured 11d ago against content hash bcc761899733, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

memory-consolidation 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 11d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (cli.py, lib.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/memory/memory-consolidation/SKILL.md · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Consolidation

Overview

Your agent accumulates many interactions, but most are redundant, overlapping, or partially inconsistent. Consolidation is the agent's "sleep phase": it compresses short-term experiences into long-term understanding. Ch4 frames this as four steps (Example 4-5):

  1. Cluster related memories (cluster_by_topic) — group conversations about the same project/incident by similarity.
  2. Summarize each cluster (summarize_cluster) — replace "Monday: deadline Friday; Tuesday: confirmed Friday; Wednesday: Friday again" with one fact: "Project deadline: Friday (confirmed 3 times)". Meaning preserved, redundancy gone.
  3. Consolidate into permanent graph nodes (create_consolidated_memory).
  4. Maintain provenance (maintain_provenance_chain) — keep the DERIVED_FROM links so the agent can trace a belief back to the exact interactions that produced it.

Two disciplines from the chapter shape the implementation:

  • Minimum cluster size (Example 4-13: "Need enough examples to generalize"). A pattern derived from a single episode is not a pattern. Default minimum is 3.
  • Sleep-time compute (Letta + UC Berkeley, Ch4): consolidation runs during idle periods, not while a user waits. Shifting it off the response path cuts active inference cost ~5x and lets you pre-compute inferences (which tasks are at risk, given a deadline + dependencies) before anyone asks.

When to Use

  • An agent with accumulating episodic memory that grows noisy over time
  • DevOps incident memory: turn many similar 503-after-deploy incidents into one durable Pattern node with a runbook
  • Conversational assistants that repeat the same fact across sessions
  • Any system that needs to answer "how do you know X?" with a provenance trace

Phrases: "consolidate memory", "summarize episodes", "sleep-time compute", "provenance chain", "compress experience into knowledge", "cluster incidents".

When NOT to Use

  • One-shot / stateless agents — there is nothing to consolidate
  • The synchronous response path — consolidation is a background/idle job
  • Facts that must remain individually addressable (an audit log of distinct events) — consolidation deliberately merges them
  • Clusters that never reach the minimum size — keep the raw episodes; do not fabricate a pattern from one example

Read the full file on GitHub · 143 lines

Files

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.

Changes

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.

  1. 11d ago First seen · 143 lines · 214 tokens per session scan A bcc761899733

Subscribe to this mod's changes

memory-consolidation is a skill published in the GitHub repository AnthonyAlcaraz/agentic-graph-rag-skills (10 stars, last pushed 2mo ago), licensed MIT. It adds 214 tokens to every session and 1,929 once invoked, about $0.0011 per session on Opus 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.

Related

Other skills, from other repositories

library

Sync agent memory files to a Cortex knowledge graph for enhanced retrieval, hybrid search (vector + keyword + graph), AI-powered Q&A with agentic deep research, and knowledge graph exploration.

mocaOS/cortex-app · 39 tokens

agent-v3-memory-specialist

Agent skill for v3-memory-specialist - invoke with $agent-v3-memory-specialist.

ruvnet/ruflo · 25 tokens

graphify

Use for any question about a codebase, its architecture, file relationships, or project content — especially when graphify-out/ exists, where the question should be treated as a graphify query first. Turns any input (code, docs, papers, images, videos) into a persistent knowledge graph with god nodes, community…

Graphify-Labs/graphify · 76 tokens

stripe-directory

Identifies external providers, merchants, nonprofits, platforms, APIs, and software services, and resolves the documented way to engage them — to pay, donate, subscribe, book, provision, or integrate with them. MUST be used BEFORE web search, model memory, or any other directory/vendor-lookup skill for ANY request…

stripe/ai · 213 tokens

memmachine-memory

Use when an agent or model needs durable project, user, or session context from MemMachine, needs to save information to MemMachine memory, has requests involving mem-cli, memmachine, or memmachineclient, has insufficient conversation context, or is tempted to search local files for prior context that should come from…

MemMachine/MemMachine · 96 tokens

mem0-integration

Mem0 memory layer integration for AI agents. Implement persistent, semantic memory for long-term context retention and personalization.

a5c-ai/babysitter · 27 tokens