Collections are the fundamental organizational unit in Chroma. They are named groups of embeddings, documents, and metadata that you can query.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/chroma-core/chroma/llms.txt
Use this file to discover all available pages before exploring further.
What is a Collection?
A collection is a container that holds:- Embeddings: Vector representations of your data
- Documents: The original text or data
- Metadata: Additional information about each record
- IDs: Unique identifiers for each record
Creating Collections
Create a new collection usingcreate_collection():
With Metadata
You can attach metadata to the collection itself:With Custom Embedding Function
Specify a custom embedding function for the collection:Getting Collections
Retrieve an existing collection:Listing Collections
List all collections in the database:Deleting Collections
Delete a collection and all its data:Collection Operations
Count Records
Get the number of records in a collection:Peek
Quickly view the first few records:Modify Collection
Update collection name or metadata:Collection Configuration
Collections can be configured with specific index and schema settings:Distance Metrics
Chroma supports three distance metrics (spaces):cosine: Cosine similarity (default for most embedding functions)l2: Euclidean (L2) distanceip: Inner product
Schema Configuration
Define the structure of your collection data:Indexing Status
Monitor the indexing progress of your collection:Best Practices
Use descriptive names
Use descriptive names
Choose collection names that clearly describe the data they contain:
Add metadata to collections
Add metadata to collections
Use collection metadata to track versioning and description:
Choose appropriate distance metrics
Choose appropriate distance metrics
Different embedding models work best with different distance metrics:
- Most OpenAI embeddings: use
cosine - Some specialized embeddings: use
l2orip - Check your embedding model’s documentation
Next Steps
Embeddings
Learn how Chroma handles vector embeddings
Metadata
Understand metadata and filtering
Querying
Query your collections with similarity search
Embedding Functions
Use embedding functions with collections