What is the Search API?
The Search API provides a powerful, unified interface for all search operations in Chroma. Instead of using separatequery() and get() methods with different parameters, the Search API offers:
- Unified interface: One consistent API replaces both
query()andget()methods - Expression-based queries: Use
K()expressions for powerful filtering and field selection - Composable operations: Chain methods to build complex queries naturally
- Type safety: Full type hints, IDE autocomplete, and clear error messages
- Advanced capabilities: Hybrid search with RRF, custom ranking expressions, and batch operations
- Flexible result selection: Choose exactly which fields to return, reducing payload size
Quick Start
Feature Comparison
Availability
The Search API is available for Chroma Cloud. Support for local Chroma deployments will be available in a future release.Required Setup
To use the Search API, you’ll need to import the necessary components:Complete Example
Here’s a practical example searching for science articles:Performance
The Search API provides the same performance as existing Chroma query endpoints, with the added benefit of more flexible query construction and batch operations that can reduce the number of round trips.Feedback
What’s Next?
- Search Basics - Learn how to construct searches
- Filtering with Where - Master metadata filtering
- Ranking and Scoring - Understand ranking expressions
- Group By & Aggregation - Diversify results with grouping
- Hybrid Search - Combine multiple strategies
- Examples - See real-world patterns