Retrieve relevant memory
assemble_contextRetrieve the memory entries that answer a question, within a token budget. REQUIRES A KEY. Send the returned 'context' to your language model INSTEAD of the whole history. This does not call a model itself — it selects what to send. The budget is a ceiling, not a target: selection stops where relevance runs out, often well below it. The response says how many entries were left behind and why. If the response has a 'budget_warning', the best match did not fit: call again with its suggested_token_budget.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"namespace": "<namespace>",
"query": "<query>"
},
"name": "assemble_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | What you need context about. | |
| reduce | No | Opt-in (FAS L): shorten the assembled context with a small, local, task-agnostic model before it is returned, to lower your own model's token cost. Requires tenant consent for context_reduction (set via /api/v1/gdpr/consent) — otherwise the call is rejected with SAMTYCKE_KRAVS instead of silently ignoring the request. NOT query-aware: selection is driven by what is least informative in general, not by this query. | |
| namespace | Yes | ||
| token_budget | No | ||
| target_tokens | No | Only relevant together with reduce=true. How many tokens the assembled context should be shortened to. Omit for a default halving of what was actually retrieved. |