ChromaDotNet.VectorData 0.2.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package ChromaDotNet.VectorData --version 0.2.0
                    
NuGet\Install-Package ChromaDotNet.VectorData -Version 0.2.0
                    
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.VectorData" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChromaDotNet.VectorData" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="ChromaDotNet.VectorData" />
                    
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.VectorData --version 0.2.0
                    
#r "nuget: ChromaDotNet.VectorData, 0.2.0"
                    
#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 ChromaDotNet.VectorData@0.2.0
                    
#: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.VectorData&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=ChromaDotNet.VectorData&version=0.2.0
                    
Install as a Cake Tool

ChromaDotNet.VectorData

Chroma provider for Microsoft.Extensions.VectorData, built on ChromaDotNet.Client.

This is a community project. It is not affiliated with or endorsed by Chroma.

Quick start

  1. Run Chroma with Docker:
docker run -d --name chroma -p 8000:8000 chromadb/chroma
  1. Install the NuGet package:
dotnet add package ChromaDotNet.VectorData
  1. Store and search records:
using ChromaDB.Client;
using ChromaDB.VectorData;
using Microsoft.Extensions.VectorData;

using var httpClient = new HttpClient();
using var vectorStore = new ChromaVectorStore(new ChromaClient(new ChromaConfigurationOptions("http://localhost:8000"), httpClient));

var collection = vectorStore.GetCollection<string, Hotel>("hotels");
await collection.EnsureCollectionExistsAsync();

await collection.UpsertAsync(new Hotel { Id = "h1", Name = "Grand", Rating = 5, Embedding = new float[] { 0.1f, 0.2f, 0.3f, 0.4f } });

await foreach (var result in collection.SearchAsync(new float[] { 0.1f, 0.2f, 0.3f, 0.4f }, top: 3, new() { Filter = h => h.Rating >= 4 }))
{
    Console.WriteLine($"{result.Record.Name}: {result.Score}");
}

public sealed class Hotel
{
    [VectorStoreKey]
    public string Id { get; set; } = "";

    [VectorStoreData]
    public string? Name { get; set; }

    [VectorStoreData]
    public int Rating { get; set; }

    [VectorStoreVector(4)]
    public ReadOnlyMemory<float> Embedding { get; set; }
}

With dependency injection, the vector store takes the ChromaClient of the container, like the singleton that ChromaDotNet.Client.DependencyInjection registers with an HttpClient from IHttpClientFactory:

services.AddChromaClient(_ => new ChromaConfigurationOptions("http://localhost:8000"));
services.AddChromaVectorStore();

Or it creates its own client, from a URI or from the options of the client, like those of Chroma Cloud:

services.AddChromaVectorStore("http://localhost:8000");

services.AddChromaVectorStore(new ChromaConfigurationOptions("https://api.trychroma.com", defaultTenant: "<tenant>", defaultDatabase: "<database>")
    .WithChromaToken("<api key>")
    .WithBatchSplitting(maxBatchSize: 300));

Chroma Cloud

Connect with the options of the client: the API key goes in the X-Chroma-Token header, with the tenant and the database of the Chroma Cloud dashboard. Chroma Cloud reads and writes at most 300 records per request: with WithBatchSplitting(maxBatchSize: 300), the client writes in batches of 300 and the provider reads in pages of 300. A search returns at most 300 results, top plus Skip included.

Supported

  • Keys: string and Guid.
  • One vector per record: ReadOnlyMemory<float>, Embedding<float> or float[], or any type with an embedding generator.
  • Data properties: string, int, long, double, float, bool, DateTime, DateTimeOffset, DateOnly, and arrays or lists of these, stored as Chroma metadata; dates are stored as ISO 8601 strings.
  • Distance functions: CosineSimilarity (the default), CosineDistance, DotProductSimilarity, NegativeDotProductSimilarity, EuclideanDistance and EuclideanSquaredDistance, with the HNSW index.
  • An existing collection must use the space of the distance function, as a collection created by another Chroma client without a space uses l2: otherwise the provider throws, rather than turning the distances of another space into scores.
  • Filters: == and !=, <, <=, > and >= on numbers, &&, ||, !, Contains over an inline list or an array property, and Any with Contains over an inline list.
  • Filters on the key: == and Contains over a list of keys, joined to the other conditions with &&; Chroma looks the records up by id.
  • Full-text: the only full-text indexed string property is also stored as the Chroma document, where other Chroma clients store their text. Contains on it filters the text with where_document, joined to the other conditions with &&, and a record that has its text in the document only reads it into that property.
  • NativeAOT and trimming: the dynamic collection, from GetDynamicCollection with a VectorStoreCollectionDefinition, works without reflection; ChromaCollection<TKey, TRecord> maps the properties of the record type by reflection.

Limitations

  • Chroma metadata has no null values: a null property is not stored, and filtering on null is not supported.
  • Chroma does not store empty lists: an empty array or list is not stored, and comes back as null.
  • GetAsync with a filter does not support ordering.
  • Comparisons work on numbers only.
  • Array properties need Chroma 1.5.0 or later.
  • Hybrid search is not supported.
  • Only one property can be the document: with more full-text indexed string properties, none is.

The provider runs the Microsoft.Extensions.VectorData conformance tests against Chroma 1.5.0, 1.5.9 and the latest release, and passes them on Chroma Cloud.

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 is compatible.  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 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.4 0 10/5/2026
0.3.3 0 10/5/2026
0.3.2 0 10/5/2026
0.3.1 0 10/5/2026
0.3.0 6 10/5/2026
0.2.0 47 10/4/2026
0.1.2 41 10/4/2026
0.1.0 48 10/4/2026