x-mnemom-conversation-id header, and the agent does not need
to be launched with mnemom agent.
Availability follows the gateway cell rollout. The fold for agents that send no
conversation header is controlled by a cell setting that is off until the cell
turns it on. Check with your Mnemom contact, or watch the changelog,
for when it reaches your cell.
How the gateway identifies the conversation
The fold needs to know which requests belong to one conversation. The gateway uses only signals that are already in the request, in this order:- The header. If the request carries
x-mnemom-conversation-id, that id is used, as before. - The session id of the client. Claude Code and the Agent SDK send a session id, either in the
x-claude-code-session-idheader or insidemetadata.user_idof the request body. The gateway uses it as the conversation.
X-Mnemom-Lineage-Source header carries
the source name (header, sdk_session and so on), never the value itself, and is absent when no
conversation was identified. See Response Headers.
Compaction and auxiliary requests are never folded this way. These are the requests Claude Code
marks with x-claude-code-request-class, compaction prompts and side queries. The fold does not
rewrite the history a /compact summary is written from.
On by default, with an owner opt-out
Once the rollout reaches your cell, the fold is on by default for every governed agent. The agent owner can turn it off for that agent withcontext_fold on the agent’s
alignment card:
The opt-out wins over the cell setting. It is a card field, so it composes across scopes: if the
platform, an organization, a team or the agent sets
enabled: false, the composed card is
enabled: false. An org or team template can switch the fold off for every agent under it, and an
agent’s own enabled: true cannot turn it back on. See
Card Composition.
The opt-out also applies when the client sends x-mnemom-conversation-id: an opted-out agent’s
requests are not folded with or without the header. The header still identifies the conversation for
the features that use it, such as implicit goal mode. A fold choice made in the session configuration (x-mnemom-session-config, or
--context-profile and --no-context from mnemom agent) can turn the fold off for a session, and a
session that turns it off does no conversation-identification work. It cannot turn the fold back on
for an agent whose owner opted out. Until the rollout reaches your cell, the gateway does not read the
opt-out, and a request with the header folds as before. See
Context folding for the profiles.
If the gateway cannot read the card when it checks the opt-out, it treats the agent as opted out for
that request, so the request is forwarded unfolded. The gateway caches the opt-out result for 60 seconds
per agent.
What changes for the agent
- Older turns are replaced, in the request the gateway sends to the model, by a digest the gateway writes. The system prompt and tools are not folded, and the latest messages stay word for word. What a fold keeps is described under What folding keeps.
- Your client keeps its full transcript. The fold changes what the gateway forwards to the model, not what your client holds or shows you.
- Tool results and earlier work can drop out of the digest, so restate anything the agent needs that is not in recent turns.
Limits
- Anthropic route only. The fold applies to
/v1/messageson the Anthropic route. OpenAI and Gemini requests are not folded. - Fold only. Identifying a conversation without a header does not turn on the other
conversation-level features. Implicit goal mode and sealed contracts still need the conversation
header or a
mnemom agentsession. See Implicit goal mode. - Large requests. A request body over 32 MiB, or a transcript over 10,000 messages, is forwarded unchanged.
The response says so in
x-mnemom-context:skipped=body_too_large;bytes=<n>, orskipped=too_many_items;bytes=<n>;items=<n>. - Billing. The model calls the fold makes are billed as
gateway.context.foldwhen fold billing is enabled. See Pricing.