Skip to content

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.

SELECT text, customer_id
FROM RETRIEVE(facet => 'meeting_transcripts',
query => 'european equity exposure',
top_k => 5)
  • facet — a declared UnstructuredFacet.
  • query — natural text; the engine embeds it with the facet’s declared model.
  • top_k — must satisfy ≤ facet.retrieval.max_top_k.
  • An optional WHERE over declared metadata (literal comparisons, IN, BETWEEN, combined with AND) 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": []
}
  • 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.