agent-memory-mcp
It provides a plain-markdown memory store with rule enforcement, signed compliance receipts, cross-tool rule files, auditing, and git sync.
Save, update, fetch, list, search, and fuzzy-search memories; retrieve full relevant context for LLM ingestion.
Store memories as markdown/YAML with types (user, feedback, project, reference, rule), tags, and wiki-links.
Delete memories only with a target-bound, single-use Compliance Receipt; restore soft-deleted memories from trash.
Create and list rule memories with severity, scope, regex matches, enforce_on categories, natural-language applies_when conditions, and last_verified dates.
Check proposed actions via check_action: deterministic regex matching plus optional MCP Sampling; returns approvals, hard violations, soft warnings, and short-lived receipts.
Emit rules to AGENTS.md, CLAUDE.md, Cursor .mdc rules, and Gemini instructions.
Validate CRP 1.1 Ed25519 receipts from other servers and rotate signing keys.
Audit rule health, stale rules, conflicts, denials, unreceipted ops; inspect event logs, stats, and storage integrity/rebuild index.
Initialize a starter guardrail pack and sync memory stores across machines via git push/pull/status.
Use graph helpers: backlinks and related-memory discovery; verify memory claims for URLs/dates/file refs.
Integrates with Amazon Q by emitting companion rule files that Amazon Q automatically reads, enabling consistent rule enforcement across AI coding assistants.
Integrates with GitHub Copilot by emitting AGENTS.md and other companion files that Copilot automatically reads to enforce rules.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-memory-mcp save a hard rule to block force-push to main"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-memory-mcp
Guardrails for AI coding agents — write the rule once, every tool obeys, destructive actions get blocked.
Your AI coding agent will eventually try to rm -rf the wrong folder, force-push to main, or delete the file you actually needed. agent-memory-mcp is the memory layer where you write the rule once, in plain markdown — and it enforces itself:
Blocks destructive actions at the protocol layer. The agent proposes an action; the server checks it against your rules and either refuses it or issues a short-lived, signed Compliance Receipt it must present to act. Soft rules in a config file get ignored — this doesn't.
One rule, every tool. Save it once and it emits to
AGENTS.md,CLAUDE.md,.cursor/rules/, and.gemini/automatically — Claude Code, Cursor, Cline, Copilot, Gemini and Windsurf read the same rules, no plugin.Plain files you own.
catit,grepit, edit it in vim, commit it to git, sync it across machines withagent-memory sync. No database, no daemon, no cloud — and if the AI gets it wrong, you fix it in a text editor.
Memory — the rules, recipes, decisions, and context that survive every session and every tool — is the substrate. Enforcement is the point. Reference implementation of the Compliance Receipt Protocol 1.0, so other MCP servers can adopt the same receipts and interoperate.
Quickstart · guarded in 60 seconds
# After adding the server to your MCP client (see Install below), from your project:
agent-memory init # drop in a starter guardrail pack (protect main, no rm -rf, no prod-data destruction, …)
agent-memory install-hooks # make hard rules actually BLOCK in Claude Code (soft rules → ask)Your agent is now guarded across every tool. Write your own rules with save_rule — they enforce and emit to AGENTS.md / CLAUDE.md / .cursor/rules / .gemini. (CLI commands assume a global install — npm i -g @xultrax-web/agent-memory-mcp — or prefix with npx -y.)
Related MCP server: intaris
Memory as constraint · the v0.11 → v0.13 arc
What v0.10 and below shipped: a great file-based memory store. What v0.11+ added: rules that enforce themselves. A rule memory type carries severity (hard / soft), scope, applies_when, matches regex patterns, enforce_on categories, and last_verified date. From those, the server projects companion files out to every AI tool and gates destructive operations via cryptographic receipts.
1. Rule memories project to every tool
agent-memory save-rule no-emojis-ever \
--description "Never use emojis in commits, comments, or chat output." \
--severity hard \
--scope global \
--enforce-on commits,chat_responses \
--content "No emojis. Anywhere. Ever."
agent-memory emit-companions
# writes AGENTS.md + CLAUDE.md + .cursor/rules/*.mdc + .gemini/instructions.mdTarget | Path | Auto-loaded by |
|
| Claude Code, Codex CLI, Cursor, Aider, Devin, Copilot, Gemini CLI, Windsurf, Amazon Q |
|
| Claude Code (5-level hierarchy · managed/global/project/local/subdir) |
|
| Cursor (MDC format) |
|
| Gemini CLI |
Set AGENT_MEMORY_AUTO_EMIT_DIR=/path/to/project and the server re-emits all four files automatically on every rule save.
2. check_action · the protocol enforcement point
# Agent proposes an action · server matches against rule store
agent-memory check-action "delete the memory called old-project-notes" --type deletions
# → On approval: returns a Compliance Receipt the agent passes back to destructive tools
# → On deny: returns structured hard_violations + soft_warningsMCP shape:
{
"name": "check_action",
"arguments": {
"action": "delete the memory called old-project-notes",
"action_type": "deletions",
"session_id": "sess_abc",
},
}Tier 1 (deterministic, every client): action matched against rule.matches regex, filtered by rule.enforce_on. Hard violations block. Soft violations warn. Approved actions get a fresh receipt with 60s TTL.
Tier 2 (Sampling-enriched, shipped v0.11.7): for rules with applies_when natural-language conditions, the server uses MCP Sampling to ask the client's LLM whether the proposed action triggers the rule. Falls back to Tier 1 only if the client doesn't advertise Sampling capability. Works on Claude Desktop and VS Code Copilot; on Claude Code, Cursor, Cline, and Codex CLI you get Tier 1 only — which is enough to enforce the rules you've written.
But check_action only gates this server's own tools. To enforce your rules on the agent's real actions — the shell commands and file writes it runs — agent-memory install-hooks wires a PreToolUse hook into Claude Code: a hard rule denies the matching tool call, a soft rule asks you. Now an rm -rf or a force-push to main is actually blocked, not just advised. Run agent-memory init first for a starter ruleset.
3. Compliance Receipts · the cryptographic primitive
Receipts are short-lived, signed bearer tokens with caveats (Macaroon pattern · Birgisson et al., NDSS 2014). The novel protocol primitive: server-issued tokens that bind to action + session + rules-version-hash + expiry. Tampering breaks the signature. Rule changes invalidate every outstanding receipt (because rules_version is part of the signed payload).
import { issueReceipt, validateReceipt } from "@xultrax-web/agent-memory-mcp";
const r = issueReceipt({
caveats: [
{ type: "action", value: "delete_memory" },
{ type: "session", value: "sess_abc123" },
],
ttl_seconds: 60,
});
const v = validateReceipt(r, {
required_caveats: [{ type: "action", value: "delete_memory" }],
});
if (!v.valid) throw new Error(v.reason);Receipt-required delete_memory (v0.12.0 breaking change): calling delete_memory without a valid receipt is refused. The two-step pattern is check_action → delete_memory(name, receipt). The signing-key file lives at <MEMORY_DIR>/.keyring/hmac-key (CRP 1.0) or <MEMORY_DIR>/.keyring/ed25519-priv (CRP 1.1), 0600 perms on POSIX. Receipts are bound to their specific target (the action_hash caveat for delete memory <name>) and are single-use; the .keyring/ is never committed or synced, and rotate_key regenerates it after a suspected leak.
CRP 1.1 · Ed25519 federation (v0.13.0): flip CRP_SIGNING_MODE=ed25519 and the server signs with an asymmetric keypair instead of HMAC. The public key gets published at <MEMORY_DIR>/.keyring/ed25519-pub, so other MCP servers can validate your receipts without sharing a secret. The protocol allows cross-server enforcement: server A issues a receipt for "delete X", server B validates and honors it.
4. audit · operational health for the rule store
agent-memory audit # pretty colored terminal output
agent-memory audit --json # structured JSON for toolingSurfaces:
Rule count by severity (hard / soft / unspecified)
Stale rules ·
last_verified> 90 days, or never verifiedPattern conflicts · two rules sharing an
enforce_onAND an identical regex inmatchesRecent denials ·
check_actioncalls that blocked an action (spot over-aggressive rules)Unreceipted destructive ops · should be empty in v0.12+; non-empty means a client is calling
delete_memorywithout going throughcheck_action
The healthy flag is true iff no stale rules, no conflicts, no unreceipted ops.
5. CRP 1.0 / 1.1 as a portable spec
The receipt protocol is documented standalone at docs/compliance-receipt-protocol-1.0.md. Other MCP servers can adopt the same format + validation rules to interoperate · agent-memory-mcp is the reference implementation. The spec covers: receipt structure, canonical encoding, signing (HMAC-SHA256 for 1.0, Ed25519 for 1.1), validation order, rules-version hashing, reserved caveat types, MCP integration patterns, security considerations, cross-server adoption, and test vectors.
What you get
.agent-memory/
├── MEMORY.md # auto-managed index
├── user-prefers-tabs.md
├── feedback-no-emoji-in-code.md
├── project-q3-launch-frozen.md
└── reference-postgres-runbook.mdA memory file is just markdown with YAML frontmatter:
---
name: feedback-no-emoji-in-code
description: User wants zero emoji in commits, comments, or output
type: feedback
---
Hard rule. No emoji anywhere user-facing.
**Why:** prior contractor flooded the repo with them; user spent a
weekend removing them.
**How to apply:** scrub before commit; reject any tool output that
adds them automatically.That's the whole format. No magic. Read it, edit it, ship it.
Why this exists
Most MCP clients have no persistent memory. The ones that do (Claude Code) store it where only that client can see it. The official server-memory and every community alternative use opaque structured backends. That's fine for some workflows — but it puts your data behind a layer you can't read with cat.
We chose markdown because:
Universal. Every developer can read markdown. Every editor handles it. Every diff tool understands it.
Portable. Memories travel with the project (per-project default) or with you (global mode). Move them, copy them, fork them — they're just files.
Inspectable. You can audit what your AI assistant "knows" by opening a folder.
Repairable. When a memory is wrong, you fix it the way you fix any text file. No SDK, no API, no SQL.
Versionable. Git understands every change. No JSON merge conflicts. No binary blobs.
If you want vector similarity search, semantic recall, or auto-relation extraction — use one of the database-backed memory MCPs. They're great at that. If you want memory that you can still read after a power outage, this is for you.
Install
From npm (recommended)
npx -y @xultrax-web/agent-memory-mcpListed in the MCP Registry
io.github.xultrax-web/agent-memory-mcp · browse at https://registry.modelcontextprotocol.io
Build locally
git clone https://github.com/xultrax-web/agent-memory-mcp
cd agent-memory-mcp
npm install
npm run build
node dist/index.jsThe server speaks MCP over stdio. You don't run it directly — your MCP client launches it.
Client configuration
Same JSON, slightly different paths per client.
Cursor
~/.cursor/mcp.json (or .cursor/mcp.json in your project):
{
"mcpServers": {
"agent-memory": {
"command": "npx",
"args": ["-y", "@xultrax-web/agent-memory-mcp"]
}
}
}Cline (VS Code extension)
Cline → MCP Servers → Add:
{
"agent-memory": {
"command": "npx",
"args": ["-y", "@xultrax-web/agent-memory-mcp"]
}
}VS Code (Copilot Chat)
Two VS Code paths. The Cline section above is for the Cline extension specifically (its own MCP server UI). This section is for VS Code's native MCP support — GitHub Copilot Chat reads it directly. Pick whichever matches your assistant; both coexist fine.
.vscode/mcp.json (workspace) or via User Settings → Edit mcp.json:
{
"servers": {
"agent-memory": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@xultrax-web/agent-memory-mcp"]
}
}
}Claude Desktop
%APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"agent-memory": {
"command": "npx",
"args": ["-y", "@xultrax-web/agent-memory-mcp"]
}
}
}Windows note: if
npxdoesn't resolve cleanly, wrap withcmd /c:{ "command": "cmd", "args": ["/c", "npx", "-y", "@xultrax-web/agent-memory-mcp"] }
Continue.dev
~/.continue/config.json:
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@xultrax-web/agent-memory-mcp"]
}
}
]
}
}Storage scope
Per-project (default): memories live in ./.agent-memory/ relative to wherever the client launched the server. Usually that's the project root.
Personal / global pool:
"env": { "AGENT_MEMORY_SCOPE": "global" }Global memories live at ~/.agent-memory/.
Custom path:
"env": { "AGENT_MEMORY_DIR": "/abs/path/to/memory" }Tools
Tool | Purpose |
| Create or update a memory. Atomic write + locked. Validates name + type. Updates the index. |
| Fuzzy search (Fuse.js · typo-tolerant, word-order tolerant, partial matches). Returns top N with relevance 0-100 + body snippet. |
| Same matching as search, but returns full memory bodies as one markdown doc. Built for LLM auto-context. |
| Fetch one memory by name. Returns frontmatter + body. |
| List memories. Optional |
| Receipt-required, target-bound, single-use. Pass a Compliance Receipt from |
| Restore a soft-deleted memory from |
| Storage integrity check. Reports orphans, dangling index entries, unreadable files. Pass |
| Dashboard: counts per type, total size, largest memory, audit-log size, trash count. |
| Read recent entries from the audit event log. Optional |
| Re-evaluate a memory's claims. Extracts URLs/dates/file refs, flags stale-date signals, returns type-specific verification heuristics. Pairs with the |
| List memories that link to the given memory via |
| Surface memories related to one by combining outbound links, inbound backlinks, shared tags, type match, and content similarity. Navigates the memory graph by association. |
| Report git-sync state: remote URL, branch, uncommitted local files, ahead/behind origin. |
| Commit local memory changes + push to the configured git remote. Auto-timestamps the commit message if none given. |
| Fast-forward pull from the git remote. Refuses to pull if local changes are uncommitted. |
| v0.11+. Create or update a |
| v0.11+. List just rule memories, optionally filtered by severity or enforce_on category. |
| v0.11.1+. Project the rule store out to |
| v0.11.3+. Tier-1 deterministic + Tier-2 Sampling rule check. Returns |
| v0.11.4+. Operational health for the rule store: stale rules, pattern conflicts, recent denials, unreceipted destructive ops. Returns JSON or pretty-prints. |
| v0.14+. Rotate the receipt-signing HMAC / Ed25519 keys, invalidating every outstanding receipt. Remediation after a key leak. Optional |
| v0.15+. Install a starter guardrail pack (protect main, no rm -rf, no prod-data destruction, no curl|sh, flag secrets) and emit it to every tool. |
| v0.15+. Validate ANOTHER server's CRP 1.1 (Ed25519) receipt with its public key · the federation primitive. Pass |
Prompts
The server exposes 4 built-in MCP prompts that clients (Claude Desktop, Cursor, etc.) surface as slash-commands. These turn memory into an active workflow layer, not just a passive store:
Prompt | Arguments | What it does |
| none | LLM scans the current conversation, proposes candidate memories, and calls |
|
| LLM pulls memories relevant to the topic via |
|
| LLM walks project-type memories matching the filter and assembles a structured handoff doc (current state, open items, watch-outs). |
| none | LLM evaluates project + reference memories for staleness and produces a triage list (likely stale / worth verifying / still fresh). |
Memory types
Five built-in types. The first four match the Claude Code convention; rule is what v0.11 added:
user — facts about the person (role, preferences, expertise level)
feedback — soft guidance for the assistant (prefer this style, lean toward that approach)
project — current-state context that isn't in the code (deadlines, in-flight work)
reference — pointers to external systems (Linear board URL, monitoring dashboard)
rule — constraints to enforce, not just facts to recall. Carries
severity,scope,matches,enforce_on,applies_when,last_verified. Projects to companion files; gatescheck_action.
Tags + wiki-links
Beyond types, two cross-cutting organization features:
Tags — optional tags: [a, b, c] array in frontmatter. Queryable via list_memories({tags: [...]}) and the agent-memory list --tags "a,b" CLI. Filter is intersection — memories must have all listed tags. Tag names are lowercase a-z + digits + hyphen/underscore, max 40 chars.
---
name: deploy-process
description: Blue-green prod deployment
type: project
tags: [deployment, production, critical]
---Wiki-links — write [[memory-name]] anywhere in a memory body and it becomes a link. find_backlinks returns memories that reference a given one; find_related ranks the full graph (outbound links, inbound backlinks, shared tags, content similarity) for discovery navigation.
CLI
The same binary is also a command-line tool. Useful in shell scripts, git hooks, cron, or just for quick lookups outside your editor.
agent-memory save user-likes-tabs --type user --description "Prefers tabs" --content "Always use tabs in new files."
agent-memory list
agent-memory list --type feedback
agent-memory search "tabs" # fuzzy, top 10 by relevance
agent-memory search "depoy" --limit 5 # typo-tolerant ("depoy" → "deploy")
agent-memory relevant "deployment" --max 3 # full memory bodies, LLM-ready
agent-memory get user-likes-tabs
agent-memory list --limit 20 --offset 40 # pagination
agent-memory delete user-likes-tabs # soft delete — moves to .trash/
agent-memory restore user-likes-tabs # restore the most recent trash entry
agent-memory doctor # check integrity
agent-memory doctor --rebuild-index # repair MEMORY.md from disk
agent-memory stats # dashboard: counts, sizes, audit/trash
agent-memory log # last 20 entries from the audit log
agent-memory log --tail 50 --action delete # filter by action, tail size
agent-memory verify deploy-process # extract URLs/dates/file refs + staleness heuristics
agent-memory save my-mem --type project --description "X" --content "Body" --tags "production,critical"
agent-memory list --tags "production" # filter by tag (intersection)
agent-memory backlinks deploy-process # memories that link to deploy-process
agent-memory related deploy-process # ranked discovery: links + tags + similarity
agent-memory sync init git@github.com:you/agent-memory.git # multi-machine setup (one-time)
agent-memory sync push # commit + push local changes
agent-memory sync pull # fast-forward from remote
agent-memory sync status # local + ahead/behind state
agent-memory ui # launch the TUI (browse + edit interactively)
# v0.11+ · rules and enforcement
agent-memory save-rule no-emoji --severity hard --enforce-on commits,chat_responses \
--matches "emoji|:[a-z_]+:" --content "No emojis. Anywhere. Ever."
agent-memory list-rules # rule memories only
agent-memory list-rules --severity hard # filter by severity
agent-memory emit-companions # write AGENTS.md + CLAUDE.md + .cursor/rules + .gemini
agent-memory emit-companions --target agents,claude # filter targets
agent-memory check-action "delete old notes" --type deletions # returns approval + receipt JSON
agent-memory audit # pretty operational health report
agent-memory audit --json # structured JSON for toolingMulti-machine memory (git sync)
The killer feature for file-based memory: every dev machine has git, and markdown merges cleanly. agent-memory sync turns .agent-memory/ into a git repo pointed at a (private) remote, and your memories follow you across desktop/laptop/server.
# One-time setup
agent-memory sync init git@github.com:you/agent-memory.git
# End of the day on desktop
agent-memory sync push
# Pick up your laptop before bed
agent-memory sync pull
# Save a new memory while reading in bed
agent-memory save bedtime-thought --type project --description "..." --content "..."
agent-memory sync push
# Next morning at desktop
agent-memory sync pull # picks up the bedtime memoryWhat's NOT synced (per-machine state, kept local):
.lock— per-process file lock.events.jsonl— per-machine audit trail.trash/— soft-delete staging
What IS synced: every memory file, the MEMORY.md index, and any .gitignore you add.
Commits use the identity agent-memory <agent-memory@local> by default — set GIT_AUTHOR_EMAIL / GIT_COMMITTER_EMAIL in your environment if you want per-machine attribution.
Audit log + structured logging
Every mutation appends one JSON line to .agent-memory/.events.jsonl:
{"ts":"2026-05-22T04:02:38.536Z","action":"save","name":"first-mem","type":"user","update":false,"bytes":6}
{"ts":"2026-05-22T04:02:39.414Z","action":"delete","name":"second-mem","trash":"1779422559413-second-mem.md"}
{"ts":"2026-05-22T04:02:39.712Z","action":"restore","name":"second-mem","binnedAt":"2026-05-22T04:02:39.413Z"}Read it any way you want: cat, jq, the log / log_events tool, or a sidecar that ships it to your observability stack.
Operational logging is separate. Set AGENT_MEMORY_LOG=debug|info|warn|error (default info) and structured lines stream to stderr — won't pollute the MCP stdio channel.
Color output is on by default in TTYs. Set NO_COLOR=1 to disable, FORCE_COLOR=1 to force-enable in pipes.
Multi-line content can come from a file or stdin:
agent-memory save my-handoff --type project --description "Q3 handoff notes" --content-file handoff.md
cat conversation.txt | agent-memory save extracted-prefs --type user --description "Pulled from chat" --stdinImporting from Claude Code
If you've been using Claude Code's built-in memory, bring it over:
# See what would be imported (dry run, no writes)
agent-memory import-claude-code --dry-run
# Filter to one project by substring match (case-insensitive)
agent-memory import-claude-code --project my-app --dry-run
# Do the import
agent-memory import-claude-code --project my-app
# Replace existing memories with the same names
agent-memory import-claude-code --project my-app --overwriteThe importer walks ~/.claude/projects/*/memory/, parses each memory's YAML frontmatter (tolerantly — malformed files don't kill the run), flattens Claude Code's metadata.type field to top-level type, and writes to your current store. Existing memories with the same name are skipped unless you pass --overwrite.
Why files, not a database
You give up native semantic similarity search and structured entity-relation queries. You get a memory store that survives every tool change, every machine swap, every "wait, what was that AI telling me about this codebase six months ago?" — and that you can still read after a power outage.
The trade is real. For workflows that need vector recall or graph queries, a database-backed memory is the right tool. For workflows where memory is something you want to grep, edit, version-control, and audit by hand, this is.
Operator-grade by design
This server is built to be used daily, not to demo well once.
Shipped in v0.3:
Atomic writes — tmp-file + rename pattern. Power-loss never leaves a half-written file.
File locking —
proper-lockfilearound every mutation. Concurrent MCP server + CLI access can't corrupt the index.Soft delete —
delete_memorymoves to.trash/<timestamp>-<name>.md.restore_memorybrings it back.Index recovery —
agent-memory doctorreports orphan files, dangling entries, and parse errors.--rebuild-indexrewritesMEMORY.mdfrom disk.Schema versioning — every memory file gets a
schema: 1field so future format changes can migrate cleanly.Spec-compliant Resources —
agent-memory://index+agent-memory://memory/{name}; clients can pin them as always-visible context.
Shipped in v0.4:
Append-only event log at
.events.jsonl— every mutation timestamped + JSON-structured for audit.agent-memory stats— dashboard of counts per type, total/avg/largest size, audit + trash counts.agent-memory log— paginated browser of the event log, filterable by action.Structured stderr logging —
AGENT_MEMORY_LOG=debug|info|warn|error; safe to use alongside MCP stdio.Color output — auto-detected via TTY, respects
NO_COLOR/FORCE_COLOR.
Shipped in v0.5:
Fuse.js fuzzy search with field weights (name×3, description×2, body×1). Typo, partial, and word-order tolerant.
Snippet highlighting — body-context excerpts shown under each match with
...markers.Relevance scoring — Fuse score inverted + scaled to 0-100 for human readability.
relevant_memories(query, max=5)— sister tool to search that returns FULL memory bodies as a single markdown doc, built for LLM auto-context loading.Pagination —
offset+limitonlist_memoriesandlimitonsearch_memories.
Shipped in v0.6:
Vitest test suite — 25+ blackbox tests covering CLI + MCP server paths.
GitHub Actions CI — runs tests on every push/PR across Node 20/22/24.
COMPATIBILITY.md — known-working client matrix + quirks.
Shipped in v0.7 · the active context layer:
MCP Prompts capability — 4 built-in workflows (
extract_memories,summarize_topic,prepare_handoff,audit_stale) that the client surfaces as slash-commands.verify_memorytool — static analysis of a memory's URLs/dates/file refs with type-specific staleness heuristics. Plus the matchingagent-memory verify <name>CLI.Conflict detection on save — fuzzy-matches new memories against existing ones; warns on near-duplicates without blocking the save (so the LLM can decide whether to merge, rename, or proceed).
Shipped in v0.8 · organization at scale:
Tags — optional
tags: [...]array in frontmatter. Queryable vialist_memoriesandagent-memory list --tags "a,b". Intersection filter.[[wiki-links]]— write[[memory-name]]in any memory body, auto-detected.find_backlinkstool +agent-memory backlinks <name>CLI — "what links to this".find_relatedtool +agent-memory related <name>CLI — combines outbound + inbound links, shared tags, type match, and content similarity into a ranked discovery view.
Shipped in v0.9 · the moat — multi-machine memory via git:
agent-memory sync init <remote-url>— convert.agent-memory/into a git repo, push to remote.agent-memory sync push— auto-commit local changes + push.agent-memory sync pull— fast-forward from remote.agent-memory sync status— local state + commits ahead/behind origin.agent-memory sync log— history of cross-machine memory changes.sync_status/sync_push/sync_pullMCP tools — the LLM can do this too.Per-machine state (
.lock,.events.jsonl,.trash/) auto-excluded from sync.Default commit identity injected (
agent-memory@local) so machines withoutgit config --global user.emailwork without setup.
Shipped in v0.10 · the visual identity (TUI):
agent-memory ui— Ink-based terminal UI for browsing, filtering, searching, and editing memories without leaving the terminal.Type-filter quick-keys (0-4 cycle through all/user/feedback/project/reference)
Fuzzy live search with
/eopens the highlighted memory in$EDITOR(vim/notepad/nano/whatever) — saves back to diskdsoft-deletes withy/nconfirmationDetail pane previews the body of the selected memory
Color-coded by type, tag chips inline
Shipped in v0.11 · memory as constraint:
rulememory type withseverity/scope/matches/enforce_on/applies_when/last_verifiedsave_rule+list_rulestools and CLI commandsemit_companionsprojects rules toAGENTS.md+CLAUDE.md+.cursor/rules/*.mdc+.gemini/instructions.mdAGENT_MEMORY_AUTO_EMIT_DIRtriggers re-emission on every rule saveCompliance Receipts (
issueReceipt/validateReceipt) — HMAC-SHA256 bearer tokens with Macaroon-style caveats, bound torules_versionso rule changes invalidate outstanding tokenscheck_actionMCP tool (Tier 1 deterministic; Tier 2 Sampling-enriched on v0.11.7 for clients that advertise the capability)auditcommand — stale rules, pattern conflicts, recent denials, unreceipted destructive opsCRP 1.0 protocol spec — portable, vendor-neutral
Shipped in v0.12 · the wedge made teeth (breaking change):
delete_memoryREQUIRES a valid receipt. Calling without one is refused at the tool boundary.Two-step pattern is canonical:
check_action→ receipt →delete_memory(name, receipt)Audit log no longer needs an "unreceipted ops" warning class to surface escapes — there are none
Shipped in v0.13 · cross-server federation:
CRP 1.1 · Ed25519 asymmetric signing (set
CRP_SIGNING_MODE=ed25519)Public key published at
<MEMORY_DIR>/.keyring/ed25519-pubso other servers can validate without sharing a secret9 dedicated Ed25519 tests verifying keypair generation, signing, and cross-server validation paths
Roadmap
Released
Version | Highlights |
v0.1 | Five-tool MVP, file storage, four-client config snippets |
v0.2 | MCP Resources, Claude Code import ( |
v0.3 | Atomic writes, file locking, soft delete + |
v0.4 | Append-only event log ( |
v0.5 | Fuzzy search via Fuse.js, relevance scoring, body-context snippets, |
v0.6 | 25+ Vitest tests, GitHub Actions CI (Node 20/22/24 matrix), |
v0.7 | MCP Prompts (4 starter workflows), |
v0.8 | Tags, |
v0.8.1 | Trusted Publishing live · tokenless OIDC publishes to npm + MCP Registry on git tag |
v0.9 |
|
v0.10 | Ink-based TUI · |
v0.11.0 |
|
v0.11.1 |
|
v0.11.2 | Compliance Receipts primitive · HMAC-SHA256 tokens with Macaroon-style caveats |
v0.11.3 |
|
v0.11.4 |
|
v0.11.5 | CRP 1.0 protocol spec — portable, vendor-neutral enforcement primitive |
v0.11.6 | Repositioning · "codify how you work, every AI tool obeys" |
v0.11.7 | Tier-2 Sampling-enriched |
v0.12 | Receipt REQUIRED on |
v0.13 | CRP 1.1 · Ed25519 asymmetric signing for cross-server federation |
Coming next
Receipt-gated
restore_memoryanddoctor --rebuild-index(samecheck_actionflow)Federation example · a second reference MCP server that issues + validates CRP 1.1 receipts
Auto-context loading — server hook that auto-fires
relevant_memoriesbefore each LLM turnFolder support inside the store (
.agent-memory/work/,.agent-memory/personal/)Memory packs — export/import shareable
.tar.gzbundles of curated memoriesBrowser companion UI (
agent-memory web)TUI polish — file-watching for auto-refresh, inline editing, sync as keybindings
Beyond
Optional local-embeddings sidecar (transformers.js, no API), team mode with diff/merge, browser extension to capture from chatgpt.com / claude.ai → memory, mobile companion.
Open an issue if you want one of these before I get to it.
License
MIT. Use it for whatever.
Author
@xultrax-web · built for the cross-client memory problem I kept running into. Part of Peach & Madison Design.
Inspired by the file-based memory system in Anthropic's Claude Code.
Available Tools
24 toolsauditA
v0.11.4 · operational health report for the rule store. Surfaces: rule count by severity, stale rules (last_verified > 90 days or null), pattern conflicts (two rules sharing an enforce_on category AND an identical regex pattern), recent check_action denials, and recent unreceipted destructive ops. Default returns pretty-printed text; pass {format: 'json'} for structured output. Run daily-ish · the report is fast and gives the operator a single view of what's drifting.
Inputs: format.
check_actionA
v0.11.3 · the protocol enforcement point. Pass a proposed action description + its category; the server matches against rule memories (type=rule) and either:
APPROVES: returns a short-lived Compliance Receipt (HMAC-signed, 60s default) the agent can pass to destructive tools (e.g. delete_memory) as proof of compliance.
DENIES: returns structured hard_violations (severity:hard rules that block) and/or soft_warnings (severity:soft rules that warn but allow).
Tier 1 (deterministic) matches the action against rule.matches regexes + rule.enforce_on category filter. Works on every MCP client. Tier 2 (v0.11.7+) calls back to the client via MCP sampling/createMessage to judge rule.applies_when natural-language conditions. Auto-enabled on clients that declared the sampling capability; silently skipped on clients that didn't.
Inputs: action (required), action_type (required), session_id, use_sampling.
delete_memoryA
Move a memory to .trash/ (soft delete). The file is removed from the index but recoverable via restore_memory until you manually empty .trash/. Receipt REQUIRED and bound to THIS memory: first call check_action({action: 'delete memory ', action_type: 'deletions'}) — using that EXACT action string — to obtain a fresh Compliance Receipt, then pass it as receipt. The receipt must carry {action_type: 'deletions'} AND the matching action_hash for 'delete memory ', and is single-use — it cannot be replayed to delete a different memory or the same one twice.
Inputs: name (required), receipt (required).
doctorA
Check storage integrity. Reports orphan files (on disk but not indexed), dangling index entries (no file), unreadable files, and invalid types. Pass rebuild-index=true to reconstruct MEMORY.md from disk.
Inputs: rebuild-index.
emit_companionsA
Regenerate companion rule files from the current rule memories. Writes one or more of: AGENTS.md (universal cross-tool standard, Linux Foundation), CLAUDE.md (Claude Code's 5-level hierarchy), .cursor/rules/*.mdc (Cursor's MDC format · hard rules get alwaysApply:true, soft rules become description-driven), .gemini/instructions.md (Gemini CLI). Default writes ALL four targets. Use targets to filter. Output dir resolves from out_dir, then AGENT_MEMORY_COMPANION_DIR env, then process.cwd().
Inputs: out_dir, targets.
find_backlinksA
List memories that link to the given memory via [[wiki-link]] syntax in their bodies. Useful for building a 'what references this' view.
Inputs: name (required).
get_memoryA
Fetch a single memory by name.
Inputs: name (required).
initA
Install a starter guardrail pack — sensible hard/soft rules (protect main, block rm -rf, no prod data destruction, no curl|sh, flag secrets) — and emit them to every tool's companion files. Zero-config protection on day one. Pass force=true to overwrite same-named rules. Pair with agent-memory install-hooks so hard rules actually block tool calls.
Inputs: force.
list_memoriesB
List stored memories, optionally filtered by type and/or tags. Paginated.
Inputs: tags, type, limit, offset.
list_rulesA
List every active rule memory with severity, scope, and staleness markers (>90 days since last_verified). Use this to audit which rules are currently constraining the agent.
Inputs: no named parameters.
log_eventsB
Read recent entries from the audit event log (.events.jsonl). Returns the last N events, optionally filtered by action.
Inputs: tail, action.
relevant_memoriesA
Find memories relevant to a query and return their FULL content (not summaries). Designed for LLM ingestion — call this when the assistant needs context on a topic and the memory index alone isn't specific enough. Returns up to max memories as a markdown document.
Inputs: query (required), max.
restore_memoryA
Restore a memory from .trash/ back into the active store. Picks the most recent trash entry for the name.
Inputs: name (required).
rotate_keyA
Rotate the receipt-signing key material (HMAC and/or Ed25519). Generates fresh keys and INVALIDATES every outstanding Compliance Receipt. Use after a suspected key leak — e.g. the .keyring was ever committed or synced. Optional mode: 'hmac' | 'ed25519' | 'both' (default 'both').
Inputs: mode.
save_memoryB
Save (or update) a memory. Memories are markdown files with YAML frontmatter, stored at the resolved memory dir. Use a short kebab-case name; the description is what's shown in the index and used for search ranking.
Inputs: name (required), type (required), content (required), description (required), +1 more.
save_ruleA
Save (or update) a rule memory · the 'memory as constraint' wedge. Rules constrain agent behavior, not just store facts. Severity 'hard' = must obey; 'soft' = prefer to obey. Rules auto-project out to AGENTS.md (read by Claude Code, Codex CLI, Cursor, Aider, Devin, Copilot, Gemini CLI, Windsurf, and Amazon Q natively) when AGENT_MEMORY_AUTO_EMIT_DIR is set, or via the emit_companions tool on demand.
Inputs: name (required), content (required), description (required), scope, +5 more.
search_memoriesA
Fuzzy search across name, description, and body. Tolerates typos, word-order shifts, and partial matches. Returns top matches with relevance scores (0-100) and body-context snippets. Use this for human-readable browsing.
Inputs: query (required), limit.
statsA
Dashboard of memory-store state: counts per type, total size, largest memory, audit-log size, trash count.
Inputs: no named parameters.
sync_pullA
Pull memory updates from the configured git remote (fast-forward only). Run at the start of a session to get memories saved on other machines. Refuses to pull if there are uncommitted local changes.
Inputs: no named parameters.
sync_pushA
Commit any local memory changes and push to the configured git remote. Auto-generates a timestamped commit message if none provided. Use at the end of a session to make memories available on your other machines.
Inputs: message.
sync_statusA
Report the git-sync state of the memory store: remote URL, branch, local uncommitted files, commits ahead/behind origin. Use this before opening a new session to know if you have stale memories from another machine.
Inputs: no named parameters.
validate_receiptA
Validate a CRP 1.1 (Ed25519) Compliance Receipt issued by ANOTHER agent-memory server using that server's published public key — no shared secret (the federation primitive). Checks signature, expiry, and required caveats. Pass receipt (object or JSON string) and public_key (inline PEM or a file path; the issuer gets theirs via agent-memory export-pubkey).
Inputs: receipt (required), public_key (required), required_caveats.
verify_memoryA
Re-evaluate a memory's claims against signals in its content. Extracts URLs, dates, and file paths from the body; flags stale-date signals on project-type memories; returns type-specific verification heuristics for the LLM or operator to act on. Pairs with the audit_stale prompt.
Inputs: name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Every tool has a clearly distinct purpose. Even similar tools like search_memories vs relevant_memories are differentiated by output detail. Audit and doctor target different aspects (rule health vs storage integrity). No ambiguity.
Most tools follow verb_noun snake_case (save_rule, list_memories). A few are single-word verbs (audit, doctor, stats, init). This is a minor deviation but still predictable and readable.
24 tools is well-scoped for a memory server covering CRUD, rule enforcement, sync, health checks, and federation. Each tool earns its place; no unnecessary redundancy.
Core CRUD for memories and rules is covered, plus sync, health, and federation. A notable gap is the lack of a delete_rule tool; save_rule can update but not delete. Otherwise comprehensive.
Maintenance
Related MCP Connectors
Deterministic runtime safety for AI agents: scan PII, gate tool actions, verify LLM output.
Governed behavior for AI applications and coding agents: define, evaluate, release and inspect.
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Pre-execution governance for AI agents. Deterministic PASS/FAIL/REVIEW verdicts, replayable proof.
Related MCP Servers
- AlicenseAqualityDmaintenanceCompliance and guardrails infrastructure for AI agents, enabling safe operations within regulatory boundaries like GDPR and EU AI Act.661 PyPIMIT
- FlicenseNot gradedqualityBmaintenanceGuardrails service for AI agents that evaluates every tool call for safety and alignment before execution, providing default-deny policy, LLM safety evaluation, and audit trail.148 PyPI23-

infraveil-guardofficial
AlicenseAqualityCmaintenanceA cooperative guardrail for AI agents that blocks destructive shell commands, SQL statements, or cloud operations until a human approves them out-of-band, with a tamper-evident local ledger.4AGPL 3.0
agentguardofficial
AlicenseNot gradedqualityAmaintenanceEnforces policy controls for AI agents, including spend limits, action approvals, kill switch, scoped credentials, dry-run diffs, loop prevention, and auditable hash-chained logs.MIT