AMP (Agent Memory Protocol) is an open format for packaging and transferring AI agent memory. This page covers the full technical picture: why AMP exists, what the four primitives are, how a pack is structured, how signing works, and what the install contract guarantees.
AMP is open-source. View on GitHub · Install: npm install -g @arkzero/amp
Every AI coding agent has memory. It lives in CLAUDE.md, AGENTS.md, .cursorrules. You build it up over months — style rules, operating principles, product facts, playbooks. But that memory is locked to you and locked to the tool. There is no standard to move it between Claude Code, Codex, and Cursor. There is no mechanism for a senior developer to install their working context into a new hire's setup. Code has GitHub. Packages have npm. Agent memory had nothing.
AMP is the protocol. A registry implements it. The distinction is hard: the protocol does not know about any specific registry. Anyone can run their own registry by implementing the integration contract.
AMP owns the transfer layer — the pack format, signing, and install contract. The distillation of your notes into a pack (/amp-capture skill) and the host integration that injects the pack into your agent are adapters on either side.
A piece of memory is linguistically doing one of four things. First-principled from scratch, tested on 79 real memory files across 9 locations: 0% unclassifiable.
A statement of intent, an active priority, or an operating principle.
Facets: force (default should), scope (org|project|user), stability (permanent|seasonal|tactical).
A factual assertion about the world, a product, a user, or an organization.
Facets: stability (permanent|tactical).
An instruction for what the consuming agent should or should not do. Bans, required procedures, conditional preferences.
Facets: force (must|should|may), scope (session|project|user|org), stability.
A whole artifact showing a pattern to match or avoid. Single-line or multi-line brace block.
Facets: valence (positive|negative|mixed, required), illustrates: <id> (optional).
A pack is a directory with a fixed structure. The installer validates this structure before writing anything to disk.
agents.md is the routing table. It tells the consuming agent which capability files to load for which task type. Files under memory/ are organized by what-kind-of-task — primitives mix freely within each file.
Minimal manifest.json:
The primitive_format field switches the reader between v0.3 (yaml-frontmatter-v0.3) and v0.4 (inline-tag-v0.4). When absent, defaults to v0.3 — older packs continue to install without changes.
About signing keys. Not API keys. AMP has no server and no auth. amp keygengenerates an Ed25519 keypair on your own machine. The private key stays with you and signs packs you publish. The public key ships inside the pack so anyone can verify the pack wasn't tampered with. If you only install packs, you never touch either key.
Packs are signed with Ed25519 before publishing. The signing payload covers the manifest fields plus the SHA-256 hash of every file in the pack. The registry re-verifies on every install — tampered packs are rejected before they reach your machine.
When amp install --from-path ./my-pack runs, the installer enforces these gates in order:
| Gate | Condition |
|---|---|
| 1 | manifest.json exists and is valid JSON |
| 2 | layout equals semantic-cluster |
| 3 | agents.md exists |
| 4 | All capability_files present under memory/ |
| 5 (registry) | signed is true and signature verifies |
On success, the pack extracts to .amp/slug/ and the installer appends a managed block to your host rules file:
The block is additive — your existing content is untouched above and below it. amp uninstall slug removes the block and the .amp/slug/ directory atomically.
The amp binary is the open-source reference CLI for the protocol (npm install -g @arkzero/amp, Node.js 18+). It works on local pack directories only — for registry installs, see MM-AMP Integration.
Generate an Ed25519 signing keypair. Stored at ~/.amp/keys/signing.key and ~/.amp/keys/signing.pub by default.
Sign a pack with your private key. Writes signed: true and signature into manifest.json.
Verify a pack's signature. Exits 0 if valid, 1 if tampered or missing.
Install a local AMP pack into the current project's agent. Flags: --scope user (global), --agent <name> (claude-code | codex | cursor | windsurf | openclaw). Agent auto-detected from project markers if omitted.
Show metadata and tamper status of an installed pack.
Remove an installed pack. Cleans the managed block from the agent rules file and deletes the pack directory.
| Variable | Purpose |
|---|---|
AMP_PRIVATE_KEY | Private key PEM string — overrides --key flag in sign |
AMP_PUBLIC_KEY | Public key PEM string — overrides --public-key flag in verify |
Both are optional and only relevant when publishing. The default flow (amp keygen → amp sign → amp verify --public-key) works without setting either.
For registry installs (mm install @creator/slug), see MM-AMP Integration.
AMP ships two Claude Code skills for the judgment-heavy ends of the flow. Drop either skill file into your .claude/skills/ directory to activate it.
Distills a Karpathy-style wiki (knowledge-base/wiki/) or raw memory folder into a valid v0.4 pack. Runs inside a host agent (Claude Code, Codex). Routes each memory unit to the correct capability file, runs the credential scanner on every unit, and writes v0.4 inline-tag format only. View skill source.
After amp install, integrates the installed pack into your Karpathy wiki at knowledge-base/wiki/. Reads the routing table from agents.md, updates the wiki index, and adds wikilinks. Scaffolds a new wiki if one does not exist. Idempotent — safe to re-run after pack updates. View skill source.
The memorymarket CLI ships two MM-specific skills: /mm-publish drives the creator publish flow (auth, key setup, source discovery, inline pack assembly using the AMP extraction phases, sign, publish — the user creates the draft on the web first and passes the pack-id to the skill) and /mm-add drives the install side (mm install plus optional inline wiki integration). MemoryMarket does not ship separate /mm-capture or /mm-unpack triggers — those phases run inline inside /mm-publish Phase 3 and /mm-add Phase 4 respectively. Both skills ship in the memorymarket npm package under skills/; install them by asking your agent to copy them into ~/.claude/skills/.
MemoryMarket is the default registry for AMP. It adds identity, payments, discovery, and server-side re-verification on top of the protocol. → MM-AMP Integration