Skip to content
unlob

Agent retrieval

Build a research agent

Research agents are the clearest case for graph retrieval, because research is inherently multi-hop: you find something, it points at something else, and the connections are the substance rather than a means to it.

Verified 5 August 2026

Start by triaging the field

An agent entering an unfamiliar domain does not know which sources matter, and relevance ranking will not tell it — relevance answers "what matches my words", not "what does this field consider foundational".

authorities answers the second question using graph centrality. Starting there fills the context window with what a domain expert would have read first, rather than with whatever matched the initial query string.

Triage firstbash
curl -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/authorities?topic=science&limit=10"

Build entity briefs in one call

Understanding an organisation by hand means roughly ten searches and a manual merge, all in context and all billed. dossier returns mention counts, the hosts covering it ranked by authority, and the entities co-mentioned with it.

The co-mention list is usually the most valuable part: it surfaces the entities you did not know to ask about, which is where the next question comes from.

An entity briefbash
curl -H "x-api-key: $UNLOB_API_KEY" \
  "https://api.unlob.com/dossier?entity=Common+Crawl&limit=10"

Follow threads rather than guessing queries

When an agent finds something interesting, the naive move is to invent a new query about it — and query invention is where research agents most often go sideways, because the new query reflects the agent's vocabulary rather than the corpus's.

related returns the connected neighbourhood of a passage. The edges are what to read next, and they come from the corpus rather than from the agent's guess.

Verify before reporting

Any claim the agent will state as fact should be checked for independent corroboration first. corroborate returns the distinct hosts asserting it, and the number of duplicates merged into the survivor.

Make this a required step in the agent's instructions rather than an optional tool. Research agents fail most visibly by reporting a single well-syndicated claim as established.

Assemble the final context deliberately

At the end, the agent has more material than fits. assemble_context packs the corroborated, trust-ranked set to a token budget with a reason per passage — better than truncating whatever happens to be in the conversation, and explainable afterwards.

A loop that terminates

Research agents often fail to stop. Facets help: limit=0&facets=true returns totals and distribution with no results, so the agent can cheaply check whether a new angle has coverage before committing to it.

Give it an explicit budget — a number of graph traversals and a token ceiling — and have it call assemble_context when either is reached. An agent with a stopping rule beats one with better search every time.

Frequently asked questions

How many API calls should a research agent make?

Far fewer than a naive loop suggests. A triage call, two or three entity or neighbourhood traversals, a corroboration check per claim, and one context assembly is usually enough — against twenty or more searches in the naive version.

When should the agent fetch full document text?

Only after selection, and only for passages that survived corroboration. Fetching before selection is the largest avoidable cost in a research loop.

How do I stop it looping forever?

Give it an explicit budget in traversals and tokens, and a rule to assemble and answer when either is exhausted. Use limit=0 probes to check coverage before opening a new line of enquiry.

Try it against your own queries

10,000 free requests a month, no card. Everything in this guide works on the free tier.