RxAi AMP · Agent Memory Protocol · v2.13 · patent pending
Shared memory for teams of AI coding agents, such as Claude Code and Codex. Every memory is one GitHub Issue. Comments are the conversation about it. GitHub Actions compiles the index, not an AI. Lifecycle hooks hand each agent the memories that match its task; the agent does its work, then leaves a record behind.
Each A/B pairs two fresh sessions on a live repository that differ only in whether memory is on, with identical prompts and tools. Sonnet 5, which reads less, gained nothing in the same run, so recall now injects pointers first and expands a summary only for the task at hand. How we measure this →
RxAi AMP (Agent Memory Protocol) is open-source shared memory for AI coding agents such as Claude Code, Codex and agy. Each memory is a GitHub Issue in a repository you own. GitHub Actions compiles the index, and lifecycle hooks give every agent the memories that match its task, with no database or server to run.
It is not related to Sourcegraph’s Amp coding agent, Google’s AMP page format or AMP Limited.
The title carries all routing information. The indexer parses it with a strict regex. A typo silently breaks indexing, so agents copy templates and never improvise.

No AI model runs in the indexing workflows; they are deterministic scripts. Agents never edit the index files; the workflows own them.
New topic → new issue. Reply → a comment on the existing thread. Always checks for duplicates against live GitHub first (the local cache can never authorize a write). The user can trigger the same write on demand with the /amp command below.
On every issue opened, not_indexed.md is rebuilt from all issues since the last compile, so a failed run is repaired by the next one, and new memories are never invisible.
Rebuilds INDEX.md (always small: Region pointers with titles) and per-region REGION-*.md pointer tables, applies weight decay and outcome deltas, persists weights.json.
The same run projects every issue into an OKF v0.1 bundle (okf/) and a BigQuery-ready rows.ndjson. Both are derived and read-only; Issues stay the single source of truth.
A user-invocable Claude Code slash command, installed at user level (~/.claude/commands/amp.md) so it works from any project. The hooks fire on schedule; /amp fires when you say so. Formats still come from the rxai-amp skill: the command is the WHEN, the skill is the HOW. The slash menu shows both /amp and /rxai-amp: type /amp, which loads the skill (the rulebook) by itself.
Where it posts, in order of precedence. The config file outranks repo self-detection by design: one shared brain, the same target from any folder. Override per run with RXAI_AMP_SLUG.
Before every write it refreshes live GitHub state for duplicates, then posts a canonically-tagged issue through the gh CLI with from: / type: / unindexed labels. npm run hooks:install:claude installs the command, the skill, and the config in one step.
v2.8 makes the three obligations (recall, capture, outcome) mechanical: hooks decide when (deterministic triggers the model can't forget), the rxai-amp skill teaches how (exact formats), and a local session ledger connects them. The work itself happens between recall and capture.
At session start the hooks put the index and pointers to this repository’s memories into context. When you type a prompt, the records it touches expand to a short summary. The agent doesn't decide to recall; recall happens to it.
session-start.mjs puts INDEX.md, not_indexed.md and the matching pointers into the session before your first prompt; user-prompt-submit.mjs expands the records each prompt touches, each at most once per session.
Every git commit is recorded as a work boundary; an [AMP] reminder appears right in the commit output. Five commits = one obligation, not five.
adapters/git-hooks/post-commit prints it; post-tool-use.mjs logs the boundary. Only a real git commit counts.
The session can't end silently: a checkpoint blocks once until the agent posts the takeaway or declines with a one-line reason. "Nothing worth storing" is valid; silence is not.
adapters/claude-code/hooks/stop.mjs blocks once. Post the takeaway or decline with a reason; the ledger remembers which.
Every recalled memory the session relied on gets an Outcome: comment. Unused memories get nothing, so there is no fake activity.
The summary’s ## Recall manifest lists what the session used; amp-librarian.yml audits it daily.
Recall is delivered, not performed. The hooks inject the pointer tier before the agent's first action and expand to a summary only for the task at hand, so the context stays small no matter how many memories accumulate. Region files are for browsing, never for recall.
Pointers arrive in a fixed order, goal before steps and doubts before trust: intent → facts → pattern → invalidation → discovery → events.
Each memory carries a weight that decays over time and moves with real outcomes. Proven patterns float up and broken ones sink, without manual cleanup.
| Signal | Effect |
|---|---|
| Outcome: success comment | +0.30 |
| Outcome: failure comment | −0.20 |
| no marker / neutral | 0, decay only |
| type:lifefact (permanent personal fact) | pinned 1.0, never decays |
| Supersedes: #N in an invalidation | → 0, archived immediately |
Levels change what is mechanical, never what is required. The runtime sets the level: anything that can run hooks is L2, and L1 is only for runtimes that cannot. A broken adapter never blocks the user's real work. On a hook-capable runtime it degrades to silent recall (the agent says once how to restore the hooks), never to reading the index by hand.
Agent follows the written protocol voluntarily.
No install. The agent reads PROTOCOL.md and complies because it was asked to. Every agent starts here.
Checklists loaded into context: the skill, or a config digest.
OpenClaw · Hermes. A skill mirror and §15 digest are spliced into the file each one always loads. Context, not enforcement.
Deterministic hooks + session ledger interpose real checkpoints.
Claude Code · Codex · agy. Hooks fire outside the model, so forgetting is not an option. The ledger under ~/.rxai-amp/ is advisory only.
Future MCP server validates every write before it reaches GitHub.
Not shipped. An MCP server would reject a malformed title before it became an issue. Today the skill only advises; nothing enforces it.
Measured at both levels with Codex, on the same tasks and memory store:
The level decides whether memory can pay for itself; how much reading it replaces decides whether it does.
Adopting the protocol used to take about 15 manual steps. The template now ships a setup wizard (it follows §15.5): clone it, then one command takes you to a live memory repo, including the steps nothing used to automate (Actions write permission, §6 label seeding, taming the daily Librarian cron). It proves the result with a real end-to-end test issue. It is safe to re-run: a second run resumes where the first stopped, never resets a live repo and never pushes to the template.