🤖 Retrieval
Classic Retrieval
To retrieve the most relevant knowledge passages for a given query from a data source:
results = client.retrieve(query='Where is Boston?', top_k=5, sources=['City'])
Retrieval Agents
To use our intelligent Retrieval Agent for retrieval:
results = client.retrieve(query='YOUR_QUERY', top_k=5, sources=['City'], agent='on')
Enabling the retrieval agent improves search results by breaking down a complex query into multiple subqueries.
To use our Metadata Agent for retrieval:
results = client.retrieve(query='YOUR_QUERY', top_k=5, sources=['City'], metadata='on')
Turning on the metadata agent improves search results through precise metadata filtering.
Embedding Models
To list all embedding models available to use for retrieval:
results = client.list_embedding_models()
Please find the list of available embedding models here (opens in a new tab).
More embedding models are coming soon.
Adding OpenAI Key
To add an OpenAI key to the user account:
client.add_openai_key(key='YOUR_OPENAI_API_KEY')
To remove the added key:
client.remove_openai_key()