Skip to main content
POST /v0/search returns the passages that best answer a query, across up to 16 Corpora, with the exact excerpt of each. This page covers the options you will use; the API reference lists every endpoint and field.

Prerequisites

  • QUIVR_API_URL and a QUIVR_API_KEY with content:read and search:query on the Corpora you search (Quickstart).
  • Some articles. These examples use a Corpus with two, from two sources:

Choose a mode

limit is 10 by default and 50 at most. There is no pagination: ask for what you will show. A query has at most 8,192 characters. For semantic and hybrid, the embedding model also caps its length (256 tokens with the first-party model); a longer query is refused with 422 query_too_long, never truncated.

Narrow to some sources

filter.source_namespaces keeps only Records from those Source Namespaces. The filter applies before ranking, so you get a source’s best matches even when other sources would outrank them:

Cite a result

Each hit carries what a citation needs: GET /v0/records/{record_id}/versions/{version_id} returns the whole Version, so you can show the passage in context. Every hit is re-read from storage and re-checked against the caller’s access before it is returned. A search never returns a withdrawn Record, a Version that is no longer current, or a Corpus outside the key’s scope; a Corpus you may not read makes the whole search fail with 403.

Choose a profile

A profile names how results are found and ranked. The built-in search answers default. A deployment with a retrieval plugin may offer more, such as a slower deep profile; list them:
Pass "profile": "deep" in the search. An unknown profile is refused with 422 unsupported_profile.

Search from the command line

quivr search sends the same request from a terminal, with the same QUIVR_API_URL and QUIVR_API_KEY:
Add --json to print the API response unchanged, and --source to filter by Source Namespace. The CLI reference lists every flag and exit code.

When a search fails