Skip to content
unlob

assemble_context

Coverage graph

GraphRAG as a service: returns a ready-to-read context pack — corroborated, story-deduplicated, trust-ranked and packed to a token budget, each passage carrying the reason it was included.

Instead of a link list, a context set. The engine runs the whole retrieval loop — retrieve, collapse by story, rank by corroboration then authority then relevance, pack to budget — so the agent just reads.

Every item carries its reason, which means the agent can show its work. In production, where a wrong answer has to be explainable, that is not a nicety.

Arguments

NameTypeDescription
queryrequiredstringThe question.
budgetintegerToken budget. Defaults to 4000.
langstringLanguage restriction.

Returns:A context pack: budget, estimated tokens, and items with reasons.

Example

Prompt: “Get me everything I need to answer this question, in 4,000 tokens.”

assemble_context calljson
{ "query": "who funds independent web indexes", "budget": 4000 }

Over HTTP

The same operation is available as GET /assemble_context for anything that does not speak MCP.

/assemble_contextbash
curl -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/assemble_context?q=who+funds+independent+web+indexes&budget=4000"

Setup

One config block gives your client all 11 tools, including this one.

MCP configjson
{
  "mcpServers": {
    "unlob": {
      "command": "npx",
      "args": ["-y", "@unlob/mcp"],
      "env": { "UNLOB_API_KEY": "ulb_your_key_here" }
    }
  }
}

Get a key and connect

10,000 free requests a month. MCP calls bill exactly like HTTP calls — one request each.