Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/lyellr88/marm-memory/agents-mdgit clone --depth 1 https://github.com/Lyellr88/marm-memoryWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02165 | $0.02165 |
| Opus 5 | $0.01082 | $0.01082 |
| Sonnet 5 | $0.00433 | $0.00433 |
| Haiku 4.5 | $0.00216 | $0.00216 |
Grade A, and why
marm-memory AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.
marm-memory - Agent Instructions
Instructions for AI coding agents working on this repo. Keep changes surgical: touch only what the task requires, match existing style, preserve behavior in refactors.
Architecture
MARM is a local-first MCP memory server: Python FastAPI in marm-mcp-server/, package marm_mcp_server/.
- 14 public MCP tools: 7 core memory, 5 code graph, 2 concept graph. HTTP and STDIO must stay in exact parity.
- HTTP transport:
marm_mcp_server/server.py; tools are whitelisted inMCP_TOOL_OPERATIONS. A tool not in that list does not exist over HTTP. - STDIO transport:
marm_mcp_server/server_stdio.pyowns theFastMCPapp and seven core@mcp.tool()wrappers. Graph/concept bodies live inservices/stdio_graph_tools.pyand are explicitly registered after the core tools sotools/listorder stays stable. Never fork behavior between transports. - Endpoint logic lives in
marm_mcp_server/endpoints/split by surface (memory, logging, notebook, session, compaction, graph, concepts, system). Shared helpers stay incore/. - Storage: SQLite WAL at
~/.marm/marm_memory.db(connection pool, FTS5 external-content indexmemories_fts,memory_chunksfor long-memory chunking). The concept graph uses its own database~/.marm/index/marm_index.dbwith its own pool. Never share connections between the two. - Write path: all memory writes go through the serialized async write queue (one worker). Do not add write paths that bypass it.
marm_log_entrydual-writes: alog_entriesrow plus a semantic memory inmemories(via the queue); a semantic-store failure must never fail the log write. - Code graph: a pinned external binary (codebase-memory-mcp) supervised as a child process over newline-delimited JSON-RPC (
core/graph_supervisor.py,core/graph_client.py). It starts lazily and runs degraded on failure. Graph or concept failures must never break the 7 core memory tools. - Both graphs index themselves, on by default, one background worker each on both transports. Concept extraction is queue-driven: a write enqueues a durable outbox row in the same transaction as the memory (
core/concept_worker.py). Code indexing is poll-driven: a git signature per indexed repo, re-indexing on a commit and every cycle while the tree is dirty (core/graph_index_worker.py). Neither may be made to block a write, a recall, or startup. - Cross-process serialization is a leased DB row, never an asyncio lock.
core/lease_lock.pyowns the mechanics;concept_build_lockandgraph_index_lockare its two bindings, deliberately separate rows. HTTP and STDIO are separate processes, so an in-process lock protects nothing. Every code-index call ANDdelete_projecttake the graph gate. Release is driven by the engine call's completion, not the awaiting task:asyncio.to_threadcancellation cancels the await and leaves the thread writing. - Runtime switches live in the DB, not just the environment (
core/runtime_flags.py). A saved override beats the env var so a Dockerfile cannot silently re-enable what a user turned off, and both workers re-read per cycle so no restart is needed. Any new background worker follows this: read the flag every cycle, and start the loop even when off so it can be turned on from another process. - Graph-aware recall:
marm_smart_recallkeeps primary memory ranking authoritative and may add boundedgraph_contextfrom the isolated concept database. Graph enrichment is read-only and fail-open; trim graph details before primary results when enforcing response limits. - Embeddings: one fastembed
jinaai/jina-embeddings-v2-small-enencoder (512 dimensions), lazy-loaded and serialized behind a lock. Writes must succeed even when the encoder is unavailable. Existing data requiresmarm-mcp-server --migrate-embeddingsbefore restart when upgrading from MiniLM.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 87 lines · 2,165 tokens per session scan A dc8f2a7b2b53
marm-memory AGENTS.md is an instructions file published in the GitHub repository Lyellr88/marm-memory (339 stars, last pushed 4d ago), licensed Apache-2.0. It adds 2,165 tokens to every session, about $0.0108 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
sigil CLAUDE.md
Instructions for Anmol-Srv/sigil, covering sigil and design system.
plur CLAUDE.md
Instructions for plur-ai/plur, covering claude.md, what is plur, development, package dependency and version bumps.
dense-mem AGENTS.md
Instructions for markhuangai/dense-mem, covering dense-mem repository guidance, project context, architecture decision records, current stack and target architecture.
wife AGENTS.md
Instructions for ma-nucho-pro/wife, covering if the user wants to install it, if the user wants to change something and rules that are not negotiable.
rembric CLAUDE.md
Instructions for susomejias/rembric, covering claude.md, quick reference, claims need evidence, architecture and data access pattern.
dakera-cli CLAUDE.md
Instructions for Dakera-AI/dakera-cli, covering dakera-cli, key commands, architecture and conventions.