.search() enables you to uncover the most pertinent context by performing a semantic search across your data sources based on a given query. Refer to the function signature below:
Parameters
Question
Number of relevant documents to fetch. Defaults to
3Key value pair for metadata filtering.
Pass raw filter query based on your vector database.
Currently,
raw_filter param is only supported for Pinecone vector database.Returns
Return list of dictionaries that contain the relevant chunk and their source information.
Usage
Basic
Refer to the following example on how to use the search api:Code example
Advanced
Metadata filtering using where params
Here is an advanced example of search() API with metadata filtering on pinecone database: