Advanced Single Corpus Query
POST/v2/corpora/:corpus_key/query
Perform an advanced query on a specific corpus to find relevant results, highlight relevant snippets, and use Retrieval Augmented Generation:
- Specify the unique
corpus_key
identifying the corpus to query. Thecorpus_key
is created in the Vectara Console UI or the Create Corpus API definition. When creating a new corpus, you have the option to assign a customcorpus_key
following your preferred naming convention. This key serves as a unique identifier for the corpus, allowing it to be referenced in search requests. For more information, see Corpus Key Definition. - Customize your search by specifying the query text (
query
), pagination details (offset
andlimit
), and metadata filters (metadata_filter
) to tailor your search results. Learn more - Leverage advanced search capabilities like reranking (
reranker
) and Retrieval Augmented Generation (RAG) (generation
) for enhanced query performance. Generation is opt in by setting thegeneration
property. By excluding the property or by setting it to null, the response will not include generation. Learn more. - Use hybrid search to achieve optimal results by setting different values for
lexical_interpolation
(e.g.,0.025
). Learn more - Specify Vectara's RAG-focused LLM (Mockingbird) for the
generation_preset_name
. Learn more - Use advanced summarization options that utilize detailed summarization parameters such as
max_response_characters
,temperature
, andfrequency_penalty
for generating precise and relevant summaries. Learn more
For more detailed information, see Query API guide.
Request
Responses
- 200
- 400
- 403
- 404
A response to a query.
Query request was malformed.
Permissions do not allow querying the corpus.
Corpus not found.