CommunityToolkit.VectorData.Chroma
The Chroma provider for Microsoft.Extensions.VectorData, in the AI Community Toolkit of the .NET Foundation, built on ChromaDotNet.Client. Use it with Semantic Kernel, Agent Framework or any code written against the abstractions.
- Latest release 1.0.1-preview
- NuGet
- GitHub
- Documentation
- Microsoft.Extensions.VectorData
Install
dotnet add package CommunityToolkit.VectorData.Chroma --prerelease Example
Start Chroma, for example with Docker:
docker run -p 8000:8000 chromadb/chroma:1.5.9 Then store two records with a data model and search the nearest one:
using ChromaDB.Client;
using CommunityToolkit.VectorData.Chroma;
using Microsoft.Extensions.VectorData;
using var store = new ChromaVectorStore(new ChromaClient("http://localhost:8000"), ownsClient: true);
var fruits = store.GetCollection<string, Fruit>("fruits");
await fruits.EnsureCollectionExistsAsync();
await fruits.UpsertAsync([
new Fruit { Key = "apple", Text = "A crunchy apple", Vector = new[] { 1f, 0f, 0f } },
new Fruit { Key = "lemon", Text = "A sour lemon", Vector = new[] { 0f, 1f, 0f } },
]);
await foreach (var result in fruits.SearchAsync(new ReadOnlyMemory<float>([0f, 0.9f, 0.1f]), top: 1))
Console.WriteLine($"{result.Record.Key}: {result.Record.Text} ({result.Score})");
class Fruit
{
[VectorStoreKey] public string Key { get; set; } = "";
[VectorStoreData] public string Text { get; set; } = "";
[VectorStoreVector(3)] public ReadOnlyMemory<float> Vector { get; set; }
}Tested on 25 October 2026 with CommunityToolkit.VectorData.Chroma 1.0.1-preview on Chroma 1.5.9.
With dependency injection, AddChromaVectorStore registers the vector store.
The limitations on Chroma Cloud and on self-hosted Chroma are in the README.
Used with
Recommended by Semantic Kernel and listed among the .NET community projects of Microsoft Agent Framework.
Samples: Semantic Kernel and Microsoft Agent Framework.