AMP Protocol

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

The problem

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.

Protocol vs registry

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.

The four primitives

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.

goal

A statement of intent, an active priority, or an operating principle.

PRIMITIVE · GOAL
[goal should, project, permanent] Optimize for virality over polish on every content decision.
> Traffic volume is the constraint, not conversion rate.

Facets: force (default should), scope (org|project|user), stability (permanent|seasonal|tactical).

claim

A factual assertion about the world, a product, a user, or an organization.

PRIMITIVE · CLAIM
[claim permanent] Arkzero was founded in 2026 as a one-person AI company.

Facets: stability (permanent|tactical).

directive

An instruction for what the consuming agent should or should not do. Bans, required procedures, conditional preferences.

PRIMITIVE · DIRECTIVE
[directive must, org, permanent] In all copy, never use em dashes.
> Org-wide ban on AI-cliche patterns.

Facets: force (must|should|may), scope (session|project|user|org), stability.

demonstration

A whole artifact showing a pattern to match or avoid. Single-line or multi-line brace block.

PRIMITIVE · DEMONSTRATION
[demo negative, illustrates: em-dash-ban] {
Original: "We're not just shipping — we're transforming."
Approved: "We're shipping a new format."
}
> Em-dash version reads as AI-slop; direct version is concrete.

Facets: valence (positive|negative|mixed, required), illustrates: <id> (optional).

Pack format

A pack is a directory with a fixed structure. The installer validates this structure before writing anything to disk.

PACK LAYOUT
my-pack/
manifest.json ← required
agents.md ← required
memory/
operating-principles.md ← always loaded
copy-voice.md ← loaded for writing tasks
content-strategy.md
...

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:

manifest.json
{
"name": "my-pack",
"title": "My Memory Pack",
"version": { "number": 1 },
"layout": "semantic-cluster",
"primitive_format": "inline-tag-v0.4",
"agents_file": "agents.md",
"agents": ["claude-code"],
"capability_files": ["operating-principles.md"],
"signed": false,
"signature": ""
}

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.

Signing

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.

~/PROJECT · ZSH
# one-time setup
$ amp keygen
[verified] keypair written to ~/.amp/keys/
# sign before publish
$ amp sign ./my-pack
[verified] signed:true written to manifest.json
# verify on any machine
$ amp verify ./my-pack --public-key ~/.amp/keys/signing.pub
[verified] signature valid

Install contract

When amp install --from-path ./my-pack runs, the installer enforces these gates in order:

GateCondition
1manifest.json exists and is valid JSON
2layout equals semantic-cluster
3agents.md exists
4All 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:

MANAGED BLOCK · CLAUDE.md
<!-- amp:begin @creator/slug -->
[agents.md content inlined verbatim]
> Pack files: .amp/slug/memory/
<!-- amp:end @creator/slug -->

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.

CLI reference

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.

amp keygen

Generate an Ed25519 signing keypair. Stored at ~/.amp/keys/signing.key and ~/.amp/keys/signing.pub by default.

$ amp keygen
$ amp keygen --out ./my-key.key # custom path
$ amp keygen --force # overwrite existing

amp sign

Sign a pack with your private key. Writes signed: true and signature into manifest.json.

$ amp sign ./my-pack
$ amp sign ./my-pack --key ./my-key.key

amp verify

Verify a pack's signature. Exits 0 if valid, 1 if tampered or missing.

$ amp verify ./my-pack --public-key ~/.amp/keys/signing.pub

amp install

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.

$ amp install --from-path ./my-pack
$ amp install --from-path ./my-pack --scope user
$ amp install --from-path ./my-pack --agent claude-code

amp inspect

Show metadata and tamper status of an installed pack.

$ amp inspect my-pack
$ amp inspect my-pack --scope user

amp uninstall

Remove an installed pack. Cleans the managed block from the agent rules file and deletes the pack directory.

$ amp uninstall my-pack
$ amp uninstall my-pack --scope user

Environment variables

VariablePurpose
AMP_PRIVATE_KEYPrivate key PEM string — overrides --key flag in sign
AMP_PUBLIC_KEYPublic key PEM string — overrides --public-key flag in verify

Both are optional and only relevant when publishing. The default flow (amp keygenamp signamp verify --public-key) works without setting either.

For registry installs (mm install @creator/slug), see MM-AMP Integration.

Skills

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.

/amp-capture

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.

/amp-unpack

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.

/mm-publish and /mm-add (MemoryMarket-specific)

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

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

Links