Quick Start
kb.query()
Search the knowledge base for relevant content.Parameters
Example
Retrieval Types
basic
Standard vector similarity search. Default and fastest option.mmr (Maximal Marginal Relevance)
Returns diverse results by reducing redundancy. Useful when you want varied perspectives.hyde (Hypothetical Document Embeddings)
Generates a hypothetical answer first, then searches for similar content. Better for question-style queries.time_aware
Weights results by recency. Useful for content where freshness matters.QueryResult Object
Each result is aQueryResult with these properties:
Working with Results
Using with Agents
Pass knowledge bases toagent.run() for RAG-powered responses.
Basic Usage
Multiple Knowledge Bases
Custom Runtime Configuration
Usewith_config() to customize retrieval settings per-call: