unlob Docs
Browse documentation

assemble_context

GraphRAG-as-a-service: instead of a link list, a ready-to-read context pack — the corroborated, story-deduped, trust-ranked passages for a question, packed to a token budget, each carrying the reason it was included.

Behaviour

The engine runs the whole retrieval loop — search, dedup, corroborate, rank, pack — so you just read. Use this when the question is 'what should I know about X' rather than 'find me the page that says Y'.

`budget` is in tokens and is honoured as a ceiling; `estimated_tokens` reports what was actually packed.

Arguments

inputSchema

NameTypeDescription
budgetintegerToken budget for the pack
mode"keyword" | "semantic" | "hybrid"
qrequiredstringThe question

Returns

A JSON payload in the text content block, and the same payload as structuredContent for clients that support it.

outputSchema

NameTypeDescription
estimated_tokensrequiredinteger
itemsrequiredobject[]
queryrequiredstring
token_budgetrequiredinteger

Calling it

Over Streamable HTTP, with the required arguments filled in:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "assemble_context",
    "arguments": {
      "q": "<q>"
    }
  }
}

Most clients do this for you — see Connect a client. To drive it by hand, complete the startup lifecycle first.