Retrieval (RETRIEVE)
Retrieval is a relation source inside OSL-SQL:
the RETRIEVE(...) table function. There is no separate /osl/retrieve
endpoint any more — you SELECT from RETRIEVE(...) in a POST /osl/query
body.
The form
Section titled “The form”SELECT text, customer_idFROM RETRIEVE(facet => 'meeting_transcripts', query => 'european equity exposure', top_k => 5)facet— a declaredUnstructuredFacet.query— natural text; the engine embeds it with the facet’s declared model.top_k— must satisfy≤ facet.retrieval.max_top_k.- An optional
WHEREover declared metadata (literal comparisons,IN,BETWEEN, combined withAND) lowers to the scalar prefilter, applied by the governed store before the ACL trim.
The SELECT may project text, declared metadata and derived operator
outputs; doc_id, chunk_id, source, cite and redacted_fields are
always preserved for grounding. The raw score used to rank the retrieval
is not projectable and never served.
{ "text": "Anna wants to increase EU equity exposure […]", "customer_id": "9c1e…f04a", "cite": { "source": "gong://…", "doc_id": "meet-2026-05-08-7a3c", "chunk_id": "chk-…" }, "redacted_fields": []}SELECT text, SIMILARITY(text, 'churn risk') AS churn_similarityFROM RETRIEVE(facet => 'meeting_transcripts', query => 'renewal', top_k => 3)SIMILARITY/SUMMARIZE/… are projection operators
— unary maps over already-governed passages. SIMILARITY computes another
cosine against a concept: without an alias it stays internal; with AS <out>
it is served.
How retrieval is governed
Section titled “How retrieval is governed”- Redaction version. The facet is served at the subject’s required
redaction version —
exact-or-deny. Redacted metadata fields are listed in
redacted_fields. - Row-level ACL. Deny-by-default: an actor with no grant gets zero passages.
- Isolation. The query opens only the selected version’s Lance table — no side-channel to less-redacted vectors.
Related
Section titled “Related”- The query surface (OSL-SQL) — all five forms.
- Access & capabilities — grants, redaction versions, MEET.
- For a governed preview of a few chunks, use
POST /osl/sample.