Skip to main content
/v1/context returns a Context Contract — a richer envelope than /v1/search that documents not just what was retrieved but also what was excluded and why. It’s designed for agents that need to reason about their own context window honestly.

Why a contract instead of just hits

A bare hit list looks the same whether retrieval found everything relevant or got blocked by a scope. An honest agent needs to know the difference. The contract makes it explicit:
  • What did you ask for?
  • What did Repo retrieve?
  • What did Repo exclude, and why?
  • What are the freshness + access caveats?

Shape

Field reference

contract

hits

Array of retrieved source items, ordered by score descending.

citations

A numbered citation list ready to inject into your LLM prompt. Each citation references a sourceItemId so your agent can resolve [1] → “Brand decisions” → the actual Notion URL.

exclusions

The most important field for honest agents. Each entry explains a piece of context the agent did not receive.

limitations

Higher-level caveats about the retrieval, e.g.:
  • no_context — Repo found nothing matching this query within the caller’s scope.
  • provider_scope_applied — Note that scope filtering was active.
  • missing_sync_timestamp — One or more sources lack freshness metadata.
  • missing_source_access_policy — One or more sources don’t yet have preserved ACL data (Drive specifically).

Why this shape

Repo treats the agent as a participant in a structured exchange, not a black-box consumer of search hits. The contract makes it possible to:
  • Cite sources precisely in answers ([1] → real URL)
  • Tell the user “I have additional context I’m not allowed to share” instead of hallucinating
  • Surface freshness so the agent can hedge (“This is from 6 hours ago — let me check the latest”)
  • Audit retrieval after the fact via requestId

Use the simpler endpoint if you don’t need this

/v1/search returns just the hits array — same retrieval, no envelope. Use it when you’re prototyping or your agent doesn’t care about exclusions.