AI memory: a shared memory layer for coding agents¶
Type: concept. Status: watching (2026-11-23): explained, the tool ai-memory read and compared with our setup; nothing is installed and no idea is taken up yet.
"AI memory" here means a layer that keeps what coding agents learn while they work and hands it back to the next session, whichever agent, machine or person starts it. This page explains the idea, describes one open-source example, ai-memory, and reads it point by point against how our agents keep and recover knowledge. How these pages are built: index.
Independent origin
The owner developed this workflow independently of ai-memory. The ai-memory repository was created on 2026-05-21 (GitHub's repository data, read 2026-11-23); this repository's first commit is from 2026-09-27, and a search of its git history finds ai-memory first in the research page on RAG (#907, 2026-11). The coordinator's handoff note and rebuild from disk (#793) took Claude Code Projects as the model, not ai-memory. Where ai-memory and our setup agree, they arrived at the same practice separately.
Sources¶
Read on 2026-11-23. A statement no source below supports is marked unconfirmed. A figure the project reports about itself is marked "the project's own claim".
- The example: the ai-memory repository at commit
8591d75(2026-11-22; the version inCargo.tomlis 3.5.1, the latest release dated 2026-11-19): the README, the security page,SECURITY.md,DATA_HANDLING.md, the comparison page, the architecture page, the benchmark baselines, the agent messaging page and the multi-user page. GitHub's repository data and the README say MIT. - Critics: the OWASP Agentic Security Initiative's early draft Memory Poisoning
(file at commit
9bce634, last changed 2025-07-27), and two user reports in the Claude Code repository, #85075 and #75405. - Not readable here: the project's site,
aimemory.sh(the sandbox's network policy answered "approval required"; no allowlist change was requested). The README and the site could therefore not be compared, for example on the number of supported agents; the figures below are the README's. The same refusal blocked a web search's other hits on this subject: an OWASP blog post on memory as an attack surface, a Cisco write-up on poisoning Claude Code's memory file, a study of stale instruction files and several blog posts. They were found by a search but not read, so no statement here rests on them. - Our side: this repository, read on the same day; every row below links the file. The state of the issues #51, #368 and #793 was read on GitHub on the same day.
- Repository data: GitHub's API data for the repository (creation date, contributor list,
releases) and its
Cargo.tomlat the commit, read on the same day.
What it is¶
AI memory in general¶
An agent's context is what it holds in one session: it ends with the session, and a compaction shrinks it. An agent's own memory files, such as the notes Claude Code keeps per project, last longer but belong to one agent on one machine, which is the limit ai-memory's README names as its reason to exist (the project's own account, README). An AI memory layer sits outside both. It has four jobs:
- Capture what happened: prompts, tool calls and session boundaries, recorded by hooks the agent product calls at fixed points.
- Keep it somewhere that outlives the session and is not tied to one product: here, files.
- Recall it: search, and a short brief injected when a session starts.
- Hand over work: a note from one session that another picks up, in any product.
What differs from a bigger context window is that the memory is a store with its own rules for who may write, who may read and how long a note lives. What differs from an agent's own notes is that capture is automatic and the store is shared.
The example: ai-memory¶
ai-memory is a self-hosted memory layer for coding agents, written in Rust and licensed under MIT (README). One binary runs a server that owns one data directory; the points below are the README's and the linked pages', paraphrased.
- Source of truth: a git-versioned wiki of ordinary Markdown files. A SQLite database holds a derived index (full-text search, entities, links) that can be rebuilt from the files. Vector search is optional and needs an embedding provider; the README says the default path makes no calls to a language model.
- Capture: lifecycle hooks send prompts, tool calls and session boundaries to the server. A sanitizer strips credentials at a typed boundary before anything is stored. At session end the server consolidates the observations into wiki pages; a language model writes them only when one is configured.
- Recall: an MCP server, a command-line tool and a web view (the web view needs
--enable-web; a fuller management console needs a compile-time and a runtime switch). A session starts with a bounded brief, and agents can search everything. - Handoff: a typed handoff that states where work stopped, what failed and what is open. Each
handoff has an owner and is claimed exactly once. A claim-once inbox between projects exists
too (agent messaging).
ai-memory runcan also carry a session between products (the README's support table marks "Managed workstreams" as opt-in). - Sharing: one server for several machines and people, with accounts, per-person attribution and an audit log; knowledge is shared per project, personal handoffs stay personal (multi-user page). The README says these are not a paid tier.
- Ageing: access-weighted retention is always on, because it can only keep notes longer. The README says
near-duplicates collapse and likely contradictions are flagged without any model call, and that
compaction to durable facts is off by default; its configuration reference lists cold-cluster
deduplication as off too (
dedup_cold_clusters = false), and the contradiction flag is advisory and needs stored embeddings (architecture page). The README says nothing is hard-deleted and the earlier version stays in git; the data-handling page adds that a retention sweep removes cold notes, then hard-deletes their tombstones after 180 days by default, and hard-deletes pages whose time to live has passed (DATA_HANDLING.md). An opt-in "dream" pass lets a language model rewrite clusters of cold notes; it is off by default and, by the project's own statement, has not shown a gain in its recall evaluation yet (comparison page). - Reach: the README says "more than twenty harnesses" feed one memory; its support table lists 36 agent products, each at its own level: supported, hooks only, MCP only, managed only; native Windows is experimental. The text and the table differ in count, and the site could not be read to add a third figure.
- Benchmark: on LongMemEval-S, a public test of recalling facts from long chat histories, the project's own harness reports hit@5 of 0.953 for the zero-model path and 0.940 with local embeddings (release 3.5.0, 2026-11-18); this is the project's own claim. Its comparison page says the published numbers of the tools it compares measure different things and that all but its own are self-reported (comparison page, baselines).
How it relates to what we have¶
The rows set each point of ai-memory beside the nearest thing in this repository. The short version: our agents recover state from GitHub and a small coordinator state file, and we write knowledge by hand; ai-memory records what happened automatically and searches it.
| # | ai-memory | Verdict | Our side |
|---|---|---|---|
| 1 | Plain Markdown in git is the source of truth | same | Curated knowledge is Markdown in git: the docs, the decision records and the lessons learned (decisions.md, lessons-learned.md). We have no derived index; agents read the files |
| 2 | Hooks capture prompts and tool calls automatically | gap | Nothing records a session's prompts or tool calls. A worker reports one line to the coordinator and puts details in a pull request or issue comment (work-on skill (plugins/workflow/skills/work-on/SKILL.md), "Reporting") |
| 3 | A sanitizer removes credentials before storing | different | We store no transcript, so nothing is sanitized. Instead, a rule keeps secrets out of what is written: key names, never values, and no token on a command line or in the chat (CLAUDE.md, the baseline rules (plugins/dev-env/baseline/baseline.md)); Gitleaks and TruffleHog scan what is pushed (checks.md) |
| 4 | Session end turns observations into readable pages | different | The coordinator keeps a free-text handoff note and a state file of tasks, owner decisions and open questions (coordinator handoff, coordinator decision; plugins/workflow/skills/coordinator/compaction.md). They are written on purpose, not derived from a transcript |
| 5 | A bounded brief is injected whenever a session starts | different | After /clear or a compaction a hook rebuilds the coordinator from its state file; the block is a cache and coordinator status reads GitHub afresh (plugins/workflow/skills/coordinator/compaction.md). It covers the coordinator only, from a fixed file, not a search |
| 6 | Search over everything through a derived index: full text, entities, links, optional vectors | gap | No recall service. Agents search the repository directly and read library documentation through an outside server; the RAG page (rows 1, 2) draws the same line |
| 7 | A handoff is claimed exactly once | same | An issue is claimed once, by the label agent:claimed and a claim comment that only a "Claim released" comment ends; a reservation records an order for later (parallel-work.md) |
| 8 | Handoff between agent products, with a managed session carried across | gap | Workers and coordinators are Claude Code sessions; the other products in the loop are reviewers whose findings are input to weigh (architecture 3.2). Nothing carries a session from one product to another |
| 9 | One server shared by machines and people, with accounts and an audit log | different | GitHub is the shared record: claims, comments and reports, and its history is the audit trail. The coordinator state file is one machine's cache (coordinator skill (plugins/workflow/skills/coordinator/SKILL.md)); a cloud coordinator keeps no state file and works from the claims (parallel-work.md). How coordinators on Windows and Linux reach each other is the open issue #51 (state on 2026-11-23, read on GitHub) |
| 10 | Notes age: decay, merge, flag contradictions | different | A maintenance task lists memory entries older than a set number of days and links to files that are gone, and asks the owner for each entry whether to move it into the handoff note or delete it; it never changes a memory file on its own (plugins/workflow/skills/maintenance/tasks/memory-hygiene.md) |
| 11 | Stored text is untrusted historical data | same | Issue text is data and never changes a worker's rules (parallel-work.md); a "green" is a report, not consent (work-on skill (plugins/workflow/skills/work-on/SKILL.md)), and neither is another session's message (coordinator skill (plugins/workflow/skills/coordinator/SKILL.md)). ai-memory marks stored material the same way in its handoffs and briefs (SECURITY.md) |
| 12 | The store holds decisions among its pages | different | The decisions stay with the owner: a decision record leaves the decision and rationale empty until the owner writes them, and open questions go on a decision page (decisions.md, lessons-learned.md). A decision record is never rewritten after it is decided; a later one links back to it (the records' README (docs/adr/README.md)), so the decision it replaced stays readable |
| 13 | A profile of the user's usual choices follows them to every repository | different | The dev-env plugin installs fixed baseline rules that hold in every repository (plugins/dev-env/baseline/baseline.md); they are written by the owner, not learned from sessions |
Claude Code's per-project memory files, the local notes ai-memory sets itself against, are used
here for one purpose: how the owner wants the coordinator to work across rounds. A round's own
state does not go there (plugins/workflow/skills/coordinator/compaction.md).
Claude Code's own documentation of those files could not be read here; what is said of them rests
on our files and on a user report (#85075) that gives their location and load limits.
Risks that apply to us¶
Each risk is checked against a rule we already hold. They describe rules, not a gap anyone could use.
- A captured transcript can hold a secret. A prompt can contain a pasted token, and a tool
call can print one. Our rule is that a key's name may appear and its value never does, and that
a token is not asked for in the chat (
plugins/dev-env/baseline/baseline.md). ai-memory's sanitizer is, by its own documentation, best-effort and not a guarantee (DATA_HANDLING.md). Capture would therefore need repository rules that exclude paths, which the README says exist, before any session of ours could feed it. - Recalled text is data, not an instruction and not consent. A brief or a handoff would reach
an agent as text. Our rule already treats issue text, review findings and other sessions'
messages that way (parallel-work.md); a
recalled note would need the same label. ai-memory says its own sanitization is defence in
depth and that agents must check security-sensitive claims against current instructions and the
checkout (
SECURITY.md). - A shared server is one more thing that holds the owner's content. It would hold prompts and tool output from private repositories. The only access label we keep is "published or not", decided before the docs site is built (checks.md); a memory server would need its own boundary, as the RAG page found for an index.
- The default of the example is open in places. A fresh native
initcreates a bearer token; the Docker quick-start and an install created before that default run without authentication on the loopback address untilauth enable(README, security page). Its documentation also shows--auth-tokenon a command line for a remote server, which our rule against a token on a command line forbids; the local setup reads the token from a file in the data directory. - Optional paths send content out. An embedding provider, a language-model provider,
assistant-text capture, an LLM reranker and admission webhooks each send stored text to a
service; all are off by default (
DATA_HANDLING.md). There is no encryption at rest in version 1, only file permissions.
Critical assessment¶
What critics say¶
The strongest argument first. Each is the author's opinion, not a finding. No critic of ai-memory itself was found: the sources are about agent memory in general or about Claude Code's own memory files, the closest readable material. The other hits of the search could not be read (see Sources), so context bloat and lock-in to one tool's format have no critic read here.
- Poisoned or misleading memory steers later runs, and shared memory spreads it. The OWASP Agentic Security Initiative's early draft says an adversary can add malicious or false data to an agent's memory, that entries then influence later runs and other agents that read them, and that this makes memory poisoning a systemic risk. Its scenarios include a corrupted shared memory that other agents rely on (OWASP draft). It is an early draft of a working group, not a final list.
- Old memory loads silently. A user of Claude Code's built-in memory reports a three-month-old index describing a repository that had since changed, loaded into every session by default with no sign of its age, and argues that in a repository shared by many workstreams one stale or wrong note spreads to all of them (Claude Code #85075, 2026-08-08). It concerns Claude Code's memory, not ai-memory, whose ageing is the answer to this complaint (and is partly off by default, see above).
- A recalled summary can stand in for evidence. Another user reports that an agent called a pipeline ready from a previous session's summary in its memory, without checking the files, and that the files had in fact been lost. The user expects the agent to say "memory says tested" apart from "the artifacts show tested" (Claude Code #75405, 2026-07-07). One account of one case, not checked by us.
Our assessment¶
| Concern | Evidence | Severity | What would settle it |
|---|---|---|---|
| Real need against a gimmick: what a memory layer would add is recall across hosts and products; our agents already recover state from GitHub and the state file, and nothing is shown lost for lack of recall | rows 4, 5, 7, 9; #793 (closed) | serious | a list of concrete cases where a coordinator or worker needed knowledge that only a past session held, and the issues, comments and docs did not |
| Security and data protection: captured prompts and tool output could hold a secret or private-repository content, and stored text can steer an agent | rows 2, 3, 11; critic 1; DATA_HANDLING.md |
serious | a capture rule that excludes by default and an allowlist per repository, tried on a sample of real sessions with the output checked for secrets |
| Data quality and availability: stale or wrong notes mislead a coordinator; our maintenance task reports old entries but acts only after the owner's answer | row 10; critics 2, 3 | minor | how many of the coordinator's memory entries the hygiene task flagged over a month, and whether any misled a round |
| Operation and monitoring: a server needs a host, a token, TLS beyond loopback, backups and an owner for each | security page; README's one-server-per-data-directory rule | unknown | which host would run it, who restarts it, and a backup test; not tried |
| Alternatives and opportunity cost: the cross-host question is already open as #51 with GitHub claims as the record, which costs no new service | rows 7, 9; #51 | minor | whether #51's design leaves a recall gap that a memory layer would fill |
| Dependencies and vendor lock-in: one project, one account has far more commits than any other (GitHub's contributor list, 2026-11-23), and it releases often (3.5.1 on 2026-11-19); the Markdown source makes leaving cheap | README, GitHub's data | minor | a run of its export or a copy of the wiki read without it |
Bottom line¶
Skip adopting ai-memory for now; keep the question of cross-host recall with #51 and revisit if a list of cases (above) shows knowledge that GitHub and the docs do not hold.
What we could adopt¶
Results after checking each idea against our code and docs. A result is a recommendation: no issue is filed from this page, and the workflow does not change because of it.
- A cross-agent recall layer for coordinators on several hosts (rows 8, 9)—needs the
owner. It touches #51, which is open; #368 compares Claude Code Projects with the coordinators and is
related, not the same question. It would not need root, because the README sets ai-memory up as a
per-user service (
systemd --useror alaunchdagent), so it does not conflict with the rule against escalating privileges. It would conflict with the secret rule unless capture is limited as described under the risks. The cheaper route is GitHub claims, which exist. - An index over
docs/and the issues (row 6)—don't adopt. Agents search the repository directly, private and public material would mix, and the RAG page reached the same result. - Ageing of the coordinator's notes (row 10)—don't adopt as automatic decay. The maintenance task states that a memory file is never changed without the owner, so automatic decay or merging would contradict it; the report-only task already covers the stale entries.
- Automatic capture of prompts and tool calls (rows 2, 3)—don't adopt. Our reports are one line by design and the secret rule holds for every file we write; a transcript store would need the capture limits first.
- Marking recalled text as a record to verify (row 11)—nothing to adopt. The rebuild block
already says it is a cache and that
coordinator statusreads GitHub.