Agent-native retrieval
POST /v1/retrieve — the same permission-aware search as /v1/query, returning ranked passages with no generation cost.
If you're building your own agent and already have a model to reason with,
POST /v1/retrieve gives you the ranked, cited source passages directly —
no generation latency, because there's no generation step. It's the same
permission-aware hybrid retrieval /v1/query uses internally, and it backs
the MCP search_knowledge tool.
Request
curl -s https://apibr.aize.dev/v1/retrieve \
-H "Authorization: Bearer $BRAIZE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "refund policy", "top_k": 25}'| Field | Default | Meaning |
|---|---|---|
text | — (required) | The search query, up to 4000 characters. |
top_k | 25 | Max passages returned after rerank. Since there's no generation cost, this defaults wider than /v1/query's top_k (12). |
Response
{
"data": {
"passages": [
{
"text": "…",
"score": 0.87,
"document_id": "…",
"document_version": "…",
"title": "Refund Policy",
"source_ref": "refund-policy.pdf",
"heading_path": ["Policies", "Refunds"],
"context_prefix": "…"
}
]
},
"meta": { "request_id": "…", "braize_version": "2026-09-01" }
}scoreis a normalized rerank relevance in[0, 1]— higher is more relevant, not a probability.heading_pathlocates the passage inside its source document (useful for citing "Policies → Refunds" rather than just a filename).context_prefixis the situating sentence the passage was indexed with — it helps a downstream model interpret a passage pulled out of context.- Passages return text and provenance only — never embeddings.
Why not always use /v1/retrieve?
Use /v1/query when you want Braize to also synthesize the answer (a human
channel, a chat UI). Use /v1/retrieve when your own model will do the
reasoning — an agent, a custom RAG pipeline, or anything calling through
MCP's search_knowledge. Same ACL pre-filter either way: an identity only
ever gets passages it's permitted to see.
What's next
- Setting up MCP —
search_knowledgeis this endpoint, exposed as a tool. - Full request/response schema: API reference.