unlob Docs
Browse documentation

A ready-to-read context pack

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.

get /assemble_context

Request

curl \
  -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/assemble_context?q=<q>"

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.

Parameters

NameTypeDescription
qrequiredstringThe question.
budgetintegerToken budget for the pack, default 4000.
modestringkeyword | semantic | hybrid (default).

Responses

StatusMeaning
200Deduped, trust-ranked passages packed to the budget, each with the reason it was included.
401Missing, unknown or revoked key. A key minted moments ago can answer 401 until it propagates to the serving fleet.
429Over the per-minute rate, or past a hard-capped monthly quota. `retry-after` is present on the rate-limit case only.

The same call over MCP is a tool with these parameter names unchanged. See Errors for what to do with each status.