Skip to main content
POST
Assemble Context
This endpoint requires an x402 payment header.
Price: $0.01 USDC Automatically assemble relevant memories into a context block ready for LLM prompts. This is useful for building AI assistants that need contextual memory.

Request Body

string
Natural language query describing what context is needed. Used to find relevant memories.
string
Filter by namespace.
string
Filter by session ID.
string
Filter by agent ID.
number
Maximum number of memories to include. Default: 10. Max: 100.
number
Target maximum tokens for the context. Default: 4000. Range: 100-16000.
string
Output format: text (plain text) or structured (JSON with metadata). Default: text.
boolean
Include memory metadata (tags, importance, type) in the output. Default: false.
boolean
Use LLM to summarize multiple similar memories into fewer entries. Default: false.

Response (200 OK)

string
The assembled context text or JSON.
number
Number of memories included in the context.
number
Approximate token count of the context.

Example

Response
Response (structured format)