Assemble Context
API Reference
Assemble Context
POST /v1/context — Assemble a context block from memories for LLM prompts.
POST
Assemble Context
This endpoint requires an x402 payment header.
Request Body
Natural language query describing what context is needed. Used to find relevant memories.
Filter by namespace.
Filter by session ID.
Filter by agent ID.
Maximum number of memories to include. Default:
10. Max: 100.Target maximum tokens for the context. Default:
4000. Range: 100-16000.Output format:
text (plain text) or structured (JSON with metadata). Default: text.Include memory metadata (tags, importance, type) in the output. Default:
false.Use LLM to summarize multiple similar memories into fewer entries. Default:
false.Response (200 OK)
The assembled context text or JSON.
Number of memories included in the context.
Approximate token count of the context.
Example
Response
Response (structured format)