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. The client is tested 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, like ChromaDB.Client.

Libraries

Each repository publishes its own NuGet packages.

ChromaDotNet.Client

The client: every operation of the Chroma v2 API, Chroma Cloud included, on .NET 8 and later, .NET 10 included, on .NET Framework 4.6.2 and on .NET Standard 2.0 platforms. Dependency injection comes in ChromaDotNet.Client.DependencyInjection.

dotnet add package ChromaDotNet.Client

ChromaDotNet.VectorData

A Microsoft.Extensions.VectorData provider, for Semantic Kernel, Agent Framework and any code written against the abstractions. Hybrid search on Chroma Cloud.

dotnet add package ChromaDotNet.VectorData

ChromaDotNet.Testcontainers

A Testcontainers for .NET module: a throwaway Chroma container in your tests.

dotnet add package ChromaDotNet.Testcontainers

ChromaDotNet.Aspire.Hosting / .Client

Aspire integrations: Chroma in the app host, and the client in the services, with health checks, traces and metrics.

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

Samples

The samples run with Azure OpenAI (Semantic Kernel) or Microsoft Foundry (Agent Framework); 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 in Chroma.