ChromaDotNet

.NET libraries for Chroma and Chroma Cloud

A client for the Chroma API, a Microsoft.Extensions.VectorData provider, a Testcontainers module and Aspire integrations. We test the client with Chroma 0.4.10 to 1.5.9 and with Chroma Cloud.

dotnet add package ChromaDotNet.Client
using ChromaDB.Client;

using var client = new ChromaClient("http://localhost:8000");
var collection = await client.GetOrCreateCollectionAsync("docs");
var docs = client.GetCollectionClient(collection);

await docs.AddAsync(["doc-1"],
    embeddings: [new([0.1f, 0.4f, 0.2f])],
    documents: ["Chroma from .NET"]);

var results = await docs.QueryAsync(
    new ReadOnlyMemory<float>([0.1f, 0.4f, 0.2f]), nResults: 1);

The packages are named ChromaDotNet.*. The namespaces keep their original names, such as ChromaDB.Client.

Libraries

Each repository publishes its own NuGet packages.

ChromaDotNet.Client

The client covers every operation in the Chroma v2 API, including Chroma Cloud. It runs on .NET 8 and later (including .NET 10), .NET Framework 4.6.2 and .NET Standard 2.0 platforms. For dependency injection, use ChromaDotNet.Client.DependencyInjection.

dotnet add package ChromaDotNet.Client

ChromaDotNet.VectorData

A Microsoft.Extensions.VectorData provider. Use it with Semantic Kernel, Agent Framework or any code written against the abstractions. It supports hybrid search on Chroma Cloud.

dotnet add package ChromaDotNet.VectorData

ChromaDotNet.Testcontainers

A Testcontainers for .NET module. It gives your tests a throwaway Chroma container.

dotnet add package ChromaDotNet.Testcontainers

ChromaDotNet.Aspire.Hosting / .Client

Aspire integrations. Add Chroma to the app host and the client to your services, with health checks, traces and metrics.

dotnet add package ChromaDotNet.Aspire.Hosting
dotnet add package ChromaDotNet.Aspire.Client

Samples

The Semantic Kernel samples run with Azure OpenAI. The Agent Framework samples run with Microsoft Foundry. The chat samples also run locally with Ollama.

  • Semantic KernelVector search and an agent that answers from documents stored in Chroma.
  • Microsoft Agent FrameworkChat history kept in Chroma, and an agent that answers from documentation stored there.