/collections/{id}/searchScope ask:readRetrieval-only search over the active World's compiled retrieval index: hybrid lexical + dense + structure retrieval, RRF-fused, reranked, then World Gate filtered. Returns the ContextPacket (the same runtime contract /ask, MCP and the CLI share) plus per-source retrieval telemetry, without generating an answer. There is no excerpt fallback here -- a World with no queryable compiled index is a 409, not a weaker answer. Read `degradations` before comparing two results: a full-pipeline result and a partial one otherwise look identical.
curl -sS -X POST https://tavonel.com/api/v1/collections/{id}/search \
-H "Authorization: Bearer $TAVONEL_API_KEY" \
-H "content-type: application/json" \
-d '{ "query": "<query>", "limit": 1 }'import os
import requests
body = {
"query": "<query>",
"limit": 1
}
response = requests.request(
"POST",
"https://tavonel.com/api/v1/collections/{id}/search",
headers={"Authorization": "Bearer " + os.environ["TAVONEL_API_KEY"]},
json=body,
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch("https://tavonel.com/api/v1/collections/{id}/search", {
method: "POST",
headers: { authorization: `Bearer ${process.env.TAVONEL_API_KEY}`, "content-type": "application/json" },
body: JSON.stringify({ "query": "<query>", "limit": 1 }),
});
if (!response.ok) throw new Error(`${response.status} ${(await response.json()).code}`);
console.log(await response.json());{
"query": "<query>",
"limit": 1
}| Status | Response |
|---|---|
200 | { code, retrievalPath, contextPacket, degradations, retrieval, activeWorld, freshness }. The contextPacket carries the evidence-bound retrieval units with their lexical, dense and structure ranks, the reranker score and the World Gate decisions; retrieval carries the per-source candidate counts and gateRejections. retrievalPath is always compiled-retrieval-v1. degradations is a named list of what did not run — dense retrieval skipped with no embedder configured, or the reranker degrading to the fused order — and reading it is how a full-pipeline result is told from a partial one, because the two otherwise look identical. |
400 | QUERY_INVALID — The search query was absent, or shorter than the minimum. COLLECTION_ID_INVALID — The collection id did not match collection-<32 hex>. INVALID_JSON — The body was not parseable JSON. |
401 | AUTH_REQUIRED — No credential was presented, or the bearer token is not a key TAVONEL issued. This is what an unauthenticated request to any scoped route returns. |
403 | API_SCOPE_REQUIRED — The key authenticated and does not carry the scope this operation requires. The request was refused rather than answered with less. PILOT_ACCESS_REQUIRED — The credential is valid and the workspace it names is not admitted to TAVONEL. |
409 | RETRIEVAL_RUN_NOT_FOUND — The active World has no completed retrieval compile run, so there is no queryable index. Search has no fallback — a weaker answer presented as the real one is worse than a refusal you can act on. RETRIEVAL_PROFILE_NOT_FOUND — The retrieval profile the index was compiled against is not registered. ACTIVE_WORLD_NOT_FOUND — Nothing has been activated for this collection, so there is no World to read, index or answer from. A candidate nobody accepted is not a smaller answer — it is a different one. |
413 | QUERY_TOO_LARGE — The search query exceeded 500 characters. |
429 | API_RATE_LIMITED — The key has used its per-minute allowance for this scope. The window is a fixed clock minute per key and scope; the allowances are on /docs/billing-and-limits. |
503 | ACTIVE_WORLD_STORE_UNAVAILABLE — The World store could not be reached. |