Skip to main content
Embeddings are numeric representations of your data that capture meaning in a form AI models can work with. They can represent text, images, and eventually audio and video. Chroma stores and indexes embeddings so you can efficiently search for similar content. You can generate them locally with an installed library or remotely through an API.

Using Embedding Functions

Embedding functions can be linked to a collection and used whenever you call add, update, upsert or query.For example, this is how you use the OpenAI embedding function:
You can also use embedding functions directly which can be handy for debugging.

Custom Embedding Functions

You can create your own embedding function to use with Chroma; it just needs to implement EmbeddingFunction.

Default: all-MiniLM-L6-v2

Chroma’s default embedding function uses the Sentence Transformers all-MiniLM-L6-v2 model to create embeddings. This embedding model can create sentence and document embeddings that can be used for a wide variety of tasks. This embedding function runs locally on your machine, and may require you to download the model files (this will happen automatically).If you don’t specify an embedding function when creating a collection, Chroma will set it to be the DefaultEmbeddingFunction:

All Embedding Functions

Chroma provides lightweight wrappers around popular embedding providers, making it easy to use them in your apps. You can set an embedding function when you create a Chroma collection, to be automatically used when adding and querying data, or you can call them directly yourself. For TypeScript users, Chroma provides packages for a number of embedding model providers. The Chromadb python package ships with all embedding functions included. We welcome contributions! If you create an embedding function that you think would be useful to others, please consider submitting a pull request.