Appearance
POST /v1/memory/context/assemble
POST /v1/memory/context/assemble
Builds layered execution context by combining recall, rules evaluation, and optional tool selection.
Request schema
Required:
query_text
Common fields:
tenant_id?: stringscope?: stringquery_text: stringcontext?: object(runtime execution context)include_rules?: boolean(defaulttrue)tool_candidates?: string[]return_layered_context?: boolean(defaulttrue)context_layers?: object
Example request
bash
curl -sS "$BASE_URL/v1/memory/context/assemble" \
-H 'content-type: application/json' \
-d '{
"tenant_id":"default",
"scope":"support",
"query_text":"refund policy for enterprise",
"context":{"intent":"billing_support"},
"include_rules":true,
"tool_candidates":["ticket_router","email_sender"],
"return_layered_context":true
}' | jqResponse schema
Key response fields:
tenant_idscopequery(text,embedding_provider)recall(includestrajectoryandobservability)rules(optional)tools(optional)layered_context(optional)
Idempotency
- Functionally idempotent for the same input and data snapshot.
- Output can change when memory, rule state, or tool policies change.
Rate limit
- Uses recall-class limiter and recall tenant quota.
- Uses embedding quota for text-to-embedding phase.
- If
return_debug+include_embeddingsis used, debug embedding controls also apply.
Error codes
Common errors:
invalid_request(400)no_embedding_provider(400)unauthorized/forbidden(401/403)rate_limited_*(429)
Replay IDs to persist
request_id(from response envelope)tenant_idscope- caller
run_idfor downstream policy/action chain decision_idfrom subsequent tool selection- relevant
commit_urivalues from recall candidates
Operational notes
- Use this endpoint as planner input assembly before policy and tool execution.
- Keep the same
run_idacross context assembly, tool selection, and action execution.