ChromaDotNet.VectorData
0.1.2
Prefix Reserved
See the version list below for details.
dotnet add package ChromaDotNet.VectorData --version 0.1.2
NuGet\Install-Package ChromaDotNet.VectorData -Version 0.1.2
<PackageReference Include="ChromaDotNet.VectorData" Version="0.1.2" />
<PackageVersion Include="ChromaDotNet.VectorData" Version="0.1.2" />
<PackageReference Include="ChromaDotNet.VectorData" />
paket add ChromaDotNet.VectorData --version 0.1.2
#r "nuget: ChromaDotNet.VectorData, 0.1.2"
#:package ChromaDotNet.VectorData@0.1.2
#addin nuget:?package=ChromaDotNet.VectorData&version=0.1.2
#tool nuget:?package=ChromaDotNet.VectorData&version=0.1.2
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
- Run Chroma with Docker:
docker run -d --name chroma -p 8000:8000 chromadb/chroma
- Install the NuGet package:
dotnet add package ChromaDotNet.VectorData
- 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:
services.AddChromaVectorStore("http://localhost:8000");
Supported
- Keys:
stringandGuid. - One vector per record:
ReadOnlyMemory<float>,Embedding<float>orfloat[], 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,EuclideanDistanceandEuclideanSquaredDistance, 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,&&,||,!,Containsover an inline list or an array property, andAnywithContainsover an inline list. - Filters on the key:
==andContainsover a list of keys, joined to the other conditions with&&; Chroma looks the records up by id. - NativeAOT and trimming: the dynamic collection, from
GetDynamicCollectionwith aVectorStoreCollectionDefinition, 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.
GetAsyncwith 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, so
IsFullTextIndexedis accepted and has no effect.
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 | Versions 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. |
-
.NETFramework 4.6.2
- ChromaDotNet.Client (>= 2.6.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.10.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.10.0)
- System.Linq.AsyncEnumerable (>= 10.0.12)
- System.Text.Json (>= 10.0.12)
-
.NETStandard 2.0
- ChromaDotNet.Client (>= 2.6.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.10.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.10.0)
- System.Linq.AsyncEnumerable (>= 10.0.12)
- System.Text.Json (>= 10.0.12)
-
net10.0
- ChromaDotNet.Client (>= 2.6.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.10.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.10.0)
-
net8.0
- ChromaDotNet.Client (>= 2.6.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.10.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.10.0)
- System.Linq.AsyncEnumerable (>= 10.0.12)
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.4.2 | 0 | 10/7/2026 |