Techniques for searching document collections efficiently
retrieve_docs
function for a simple vector similarity search or query
to combine retrieval with language model generation:
filters
dictionary when calling retrieve_docs
or query
, e.g. filters={"category": "finance"}
, to restrict results to documents with matching metadata.
query
instead of retrieve_docs
?query
when you need the language model to read the retrieved docs and generate a synthesized answer; use retrieve_docs
when you only need the raw documents.