What is Schema?
Schema allows you to configure which indexes are created for different data types in your Chroma collections. You can enable or disable indexes globally or per-field, configure vector index parameters, and set up sparse vector indexes for keyword-based search.Why Use Schema?
- Enable Hybrid Search: Combine dense and sparse embeddings for better retrieval quality
- Optimize Performance: Disable unused indexes to speed up writes and reduce index build time
- Fine-Tune Configuration: Adjust vector index parameters for your workload
Quick Start
Here’s a simple example creating a collection with a custom schema:Important: Schema is only configurable in
create_collection. We are working on supporting schema update via collection modifyFeature Highlights
- Default Indexes: Collections start with sensible defaults - inverted indexes for scalar types, vector index for embeddings, full text search index for documents
- Global Configuration: Set index defaults that apply to all metadata keys of a given type during collection creation
- Per-Key Configuration: Override defaults for specific metadata fields
- Sparse Vector Support: Enable sparse embeddings for hybrid search with BM25-style retrieval
- Index Deletion: Disable indexes you don’t need to improve write performance
- Dynamic Schema Evolution: New metadata keys added during writes automatically inherit from global defaults
Next Steps
- Schema Basics - Learn the structure and how to use Schema
- Sparse Vector Search Setup - Configure sparse vectors and hybrid search
- Index Configuration Reference - Complete index type reference