Skip to main content
The Search API is a powerful, flexible interface for hybrid search operations in Chroma Cloud, combining vector similarity search with metadata filtering and custom ranking expressions.
Search API is available in Chroma Cloud only. Future support on single-node Chroma is planned.

What is the Search API?

The Search API provides a powerful, unified interface for all search operations in Chroma. Instead of using separate query() and get() methods with different parameters, the Search API offers:
  • Unified interface: One consistent API replaces both query() and get() 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

When passing text to Knn(), the embedding is automatically created using the collection’s schema configuration. By default, Knn uses the #embedding key, which corresponds to the default vector index. You can specify a different key with the key parameter (e.g., Knn(query=query_text, key="my_custom_embedding")). If the specified key doesn’t have an embedding configuration in the collection schema, an error will be thrown.

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:
Make sure you’re connected to a Chroma Cloud instance, as the Search API is currently only available for cloud deployments.

Complete Example

Here’s a practical example searching for science articles:
Example output:

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

Please report issues or feedback through the Chroma GitHub repository.

What’s Next?