AgentMemory Context Payload - alexherrero/agentm GitHub Wiki
The context payload is the brief you paste into a chat surface so it reads your vault before it answers from its own knowledge. It has one source in this repo, templates/agentmemory-context.md, and everything else is derived from that file.
The payload is layout-free. It names no folder that a migration moves. It names three things that do not move — index.md, standards/ and moc-projects.md — and lets the map explain itself. A surface that goes looking for a folder that no longer exists finds nothing, says nothing, and answers from its own knowledge instead, which is the failure this text exists to prevent.
| Question | Answer |
|---|---|
| Where is the source? |
templates/agentmemory-context.md. |
| What do I paste? | Whatever /memory payload prints. The leading HTML comment in the file is yours, not the surface's, and the renderer strips it. |
| Which surfaces need a paste? | claude.ai and the Gem. Antigravity's copies are derived; Claude Code needs nothing. |
| Where do the copies come from? | One renderer, scripts/payload_render.py, feeds all three outputs. |
| How do I know a copy is current? |
check-payload-parity in the battery, and the doctor's payload-copy rows. |
| When do I paste again? | Only when the posture, the card guide or the surface list changes. A layout change never triggers one. |
Five parts, in order.
| Part | Covers |
|---|---|
| Where it is, on your surface | Local agents read the configured path through memory_search; claude.ai, Claude Desktop and Gemini read the Drive folder named Vault. |
| Read in this order |
index.md first — it is the map and it is current. Then everything in standards/. For a project question, moc-projects.md, then that project's tracker.md and charter.md. Then search, before falling back on general knowledge. If the vault says something, it wins. |
| How to read a note | The frontmatter field order, and what status: unfiled, lifecycle: dormant, superseded, completed/ and agent/archive/ each mean. |
| Your posture | Chat surfaces read; they never write. Local agents you run may write through the capture tool. |
| The sync caveat | Drive shows the last-synced state. Say so rather than guess. |
| Copy | Rendered | Kept current by |
|---|---|---|
adapters/antigravity/rules/agentmemory-context.md |
without a capture address — the repo copy never carries your mailbox |
/memory payload --write, and check-payload-parity in the battery |
the AGENTMEMORY section of ~/.gemini/GEMINI.md
|
with the address when one is configured |
install.sh on every run, and /memory payload --write
|
what /memory payload prints |
with the address when one is configured | it is the render itself |
Everything outside the AGENTMEMORY markers in GEMINI.md is preserved, so your own global rules survive a rewrite.
All three were kept by hand until 2026-09-07, and all three had drifted: the rule and the template had become different documents, and Gemini's copy was still teaching a July folder map. Never edit a copy. Edit the template and run /memory payload --write.
Chat surfaces read everywhere and write in exactly one place: agent/inbox/ in Drive. The payload asks a surface to keep a durable thing as a card, one card per file, drop it in that folder and say what it wrote. Nothing there is filed until you read it and decide where it goes. A surface that cannot reach the folder says so and shows you the card instead; the Gem is one, since a Gem cannot create a file in Drive. (The email door this page once described was retired with the inbox, agentm-vault plan 16.)
- In a fresh chat on each surface, with no priming: what's our commit-message convention? It passes when the answer states the vault's convention. A path is not required: the payload never asks a surface to name the file it read, and the content is the proof. The Gem can reach only the files attached to it, which are the standards, so it is tested on questions those files answer; the convention note sits under
agent/memory/semantic/, outside its reach, and that is a limit of the surface, not of the paste (ruled 2026-10-02). -
Where does agentm stand? It passes when the answer comes from
moc-projects.mdor a tracker's State. It could only pass once the projects migration wrote the trackers, which landed in v10.0.0. -
Where does a new capture go? It passes when the answer names a memory class and
status: unfiled, and never_inbox/,_always-load/,_index.mdor_harness/. - From any session: a Drive title search for
storage-rules.md,user-preferences.mdandindex.mdreturns exactly one file each, and the doctor reports the Gemini managed section equal to the template. (Before the memory-root trims folded it in, this checkedvoice-kernel.md; a migrated vault holds the voice content insideuser-preferences.mdinstead.)
Check 4 has two halves. The Drive half passes once only one copy of the vault is in the Drive the connector searches. The doctor half is machinery_doctor.py's payload-copy: gemini managed section row.
- Use AgentMemory in any agent — the setup recipe, surface by surface.
-
CI gates —
check-payload-layout-freeandcheck-payload-parity. - Memory daemon (agentmd) — the surface local agents search through.