Skip to main content

Documentation 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.

The Engram MCP server exposes a single resource at the URI memory://recall. Unlike the recall tool — which an agent calls explicitly during a session — this resource is designed for automatic context injection: MCP clients that support resource auto-loading fetch it once at session start and attach the rendered block to the system prompt or context window before any tool calls happen.

Resource details

PropertyValue
URImemory://recall
Transportstdio (same process as the MCP server)
MIME typetext/plain
ContentDelimited plain-text block of promoted memories
RefreshFetched fresh on each session start; not streamed or cached by the server

Rendered block format

The resource returns a compact plain-text block wrapped in HTML-style delimiter comments. The delimiters are stable and machine-readable, making it easy for post-processors or context managers to locate and update the block.
<!-- engram:begin -->
[preference] I prefer pnpm over npm
[tooling] Node projects use Volta for version pinning
[project] The main monorepo lives at ~/code/acme
[infra] Production Postgres runs on port 5433
[constraint] Never commit secrets to the repo — use 1Password references
<!-- engram:end -->
Each line inside the delimiters follows the pattern [<kind>] <fact>. Only memories with status: promoted are included; pending, rejected, and stale memories are silently omitted. The ordering mirrors the default recall ranking: most relevant and most recent memories appear first.
The block intentionally omits IDs, confidence scores, and dates. This keeps it as compact as possible for injection into a context window. Use the recall tool if the agent needs the full metadata for a specific memory.

How clients auto-load the resource

MCP clients that implement resource subscriptions or startup resource fetching will request memory://recall automatically. The Engram server handles this with a dedicated resource handler:
@mcp.resource("memory://recall")
def memory_recall() -> str:
    """Compact memory context for the current user, for clients to auto-load."""
    return render_block(_store().list())
The render_block function filters to promoted memories and formats each one as [kind] fact, then wraps the block in the <!-- engram:begin --> / <!-- engram:end --> delimiters.

Client behaviour by harness

ClientAuto-load behaviour
Claude CodeAttaches resource content to system context when listed in .mcp.json
CodexAttaches resource content to system context when listed in ~/.codex/config.toml
opencodeAttaches resource content to system context when listed in opencode.json
Generic MCP clientDepends on client implementation; resource is always available for explicit fetch
If your client does not auto-load MCP resources, you can instruct the agent to call the recall tool at the start of each session as a manual alternative. The tool returns the same underlying data in structured JSON rather than the rendered text block.

Full example output

Below is a representative block for a user with a variety of promoted memories across multiple kinds:
<!-- engram:begin -->
[preference] I prefer dark mode in all editors and terminals
[preference] I like verbose commit messages with a body paragraph
[tooling] I prefer pnpm over npm
[tooling] Node projects use Volta for version pinning
[tooling] Python projects use uv for dependency management
[project] The main monorepo lives at ~/code/acme
[project] The public API is deployed at api.acme.dev
[infra] Production Postgres runs on port 5433
[infra] Redis sentinel cluster — never connect to replicas directly
[constraint] Never commit secrets to the repo — use 1Password references
<!-- engram:end -->
Sensitive kinds (identity, fiscal, health, people, location) are included in the block once promoted. If you promote a sensitive memory and later want to remove it from agent context, use engram forget <id> from the CLI to retract it immediately.

Relationship to context files

For agents that do not support MCP resources, Engram can generate equivalent static context files (AGENTS.md, CLAUDE.md) with the same rendered block embedded. These files are updated by engram sync and serve as a fallback for clients that read project-level context files instead of querying MCP at runtime. See the Context Files guide for details.

Build docs developers (and LLMs) love