{"id":"5a295094-2b1b-4225-a9da-3d75a86562e4","slug":"agent-memory-skills","kind":"skill","name":"agent-memory-skills","summary":"IDE skills for building agent memory: working, episodic, semantic, procedural, graph, temporal, consolidation, scratchpad, shared — plus the eval harness that proves any of it works","owner":"ArttuAn","repoUrl":"https://github.com/ArttuAn/agent-memory-skills","license":"MIT","licenseTier":"permissive","trust":"community","stars":2,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-09-14T19:36:58.000Z","addedAt":"2026-10-21T11:36:02.776Z","logoUrl":"https://avatars.githubusercontent.com/u/61137262?u=64b8122ff84f9c63be79de330c77fd145dea5571&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["memory-knowledge","developer-tools","search"],"tags":["agent-memory","ai-agents","claude-code","knowledge-graph","llm","opencode","rag"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-26T18:11:37.373Z","sample":false,"url":"https://conduits.dev/tools/agent-memory-skills","language":"Python","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"<div align=\"center\">\n\n<img src=\"docs/logo.svg\" width=\"96\" height=\"96\" alt=\"agent-memory-skills logo\"/>\n\n# 🧠 agent-memory-skills\n\n**A library of IDE skills for building an agent's memory.**\n\nNot the harness — the part that *remembers*. Feed any agentic IDE\n— [opencode](https://opencode.ai), Claude Code, or similar — a slash command\n*plus your spec*, and it builds the memory system you asked for: working memory,\nepisodic logs, distilled facts, learned playbooks, knowledge graphs, bitemporal\nhistory, consolidation, scratchpads, shared blackboards, and the eval harness\nthat proves any of it works.\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Memory types](https://img.shields.io/badge/memory%20types-10-a78bfa.svg)](#the-skills)\n[![opencode](https://img.shields.io/badge/opencode-ready-22d3ee.svg)](#install)\n[![Claude](https://img.shields.io/badge/Claude%20Code-ready-f97316.svg)](#install)\n[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](#contributing)\n\n*Companion to [agent-harness-skills](https://github.com/ArttuAn/agent-harness-skills) —\nthat repo builds the loop, this one builds what the loop remembers.*\n\n</div>\n\n## How it works\n\nYou teach your IDE once (install the skills), then building memory is a single\ncommand:\n\n```text\n\"using the memory-episodic skill, give my deploy agent a log of what it has\n tried before, outcomes verified by the CI exit code, so it stops repeating\n the same three failures\"\n```\n\nThe skill takes over: it asks the questions that decide the design, scaffolds the\nwhole thing — store, extraction, retrieval, CLI — and then *measures* it, because\na memory system that is never measured fails silently by construction.\n\n```mermaid\nflowchart LR\n    U[You: spec + slash command] --> I{Agentic IDE}\n    I --> S{{Skill loaded}}\n    S --> D[Asks the decisions<br/>that cannot be defaulted]\n    D --> R[Scaffolds the store]\n    R --> W[Write path<br/>+ the gate]\n    R --> Q[Retrieval<br/>+ ranking]\n    R --> C[CLI: list / forget / export]\n    W & Q & C --> V[Probe suite + negative control]\n    V --> P[A memory system<br/>with numbers on it]\n    style S fill:#1e1b3a,stroke:#a78bfa,color:#fff\n    style V fill:#0f172a,stroke:#22d3ee,color:#fff\n```\n\n## The skills\n\n| Memory | Skill name | Claude command | What it builds |\n| ------ | ---------- | -------------- | -------------- |\n| <img src=\"https://raw.githubusercontent.com/ArttuAn/agent-memory-skills/main/docs/logo.svg\" width=\"18\"/> Working | `memory-working` | `/memory-working` | Token budget, pinned turns, compaction, eviction — the context window as a managed resource |\n| 📓 Episodic | `memory-episodic` | `/memory-episodic` | Append-only log of what happened, with verified outcomes, recalled by similarity × recency |\n| 💡 Semantic | `memory-semantic` | `/memory-semantic` | Distilled facts behind an extraction gate, entity-keyed, with four-way contradiction resolution |\n| 🔁 Procedural | `memory-procedural` | `/memory-procedural` | Playbooks induced from repeated episodes, precondition-matched, demoted when they stop working |\n| 🕸️ Graph | `memory-graph` | `/memory-graph` | Entity–relation graph with conservative resolution and budgeted seed-and-traverse retrieval |\n| ⏳ Temporal | `memory-temporal` | `/memory-temporal` | Bitemporal facts — valid time *and* belief time — so \"why did it say that in March?\" is a query |\n| ♻️ Consolidation | `memory-consolidation` | `/memory-consolidation` | The background pump: merge, promote, decay, prune — with lineage, dry runs and crash safety |\n| 📝 Scratchpad | `memory-scratchpad` | `/memory-scratchpad` | A structured notes file the agent patches each turn — atomic, diffable, human-editable |\n| 🧑‍🤝‍🧑 Shared | `memory-shared` | `/memory-shared` | Multi-agent blackboard: namespaces, CAS writes, leases with fencing tokens |\n| 📊 Eval | `memory-eval` | `/memory-eval` | Probe suites, recall@k, staleness, leak gates, negative controls, longitudinal drift |\n\n## The tiers, and how they fit\n\nThe types are not alternatives. A mature system runs several at once, with\ndifferent lifetimes, and **consolidation is the pump between them**.\n\n```mermaid\nflowchart TB\n    subgraph turn[\"per turn — nothing survives\"]\n        W[Working memory<br/>budget · pin · compact]\n    end\n    subgraph session[\"per session — written by the agent\"]\n        SP[Scratchpad<br/>task · findings · ruled out]\n        SH[Shared board<br/>claims · facts · results]\n    end\n    subgraph days[\"days — append only\"]\n        EP[Episodic log<br/>task · outcome · lesson]\n    end\n    subgraph forever[\"forever — distilled\"]\n        SE[Semantic facts]\n        GR[Knowledge graph]\n        PR[Procedures]\n        TE[Temporal history]\n    end\n    W -->|worth keeping?| SP\n    SP --> EP\n    SH --> EP\n    EP -->|consolidation| SE\n    EP -->|induction| PR\n    SE <--> GR\n    SE --> TE\n    EV[[\"Eval harness — measures all of it\"]] -.-> SE\n    EV -.-> EP\n    EV -.-> GR\n    style EV fill:#0f172a,stroke:#22d3ee,color:#fff\n    style forever fill:#1e1b3a,stroke:#a78bfa,color:#fff\n```\n\n**Start at the top.** Working memory plus a scratchpad is a few hundred lines,\nno embeddings, no database, and it solves the complaint that produced the\nrequest — \"it forgets what we decided\" — in the overwhelming majority of cases.\nEverything below that line is machinery bought to solve a specific problem.\n`references/choosing-a-memory.md` is the map, including when each one is the\n*wrong* answer.\n\n## The write path is the design\n\nRetrieval gets the attention. The write path decides whether there is anything\nworth retrieving — and it is where every skill here puts its guards.\n\n```mermaid\nflowchart LR\n    T[Turn / episode] --> G{The gate}\n    G -->|rejected: hedged,<br/>affective, transient| X[Not stored]\n    G -->|accepted| K{Contradicts<br/>something?}\n    K -->|no| N[Store]\n    K -->|duplicate| R[Reinforce]\n    K -->|newer + trusted| S[Supersede<br/>old kept]\n    K -->|no grounds| C[Keep both,<br/>flag, surface both]\n    style G fill:#1e1b3a,stroke:#a78bfa,color:#fff\n    style C fill:#0f172a,stroke:#f97316,color:#fff\n```\n\nMost candidates should be rejected. Contradictions should never be resolved\nsilently. Nothing should be deleted that could be superseded instead. Those\nthree rules are most of what separates a memory system from a store of\nconfidently-asserted noise.\n\n## Install\n\nClone the repo, then run `install.sh` (no root needed):\n\n```bash\ngit clone https://github.com/ArttuAn/agent-memory-skills.git\ncd agent-memory-skills\n./install.sh                          # global: ~/.config/opencode/skills + ~/.claude/commands\n./install.sh --project                # or local: .opencode/skills + .claude/commands\n```\n\n`install.sh` spots you: skills land in your opencode config (with the shared\n`references/` copied alongside each one, since the skills cite them by relative\npath), commands land in your Claude Code config. `--opencode-dir` /\n`--claude-dir` point anywhere.\n\n## Usage\n\nIn **opencode**, invoke a skill by name together with your spec:\n\n```text\nmemory-semantic: my assistant keeps re-asking things I already told it. Facts\nworth keeping are my tooling preferences and project conventions; never store\nmoods or anything I hedge. Postgres-free, single user, SQLite is fine.\n```\n\nIn **Claude Code** (after install), the same thing as a slash command:\n\n```text\n/memory-semantic my assistant keeps re-asking things I already told it. Facts\nworth keeping are my tooling preferences and project conventions; never store\nmoods or anything I hedge.\n```\n\nEvery skill:\n\n- **Asks the decisions that cannot be defaulted** — what counts as a fact, what\n  one episode is, what is allowed to be destroyed. These are the questions that\n  determine whether the system works, and they are not inferable from a spec.\n- **Says when *not* to build it.** Every skill opens with the case against\n  itself. Four of the ten will regularly tell you to build something simpler.\n- **Scaffolds a complete, idiomatic project** (`pyproject.toml`, `src` layout,\n  env-based config, CLI).\n- **Uses only the `openai` SDK plus the Python stdlib** — SQLite, hand-rolled\n  cosine, `float32` BLOBs. No vector DB, no langchain, no numpy. Runs against\n  any OpenAI-compatible endpoint (OpenAI, Ollama, vLLM, LM Studio).\n- **Ships an offline embedder**, so the whole test suite runs in milliseconds\n  with no network and no key.\n- **Measures itself** — a probe suite, five metrics, and a negative control that\n  proves the probes are testing the memory rather than the model's priors.\n\n## The shared contracts\n\nSix documents the skills cite rather than restate. Worth reading on their own:\n\n| Reference | What it settles |\n| --- | --- |\n| [`choosing-a-memory.md`](references/choosing-a-memory.md) | Which type you need, when each is the wrong answer, which combinations work |\n| [`store-seam.md`](references/store-seam.md) | The four types every skill shares, the offline embedder, why SQLite and not a vector DB |\n| [`retrieval-quality.md`](references/retrieval-quality.md) | Composite scoring, MMR, query rewriting, hybrid search, how to inject memory honestly |\n| [`forgetting.md`](references/forgetting.md) | Decay, eviction, supersession, deletion — in that order, and why the order matters |\n| [`privacy.md`](references/privacy.md) | Scope as a primary key, write-time redaction, consent per fact, memory as an injection surface |\n| [`evaluation.md`](references/evaluation.md) | The verification contract: three tiers, the metrics, the negative control |\n\n## Anatomy of a skill\n\n```text\nskills/episodic/\n  SKILL.md                  # Theory, the decisions, inline code, failure modes, tests\ncommands/memory-episodic.md # Claude Code slash-command edition of the same skill\nreferences/*.md             # Shared contracts, cited by every skill\n```\n\nSKILL.md files follow the standard frontmatter contract so both opencode and\nClaude Code can load them:\n\n```yaml\n---\nname: memory-episodic\ndescription: \"Build an episodic memory: an append-only log of what the agent did, with outcomes, recalled by similarity and recency\"\n---\n```\n\nEvery skill carries the same six sections, and CI enforces it:\n\n`## Use this when` · `## Workflow` · `## The decisions that matter` ·\n`## Failure modes` · `## Required tests` · `## Verify`\n\n## Creating a new skill\n\nChecklist for adding a memory type:\n\n1. Pick a directory under `skills/` and name the skill `memory-<directory>`.\n2. Open with **when not to use it**. A skill that cannot argue against itself is\n   a sales page.\n3. `## The decisions that matter` is the load-bearing section: the choices a\n   frontier model will not make correctly from a bare spec, with the tradeoff\n   stated and a recommendation given.\n4. Inline, ready-to-paste Python for every module. Deps: `openai` + stdlib only.\n5. `## Failure modes` and `## Required tests` must correspond — every failure\n   mode worth naming should have a test that would catch it.\n6. Cite `references/evaluation.md` in `## Verify` rather than restating it.\n7. Add a matching `commands/memory-<directory>.md`.\n8. Run `python3 tools/check_skills.py` — it compiles every code block, validates\n   frontmatter and sections, and checks that every reference link resolves.\n\n## Contributing\n\nNew memory types, better code, tighter verifications — all welcome. Open a PR\nagainst `main`; keep the conventions above and make sure `tools/check_skills.py`\npasses before submitting.\n\n## Related\n\nThree repositories, one scaffold: same skill format, same `install.sh`, same `tools/check_skills.py`.\n\n- [**agent-harness-skills**](https://github.com/ArttuAn/agent-harness-skills) — Skills for scaffolding the agent loop itself — ReAct, plan-and-execute, reflexion, multi-agent, code agent.\n- [**eu-compliance-skills**](https://github.com/ArttuAn/eu-compliance-skills) — Skills that interrogate you before the code exists — GDPR, AI Act, CRA, NIS2, DSA, EAA, ePrivacy, with a gate that refuses on a blocker.\n\n## License\n\n[MIT](LICENSE) — do anything you like, attribute politely.\n\n## Installer safety\n\nThe installer validates the source before copying, refuses symlinks or junctions\nin source and destination paths, and refuses destinations that overlap source\ndirectories. Each file is replaced atomically; unrelated destination files are\npreserved. Removed upstream files are not automatically deleted: review obsolete\nfiles when upgrading. Install only into directories controlled by your user.\n"}