Not every agent speaks MCP. Some agents and IDE extensions consume context through files in your repository — a pattern popularised byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xantorres/engram/llms.txt
Use this file to discover all available pages before exploring further.
AGENTS.md and CLAUDE.md. Engram’s gen-context command bridges these two worlds: it renders your promoted memories into a clearly delimited markdown block and can upsert that block directly into any file you choose.
What engram gen-context produces
Running engram gen-context without arguments prints a formatted memory block to stdout. The block is wrapped in HTML-comment delimiters that Engram uses to locate and update the section on subsequent runs without touching the rest of the file.
promoted memories appear — pending, rejected, and stale memories are excluded.
Block delimiter format
The delimiters<!-- engram:begin --> and <!-- engram:end --> mark the managed section of any file Engram writes to. Everything between them is owned by Engram and will be replaced on the next --write run. Everything outside them is left untouched.
This means you can freely edit the rest of AGENTS.md — your own instructions, project notes, team conventions — and Engram will only ever update its own block.
If no block is found in the target file, Engram appends the block at the end of the file. If a block already exists, Engram replaces it in place, preserving its position within the file.
Writing into a file with --write
Pass --write <filename> to upsert the block directly into a file. If the file does not exist, Engram creates it.
Limiting the number of memories with --limit
By default gen-context includes up to 30 promoted memories. Use --limit to control the number rendered into the block.
How recall ranking works
The memories included in the block are selected using the same recall ranking logic that powers the MCP resource:- Only
promotedmemories are candidates. - Without a query: memories are sorted by confidence score, descending.
- With a query (future feature): keyword overlap scoring re-ranks results to surface the most relevant memories for a specific topic.
--limit cut — are those Engram is most confident about.
Multi-file example
You can maintain context files for multiple agents from the same memory store by runninggen-context with different target files.
Context files vs. the MCP resource
Both mechanisms surface the same promoted memories, but they work differently.Context file (--write) | MCP resource (memory://recall) | |
|---|---|---|
| Agent requirement | Any agent that reads markdown files | MCP-capable agent with Engram wired |
| Update trigger | Manual (engram gen-context --write) | Automatic — fetched at session start |
| Scope | Snapshot at time of last write | Always live, always current |
| Best for | Non-MCP agents, shared team files, CI contexts | Claude Code, Codex, opencode with live wiring |
Next steps
- Wiring Agents — set up the MCP resource for live memory access.
- Reviewing Memories — approve candidates so they appear in generated context.
- Harvesting Sessions — populate your memory store from existing transcripts.