ChromaDotNet.Client.DependencyInjection 2.22.1

Prefix Reserved
dotnet add package ChromaDotNet.Client.DependencyInjection --version 2.22.1
                    
NuGet\Install-Package ChromaDotNet.Client.DependencyInjection -Version 2.22.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ChromaDotNet.Client.DependencyInjection" Version="2.22.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChromaDotNet.Client.DependencyInjection" Version="2.22.1" />
                    
Directory.Packages.props
<PackageReference Include="ChromaDotNet.Client.DependencyInjection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ChromaDotNet.Client.DependencyInjection --version 2.22.1
                    
#r "nuget: ChromaDotNet.Client.DependencyInjection, 2.22.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package [email protected]
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ChromaDotNet.Client.DependencyInjection&version=2.22.1
                    
Install as a Cake Addin
#tool nuget:?package=ChromaDotNet.Client.DependencyInjection&version=2.22.1
                    
Install as a Cake Tool

ChromaDotNet

ChromaDB.Client

NuGet CI License OpenSSF Scorecard OpenSSF Best Practices

Open in GitHub Codespaces

ChromaDB.Client, published on NuGet as ChromaDotNet.Client, is a .NET client for Chroma and Chroma Cloud. It covers:

  • collections, tenants and databases;
  • writing and reading records, and nearest neighbor queries with filters;
  • the Search API of distributed Chroma, the one Chroma Cloud runs on, and of VecturaDB, with hybrid BM25 search;
  • OpenTelemetry traces and metrics.

ChromaDotNet is an independent community project that provides .NET libraries and tools for Chroma. Independent project. Not affiliated with, endorsed by or sponsored by Chroma Inc. CHROMA is a registered trademark of Chroma Inc., used here only to describe compatibility. We use the name "Chroma" only to say which software our projects work with. It does not mean that Chroma Inc. made, approved or supports them. This client is the continuation of ssone95/ChromaDB.Client, kept up to date with current Chroma versions. The original ChromaDB.Client package is deprecated on NuGet in favor of ChromaDotNet.Client. See About this fork.

Website: chromadotnet.org

Used by

Try it in your browser

Click Open in GitHub Codespaces above. The Codespace has .NET 10 and Chroma on port 8000. When the terminal is ready, run:

dotnet run Samples/quickstart.cs

The quickstart takes ChromaDotNet.Client from NuGet, creates a collection, adds records with documents and metadata, queries them by similarity and by metadata, and deletes the collection. The embeddings are written by hand, so no model or key is needed.

You need a GitHub account. The Codespace uses the free Codespaces hours of your account.

Installation

dotnet add package ChromaDotNet.Client

ChromaDotNet.Client.DependencyInjection for Microsoft.Extensions.DependencyInjection: Dependency injection.

Backup and restore of collections through the API, as a library, ChromaDotNet.Client.Backup, and as the command chromadotnet, from ChromaDotNet.Client.Cli or as a file of each release that runs without .NET: Backup and restore.

To run Chroma on your machine without Docker: ChromaDotNet.Local.ChromaDB.

To compute the embeddings as the Python client does: ChromaDotNet.Embeddings, see Embeddings.

Example

The models, like ChromaRecords, ChromaQuery and ChromaCollectionDefinition, are in ChromaDB.Client.Models. AddChromaClient is in ChromaDB.Client.DependencyInjection.

using ChromaDB.Client;
using ChromaDB.Client.Models;

var configOptions = new ChromaConfigurationOptions(uri: "http://localhost:8000/api/v2/");
using var httpClient = new HttpClient();
var client = new ChromaClient(configOptions, httpClient);

Console.WriteLine(await client.GetVersionAsync());

var string5Collection = await client.GetOrCreateCollectionAsync("string5");
var string5Client = new ChromaCollectionClient(string5Collection, configOptions, httpClient);

await string5Client.AddAsync(["340a36ad-c38a-406c-be38-250174aee5a4"], embeddings: [new([1f, 0.5f, 0f, -0.5f, -1f])]);

var getResult = await string5Client.GetAsync("340a36ad-c38a-406c-be38-250174aee5a4", include: ChromaGetInclude.Metadatas | ChromaGetInclude.Documents | ChromaGetInclude.Embeddings);
Console.WriteLine($"ID: {getResult!.Id}");

var queryData = await string5Client.QueryAsync([new([1f, 0.5f, 0f, -0.5f, -1f]), new([1.5f, 0f, 2f, -1f, -1.5f])], include: ChromaQueryInclude.Metadatas | ChromaQueryInclude.Distances);
foreach (var item in queryData)
{
	foreach (var entry in item)
	{
		Console.WriteLine($"ID: {entry.Id} | Distance: {entry.Distance}");
	}
}

The URI, the HttpClient and the use from more threads: Connecting.

Compatibility

docs/COMPATIBILITY.md lists every tested release, the differences between them and the versions the CI runs.

The compatibility table shows every check of the latest release on Chroma 1.5.9 and on Chroma Cloud, on each .NET runtime and platform.

Documentation

  • Connecting: the URI, the HttpClient, threads, the API version, authentication and connection strings.
  • Dependency injection: AddChromaClient and AddKeyedChromaClient.
  • Collections: collections, tenants and databases, collections by id.
  • Records: URIs, large writes, deletes and base64 embeddings.
  • Embeddings: embeddings from an IEmbeddingGenerator, query texts and the default embedding function of Chroma.
  • Metadata values: values, lists, deletions in updates and upserts, document copies, conversions.
  • Queries and filters: queries, GetAsync in pages, where and document filters.
  • Upsert strategies: Server and SkipUnchangedEmbeddings.
  • Index settings: the distance, the HNSW and SPANN settings, ModifyConfigurationAsync.
  • Errors: ChromaException and CollectionExistsAsync.
  • Conditional transactions: RunConditionalTransactionAsync, BeginConditionalTransaction and their rules.
  • Mocks in tests: mocking ChromaClient and ChromaCollectionClient.
  • Health, traces and metrics: HealthcheckAsync and OpenTelemetry.
  • Chroma Cloud: options, identity, batches, quotas and the operations of Chroma Cloud.
  • Search: the Search API and hybrid search with BM25.
  • Sparse vectors and schema: sparse vectors, BM25 indexes and the indexes of a schema.
  • Backup and restore: ChromaDotNet.Client.Backup and the command chromadotnet, the file, and a server that takes writes during the backup.
  • Platforms: the builds, trimming and NativeAOT.
  • About this fork: the original project and what this fork does.

Migrating from ChromaDB.Client 1.x

The migration guide has the details, and the release notes list the changes of every version.

Contributing

CONTRIBUTING.md and SECURITY.md.

License

The project is released under the MIT License, keeping the original copyright notice.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ChromaDotNet.Client.DependencyInjection:

Package Downloads
ChromaDotNet.Aspire.Client

Deprecated: use CommunityToolkit.Aspire.Chroma. Independent project. Not affiliated with, endorsed by or sponsored by Chroma Inc. CHROMA is a registered trademark of Chroma Inc., used here only to describe compatibility.

CommunityToolkit.Aspire.Chroma

A ChromaDB client that integrates with Aspire, including health checks, traces and metrics.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.22.1 12 11/16/2026
2.22.0 59 11/15/2026
2.21.0 53 11/13/2026
2.20.0 750 11/6/2026
2.19.0 106 11/6/2026
2.18.1 1,501 10/25/2026
2.18.0 196 10/21/2026
2.17.0 114 10/20/2026
2.16.0 116 10/19/2026
2.15.0 107 10/19/2026
2.14.0 122 10/13/2026
2.13.0 104 10/13/2026
2.12.0 119 10/9/2026
2.11.0 1,261 10/7/2026
Loading failed