retrieve is gated by retrieve and is the method most clients use. A
single call can drive the server’s entire pipeline — query
transform, hybrid recall, fusion, rerank, MMR diversification, recency weighting,
metadata filtering, and citation assembly. Every option beyond query/k is
optional and honoured only within the advertised retrieve capability.
Core params
string | Content | Content[]
required
The query — a bare string, or Content block(s)
for multimodal retrieval.
integer
default:"10"
The final number of hits to return. Clamped to
retrieve.maxK."dense" | "sparse" | "hybrid"
Retrieval mode. MUST be one of the advertised
retrieve.modes."text" | "image" | "audio" | "code" | "multimodal"
default:"text"
The query modality for multimodal engines.
Pipeline params
integer
Recall-stage candidate count before rerank (default server-chosen, e.g.
max(k, 100)).object
{ method: "rrf" | "weighted", weights?, rrfK? } — how to combine dense and
sparse lists in hybrid mode.object | false
{ method, model?, topN? } to rerank inside the call, or false to skip.
Needs retrieve.rerankBuiltin.object
{ lambda: 0.5 } — MMR diversification. lambda 0 = max diversity, 1 = pure
relevance."rewrite" | "hyde" | "multi-query" | "decompose" | false
Apply a query transform before recall (needs
transform).Assembly params
object
A metadata filter tree. Fields are validated
against
filter.fields.float
Drop hits below this score.
object
{ field, halfLifeDays } — exponential recency weighting."chunk" | "document" | "node" | "triplet" | "path" | "subgraph" | "community" | "tree-node" | "page"
The retrieval granularity to return — a chunk
(classic), a whole document (LongRAG), a graph node/triplet/path/subgraph
(GraphRAG), a community summary, a RAPTOR tree-node, or a rendered page. Must
be in
retrieve.units.integer
Abstraction level in a hierarchical corpus — RAPTOR tree depth or Leiden
level.
0 is the leaf/most-specific layer.integer
Pack top hits until their bodies reach this many tokens instead of a fixed
k — long-context readers and the chunk-explosion problem. Needs
retrieve.tokenBudget.string
Opaque token threading this call into an agentic trajectory
so the server can dedup already-seen hits and cache trajectory state. Needs
session.boolean
default:"true"
Include the hit body text.
boolean
default:"false"
Include each hit’s stored vector.
integer
Determinism hint — fixes stochastic steps. See below.
string
Pin retrieval to a corpus snapshot. See below.
boolean
default:"true"
If
true, an unsupported option is -32005; if false, the server MAY
degrade and note it in usage.notes.string
Opaque pagination cursor (needs
pagination).Result
Hit[]
The ranked results — see the Hit shape below.
string
Opaque cursor for the next page, if any.
string
The corpus snapshot actually served.
object
{ candidates, reranked, latencyMs, notes? } per-request telemetry.string
The query after a server-side
rewrite, if applied.The Hit shape
idis in the server’s identifier space; cross-engine fusion keys on the stringifiedid.confidenceis a normalised[0,1]relevance/self-eval signal — unlikescoreit is comparable across calls, so corrective and adaptive clients threshold on it (CRAG buckets, Self-RAGIsRel). Needsretrieve.confidence.unit/leveltell the client the granularity and abstraction level of the hit so it can pack or re-query at the right level.scoresexposes the per-stage contribution (dense/sparse/rerank) for debugging and telemetry.provenancecarries graph/tree lineage (path · nodes · edges · leaves) for auditable, path-level citation (GraphRAG, HippoRAG, RAPTOR).trustcarries provenance and safety signals (injectionSuspected,sanitized) so a downstream LLM can weight or quarantine untrusted content before it enters a prompt.content/modalitycarry non-text bodies for visual-document and multimodal retrieval.
Scores are server-scaled
score is the engine’s native relevance number — cosine similarity, a dot
product, raw BM25F, whatever the backend emits. Its scale is server-specific, so
two servers’ score values are never directly comparable, even if both look
like “0.94”. A server MAY advertise retrieve.scoreScale
(cosine · dot · bm25 · probability · unbounded) so a client can label or
bucket scores — but that is informational, not a comparability promise.
The funnel invariant
The three size knobs form a funnel and MUST satisfycandidateK ≥ rerank.topN ≥ k. The server clamps each to retrieve.maxK / rerank.maxCandidates,
SHOULD report effective counts in usage, and MUST NOT return more than
k hits.
Determinism & reproducibility
For evals, regression tests, and audits, two optional handles make a result repeatable:seed — fix stochastic steps
seed — fix stochastic steps
A client-supplied integer that fixes any stochastic step (ANN exploration,
MMR tie-breaking, LLM rerank sampling). A server that honours it MUST
return identical results for identical
(query, params, seed, indexVersion);
one that cannot MUST ignore it (never error) and SHOULD note
non-determinism in usage.notes. Advertised via retrieve.deterministic.indexVersion — pin a corpus snapshot
indexVersion — pin a corpus snapshot
An opaque token identifying a corpus snapshot. A snapshot-capable server
echoes the served snapshot, and when a client pins one MUST either serve
it or fail with
-32010 if it was garbage-collected — never silently serve a
different one. Advertised via retrieve.snapshots.Stream long retrievals
Attach a
progressToken to receive incremental progress and partial hits.