Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Client reference leaks, non-idempotent disposal, and incorrect nullable-filter negation can cause resource and query failures.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Adds the Chroma MEVD provider, including mapping, filtering, vector/hybrid search, dependency injection, and test infrastructure.
Changes:
- Implements the Chroma vector store and collection APIs.
- Adds unit and container-based conformance tests.
- Integrates Chroma into dependencies, solutions, and documentation.
| File | Description |
|---|---|
README.md |
Lists the Chroma package. |
MEVD/test/Chroma.UnitTests/FakeEmbeddingGenerator.cs |
Adds a test embedding generator. |
MEVD/test/Chroma.UnitTests/ChromaVectorStoreTests.cs |
Tests vector-store behavior. |
MEVD/test/Chroma.UnitTests/ChromaMapperTests.cs |
Tests record mapping. |
MEVD/test/Chroma.UnitTests/ChromaHotel.cs |
Defines unit-test models. |
MEVD/test/Chroma.UnitTests/ChromaFilterTranslatorTests.cs |
Tests filter translation. |
MEVD/test/Chroma.UnitTests/ChromaCollectionTests.cs |
Tests collection operations. |
MEVD/test/Chroma.UnitTests/ChromaCollectionSearchMappingTests.cs |
Tests score conversion. |
MEVD/test/Chroma.UnitTests/ChromaCollectionCreateMappingTests.cs |
Tests collection definitions. |
MEVD/test/Chroma.UnitTests/Chroma.UnitTests.csproj |
Configures unit tests. |
MEVD/test/Chroma.UnitTests/.editorconfig |
Configures test analyzers. |
MEVD/test/Chroma.ConformanceTests/TypeTests/ChromaKeyTypeTests.cs |
Covers supported keys. |
MEVD/test/Chroma.ConformanceTests/TypeTests/ChromaEmbeddingTypeTests.cs |
Covers embedding types. |
MEVD/test/Chroma.ConformanceTests/TypeTests/ChromaDataTypeTests.cs |
Covers metadata types. |
MEVD/test/Chroma.ConformanceTests/testsettings.json |
Provides test configuration. |
MEVD/test/Chroma.ConformanceTests/Support/ChromaTestStore.cs |
Manages Chroma test instances. |
MEVD/test/Chroma.ConformanceTests/Support/ChromaTestEnvironment.cs |
Loads test settings. |
MEVD/test/Chroma.ConformanceTests/Support/ChromaFixture.cs |
Defines the shared fixture. |
MEVD/test/Chroma.ConformanceTests/README.md |
Documents conformance testing. |
MEVD/test/Chroma.ConformanceTests/ModelTests/ChromaNoDataModelTests.cs |
Tests no-data models. |
MEVD/test/Chroma.ConformanceTests/ModelTests/ChromaDynamicModelTests.cs |
Tests dynamic models. |
MEVD/test/Chroma.ConformanceTests/ModelTests/ChromaBasicModelTests.cs |
Tests basic models. |
MEVD/test/Chroma.ConformanceTests/ChromaTestSuiteImplementationTests.cs |
Verifies suite coverage. |
MEVD/test/Chroma.ConformanceTests/ChromaIndexKindTests.cs |
Tests index support. |
MEVD/test/Chroma.ConformanceTests/ChromaHybridSearchTests.cs |
Tests cloud hybrid search. |
MEVD/test/Chroma.ConformanceTests/ChromaFilterTests.cs |
Tests filtering behavior. |
MEVD/test/Chroma.ConformanceTests/ChromaEmbeddingGenerationTests.cs |
Tests generated embeddings. |
MEVD/test/Chroma.ConformanceTests/ChromaDistanceFunctionTests.cs |
Tests distance functions. |
MEVD/test/Chroma.ConformanceTests/ChromaDependencyInjectionTests.cs |
Tests DI registrations. |
MEVD/test/Chroma.ConformanceTests/ChromaCollectionManagementTests.cs |
Tests collection management. |
MEVD/test/Chroma.ConformanceTests/Chroma.ConformanceTests.csproj |
Configures conformance tests. |
MEVD/src/Chroma/SharedChromaClient.cs |
Adds shared-client ownership. |
MEVD/src/Chroma/README.md |
Documents the provider. |
MEVD/src/Chroma/ChromaVectorStoreOptions.cs |
Defines store options. |
MEVD/src/Chroma/ChromaVectorStore.cs |
Implements the vector store. |
MEVD/src/Chroma/ChromaServiceCollectionExtensions.cs |
Adds DI extensions. |
MEVD/src/Chroma/ChromaModelBuilder.cs |
Validates collection models. |
MEVD/src/Chroma/ChromaMapper.cs |
Maps records and metadata. |
MEVD/src/Chroma/ChromaFilterTranslator.cs |
Translates LINQ filters. |
MEVD/src/Chroma/ChromaFieldMapping.cs |
Maps keys and documents. |
MEVD/src/Chroma/ChromaDynamicCollection.cs |
Adds dynamic collections. |
MEVD/src/Chroma/ChromaConstants.cs |
Defines provider constants. |
MEVD/src/Chroma/ChromaCollectionSearchMapping.cs |
Maps distances and thresholds. |
MEVD/src/Chroma/ChromaCollectionOptions.cs |
Defines collection options. |
MEVD/src/Chroma/ChromaCollectionCreateMapping.cs |
Maps collection schemas. |
MEVD/src/Chroma/ChromaCollection.cs |
Implements CRUD and search. |
MEVD/src/Chroma/Chroma.csproj |
Configures the provider package. |
MEVD/src/Chroma/AssemblyInfo.cs |
Adds assembly licensing. |
MEVD/MEVD.slnf |
Includes Chroma projects. |
Directory.Packages.props |
Adds the Chroma client version. |
CommunityToolkit.AI.slnx |
Includes Chroma projects. |
.gitignore |
Ignores local test settings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… does The NativeAOT compiler of .NET 10.0.12 fails on the state machine of the handler when RunOperationAsync returns its task: "VTable ... not computed by the IL scanner".
…omparisons on nullable properties, as CommunityToolkit/AI#58 does
The README says where the provider goes next, CommunityToolkit/AI#58, and what happens to this package then.
5df429a to
db6101b
Compare
…t 300 results, as CommunityToolkit/AI#58 does
298b46e to
3085a49
Compare
| protected override void ValidateProperty(PropertyModel propertyModel, VectorStoreCollectionDefinition? definition) | ||
| { | ||
| base.ValidateProperty(propertyModel, definition); | ||
|
|
||
| switch (propertyModel) |
adamsitnik
left a comment
There was a problem hiding this comment.
First of all, big thanks for your contribution @Laurianti
The provider follows established conventions closely enough that I consider this ready to merge. I found two nits myself and used LLM to find one minor bug. As soon as they are addressed, we should be ready to ship.
Again, thank you!
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <Version>1.0.0-preview.1</Version> |
There was a problem hiding this comment.
nit: for other projects, like Sqlvec, we use X.Y.Z-preview version number:
| <Version>1.0.0-preview.1</Version> | |
| <Version>1.0.0-preview</Version> |
It allows us to release small patches without bumping preview version number.
| var recordIndex = 0; | ||
| foreach (var record in records) | ||
| { | ||
| if (keyProperty.IsAutoGenerated && keyProperty.GetValue<Guid>(record) == Guid.Empty) |
There was a problem hiding this comment.
Chroma (unlike Qdrant) supports string keys, and ChromaModelBuilder.ValidateKeyProperty doesn't reject IsAutoGenerated=true on a string key. So we can get InvalidCastException here.
A fix would be to add similar check to ChromaModelBuilder
AI/MEVD/src/InMemory/InMemoryModelBuilder.cs
Lines 24 to 29 in c3ed414
There was a problem hiding this comment.
Done in 7791e1c: ChromaModelBuilder now rejects IsAutoGenerated on a string key, as InMemoryModelBuilder does.
There was a problem hiding this comment.
nit: we could reuse MEVD/test/InMemory.UnitTests/FakeEmbeddingGenerator.cs instead of adding new utility here
There was a problem hiding this comment.
Done in e74ad96: the tests use the one in InMemory.UnitTests.
|
Thanks @adamsitnik! The three points are addressed, one commit each. |



Adds
CommunityToolkit.VectorData.Chroma, the Chroma provider proposed in #57, withMEVD/test/Chroma.UnitTestsandMEVD/test/Chroma.ConformanceTests. It follows the layout of the Qdrant provider, and builds on ChromaDotNet.Client as Qdrant builds on Qdrant.Client. I maintain ChromaDotNet.Client.The conformance tests start
chromadb/chroma:1.5.9with Testcontainers, so themevd.ymlmatrix picks them up. Chroma stores exactly one embedding per record, so there are no multi-vector and no-vector model tests. The hybrid search tests need Chroma Cloud: they run whenChroma:ConnectionStringpoints to it, as the README of the tests says, and are skipped otherwise.The same code, published as ChromaDotNet.VectorData 0.4.2, runs the Semantic Kernel and Agent Framework samples, and the Semantic Kernel hybrid search sample runs on Chroma Cloud.
The container is written in the tests, as for Weaviate. When Testcontainers.Chroma ships (testcontainers/testcontainers-dotnet#1784), it can replace it.
With the Aspire integration proposed in CommunityToolkit/Aspire#2219,
builder.AddChromaClient("chroma")registers theChromaClientthatAddChromaVectorStore()takes from the container.tryAGI/LangChain.Databases#180 adds Chroma to the tests of LangChain .NET with the same provider, and moves to this package when it ships.
.gitignoregetstestsettings.*.json: the conformance tests READMEs, the PgVector one included, describetestsettings.development.jsonas git-ignored.Fixes #57