Skip to main content
Collections are the fundamental organizational unit in Chroma. They are named groups of embeddings, documents, and metadata that you can query.

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
Think of a collection like a table in a traditional database, but optimized for vector similarity search.

Creating Collections

Create a new collection using create_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:
Deleting a collection is permanent and cannot be undone. All embeddings, documents, and metadata in the collection will be lost.

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) distance
  • ip: Inner product

Schema Configuration

Define the structure of your collection data:

Indexing Status

Monitor the indexing progress of your collection:
This is useful for understanding when recent writes have been fully indexed and are available for search.

Best Practices

Choose collection names that clearly describe the data they contain:
Use collection metadata to track versioning and description:
Different embedding models work best with different distance metrics:
  • Most OpenAI embeddings: use cosine
  • Some specialized embeddings: use l2 or ip
  • 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