Skip to content

Add BotSharp.Plugin.Chroma vector database plugin - #1457

Open
Laurianti wants to merge 2 commits into
SciSharp:masterfrom
Laurianti:add-chroma-plugin
Open

Laurianti wants to merge 2 commits into
SciSharp:masterfrom
Laurianti:add-chroma-plugin

Conversation

@Laurianti

@Laurianti Laurianti commented Oct 15, 2026 •

Copy link
Copy Markdown

Adds a vector database plugin for Chroma, following the same structure as the existing Qdrant plugin: ChromaDb implements IVectorDb on top of ChromaDotNet.Client, with the URL, API key, tenant and database configured through ChromaSetting and a Chroma sample block in appsettings.json. It works with a local Chroma server and with Chroma Cloud, where the API key gives the tenant and the database. Also wired into BotSharp.sln, WebStarter and Directory.Packages.props.

  • Collections use the cosine space, and the search score is the cosine similarity, as with Qdrant, so Confidence keeps its meaning.
  • The text is the document of the record, and comes back as the text payload; the other payload values are its metadata, with the same type conversions as the Qdrant plugin. A match on text is an exact match on the document, with an anchored regular expression.
  • Chroma pages by offset: NextId is the offset of the next page.
  • Chroma indexes every metadata key by default, so CreateCollectionPayloadIndex returns true for a collection that exists, and DeleteCollectionPayloadIndex returns false. Chroma has no snapshots: the snapshot methods return nothing, null or false.
  • Not supported by Chroma: OrderBy of the paged data. Range filters on datetime values, which are stored as text, and a match on text joined by or to another field throw a NotSupportedException, instead of returning records outside the filter.

Checked every IVectorDb method against Chroma 1.5.9 in Docker and against Chroma Cloud: create, exists, list, details, upsert, search with match, range, and and or filters, confidence and fields, paging, get by id, delete and delete all. dotnet build ./BotSharp.sln -c Release and the two test projects of the build workflow pass.

ChromaDotNet.Client is also used by the AI Community Toolkit (CommunityToolkit.VectorData.Chroma) and by the Chroma integrations of the Aspire Community Toolkit. Through CommunityToolkit.VectorData.Chroma, it is also used by the Microsoft course Generative AI for Beginners .NET and by LangChain .NET. Semantic Kernel recommends CommunityToolkit.VectorData.Chroma for Chroma in .NET, and Microsoft Agent Framework lists it among its .NET community projects.

Disclosure: I maintain ChromaDotNet.Client.

Chroma is an open-source search and retrieval database. This plugin
follows the same shape as BotSharp.Plugin.Qdrant: an IVectorDb on top
of ChromaDotNet.Client, with the URL, API key, tenant and database
configured via ChromaSetting, for a local Chroma server and for
Chroma Cloud.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 14:47
@qodo-code-review

qodo-code-review Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Add Chroma vector database plugin

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add Chroma as an IVectorDb provider for local servers and Chroma Cloud.
• Support collection management, vector search, filters, paging, and payload mapping while
 preserving cosine-based confidence scores.
• Register the plugin and document configuration; Chroma does not support snapshots or the requested
 paging sort.
Diagram

graph TD
  WebStarter["WebStarter"] --> Plugin["Chroma plugin"] --> Interface["IVectorDb"] --> Adapter["ChromaDb adapter"] --> SDK["ChromaDotNet client"] --> Server["Chroma server"]
  Settings["Chroma settings"] --> Adapter
Loading
High-Level Assessment

The provider-specific adapter follows the existing Qdrant plugin pattern and keeps Chroma behavior behind IVectorDb. Direct HTTP integration was considered but would duplicate client functionality without a clear architectural benefit.

Files changed (9) +683 / -0

Enhancement (4) +634 / -0
BotSharp.Plugin.Chroma.csprojDefine the Chroma plugin project +20/-0

Define the Chroma plugin project

• Creates the plugin project with references to ChromaDotNet.Client and BotSharp.Abstraction, using the repository's package-build settings.

src/Plugins/BotSharp.Plugin.Chroma/BotSharp.Plugin.Chroma.csproj

ChromaDb.csImplement Chroma vector storage +580/-0

Implement Chroma vector storage

• Implements IVectorDb collection and record operations, cosine-scored search, filters, offset paging, and payload conversion through ChromaDotNet.Client. Returns unsupported results for snapshot and index-deletion operations; paging does not apply OrderBy, and datetime range filtering is unavailable.

src/Plugins/BotSharp.Plugin.Chroma/ChromaDb.cs

ChromaPlugin.csRegister the Chroma provider +24/-0

Register the Chroma provider

• Adds plugin identity and dependency-injection registration for ChromaSetting and ChromaDb.

src/Plugins/BotSharp.Plugin.Chroma/ChromaPlugin.cs

Using.csShare plugin imports +10/-0

Share plugin imports

• Adds global imports for vector storage, knowledge models, and common .NET types used by the plugin.

src/Plugins/BotSharp.Plugin.Chroma/Using.cs

Other (5) +49 / -0
BotSharp.slnInclude Chroma in solution builds +15/-0

Include Chroma in solution builds

• Adds the Chroma project under VectorStores and configures its solution build targets.

BotSharp.sln

Directory.Packages.propsPin ChromaDotNet.Client version +1/-0

Pin ChromaDotNet.Client version

• Adds a centrally managed ChromaDotNet.Client 2.14.0 dependency.

Directory.Packages.props

ChromaSetting.csDefine Chroma connection settings +24/-0

Define Chroma connection settings

• Defines URL, API key, tenant, and database settings for local servers and Chroma Cloud.

src/Plugins/BotSharp.Plugin.Chroma/ChromaSetting.cs

WebStarter.csprojReference Chroma from WebStarter +1/-0

Reference Chroma from WebStarter

• Adds the Chroma plugin project reference so WebStarter can load the provider.

src/WebStarter/WebStarter.csproj

appsettings.jsonExpose and enable Chroma configuration +8/-0

Expose and enable Chroma configuration

• Adds a Chroma settings block and includes the plugin in WebStarter's enabled plugin list.

src/WebStarter/appsettings.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Filter correctness, concurrent payload replacement, and HTTP client registration remain unresolved.

4 open findings
What changed in this PR

Adds Chroma as an IVectorDb provider for local and cloud deployments.

Changes:

  • Implements collection operations, cosine search, payload mapping, filtering, and paging.
  • Adds plugin registration and connection settings.
  • Integrates the plugin into WebStarter, the solution, and central package management.
File Description
src/​WebStarter/​WebStarter.csproj References the Chroma plugin.
src/​WebStarter/​appsettings.json Adds Chroma settings and plugin entry.
src/​Plugins/​BotSharp.Plugin.Chroma/​Using.cs Defines shared imports.
src/​Plugins/​BotSharp.Plugin.Chroma/​ChromaSetting.cs Defines connection settings.
src/​Plugins/​BotSharp.Plugin.Chroma/​ChromaPlugin.cs Registers settings and provider.
src/​Plugins/​BotSharp.Plugin.Chroma/​ChromaDb.cs Implements the vector database adapter.
src/​Plugins/​BotSharp.Plugin.Chroma/​BotSharp.Plugin.Chroma.csproj Defines the plugin project and dependencies.
Directory.Packages.props Pins ChromaDotNet.Client.
BotSharp.sln Adds project and build configurations.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Plugins/BotSharp.Plugin.Chroma/ChromaDb.cs
Comment thread src/Plugins/BotSharp.Plugin.Chroma/ChromaDb.cs Outdated
Comment thread src/Plugins/BotSharp.Plugin.Chroma/ChromaDb.cs Outdated
Comment thread src/Plugins/BotSharp.Plugin.Chroma/ChromaPlugin.cs
…ect what Chroma cannot filter

The plugin registers IHttpClientFactory, which ChromaDb takes its
HttpClient from. A filter on text matches the document exactly, with an
anchored regular expression. A range on values other than numbers, an
empty text, and text in an OR with another field throw a
NotSupportedException instead of leaving the filter out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants