Skip to content
unlob

Grounded question answering

Teams building assistants that answer factual questions from current sources.

The problem

  • Answering from a ranked list means the model does the selection, and the selection is where accuracy is decided.
  • The model cannot tell that six of the ten results are the same story, so repetition reads as confirmation.
  • When the answer has to be defended, "the model chose these sources" is not an account of anything.

The approach

  • assemble_context does the selection with signals the model does not have: story clusters, corroboration counts across rejected duplicates, and graph centrality.
  • Every returned item carries the reason it was included, which makes the answer explainable rather than merely sourced.
  • A corroboration floor means single-sourced claims never reach the model at all.

The parameters that matter

ParameterValueWhy
assemble_context?q=the questionThe whole retrieval loop in one call.
budget3000–4000Enough context for a grounded answer without crowding the prompt.
min_independent_sources2Single-sourced claims excluded before the model sees them.
languser’s languagePins output language when the user needs one.
In practicebash
curl -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/assemble_context?q=what+changed+in+EU+AI+regulation+this+year&budget=3500"

Where this is not the right tool

  • Ranking policy is ours. If you have a domain-specific reranker, use the retrieval endpoints instead.
  • For questions about very recent events, check published_at on the returned passages — the index is not a real-time news wire.

Frequently asked questions

What token budget should I use?

Three to four thousand covers most factual questions. Larger budgets add marginal passages that rarely change the answer and reliably cost tokens.

Can I see why each passage was chosen?

Yes — every item in the pack carries a reason string, such as corroborated by five independent hosts or highest centrality in its cluster. Log it alongside the answer.

Build it on the free tier

10,000 requests a month, no card. Every parameter above works on every plan.