Skip to content

feat(vector_store)!: replace ChromaDB with Milvus Lite - #154

Merged
jakub-walaszczyk merged 1 commit into
mainfrom
feat/replace-chromadb-with-milvus-lite
Sep 11, 2026
Merged

jakub-walaszczyk merged 1 commit into
mainfrom
feat/replace-chromadb-with-milvus-lite

Conversation

@jakub-walaszczyk

@jakub-walaszczyk jakub-walaszczyk commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Remove the ChromaDB backend entirely (its chromadb dependency carried a large vulnerability surface) and adopt Milvus Lite as the local, zero-server vector store. Milvus Lite is the embedded mode of the existing Milvus backend, so it reuses MilvusVectorStore and supports hybrid (dense + BM25) search that Chroma never had.

  • Split the Milvus config in two, both served by MilvusVectorStore:
    • MilvusConfig (provider "milvus") is now remote-server-only and validates that uri is an http(s):// URL, so a mistyped MILVUS_URI fails loudly instead of silently spinning up a throwaway local database in production.
    • MilvusLiteConfig (provider "milvus_lite") is the explicit embedded engine, configured by a local db_path (env MILVUS_LITE_DB_PATH).
  • Add temporary_milvus_lite_store, a throwaway-store context manager (temp dir + auto cleanup) now backing model pre-selection and judge calibration, which previously relied on ephemeral in-memory Chroma.
  • Remove all Chroma vector-only special-casing: hybrid search and the full hybrid search space now apply to every backend; vector_store_type is validated against "milvus", "milvus_lite", and "pgvector".
  • Swap the dependency chromadb -> pymilvus[milvus-lite] and delete the now-obsolete ensure_sqlite3 ChromaDB compatibility shim.
  • Update tests (real embedded Milvus Lite in the unit tier, plus integration and functional concurrent-query tests) and all documentation accordingly.

BREAKING CHANGE: ChromaConfig, ChromaVectorStore, and the "chroma" vector store provider are removed, along with the chromadb dependency. MilvusConfig no longer accepts a local file path as its uri (it must be an http(s):// server URL); use MilvusLiteConfig(db_path=...) for an embedded local database.

Assisted-by: Claude Code

Relates to: #153
Resolves:

Description

Brief summary of changes

Motivation

Why is this change needed?

Changes

  • Bullet point list of changes
  • Another change

Testing

How did you test this?

Checklist

  • Tests added/updated
  • Documentation updated
  • Code follows style guide
  • All checks passing

@Mateusz-Switala Mateusz-Switala left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm

Remove the ChromaDB backend entirely (its `chromadb` dependency carried a
large vulnerability surface) and adopt Milvus Lite as the local, zero-server
vector store. Milvus Lite is the embedded mode of the existing Milvus backend,
so it reuses `MilvusVectorStore` and supports hybrid (dense + BM25) search
that Chroma never had.

- Split the Milvus config in two, both served by `MilvusVectorStore`:
  - `MilvusConfig` (provider "milvus") is now remote-server-only and
    validates that `uri` is an `http(s)://` URL, so a mistyped `MILVUS_URI`
    fails loudly instead of silently spinning up a throwaway local database
    in production.
  - `MilvusLiteConfig` (provider "milvus_lite") is the explicit embedded
    engine, configured by a local `db_path` (env `MILVUS_LITE_DB_PATH`). A
    shared `_is_server_url` guard keeps the two validations from drifting
    apart, and a blank/whitespace `db_path` is rejected up front instead of
    surfacing as an opaque pymilvus error.
- Add `temporary_milvus_lite_store`, a throwaway-store context manager (temp
  dir + auto cleanup via `TemporaryDirectory`, logging rather than raising on
  a `close()` failure) now backing model pre-selection and judge calibration,
  which previously relied on ephemeral in-memory Chroma.
- Remove all Chroma vector-only special-casing: hybrid search and the full
  hybrid search space now apply to every backend; `vector_store_type` is
  validated against "milvus", "milvus_lite", and "pgvector" via a single
  `SUPPORTED_PROVIDERS` list shared between the vector store config and the
  default search space.
- Drop the now-unused `vector_store_type` parameter from `AI4RAGSearchSpace`,
  `prepare_search_space_with_maas`, and
  `get_default_ai4rag_search_space_parameters` - it never varied the
  generated search space, only validated against `SUPPORTED_PROVIDERS`,
  which every remaining backend now supports identically.
- Swap the dependency `chromadb` -> `pymilvus[milvus-lite]` and delete the
  now-obsolete `ensure_sqlite3` ChromaDB compatibility shim.
- Align `VectorStoreSettings` fields (`provider_type`/`collection_name`) with
  the payload the event handler actually emits.
- Update tests (real embedded Milvus Lite in the unit tier, plus integration
  and functional concurrent-query tests) and all documentation accordingly.

BREAKING CHANGE: `ChromaConfig`, `ChromaVectorStore`, and the "chroma" vector
store provider are removed, along with the `chromadb` dependency.
`MilvusConfig` no longer accepts a local file path as its `uri` (it must be
an `http(s)://` server URL); use `MilvusLiteConfig(db_path=...)` for an
embedded local database. The `vector_store_type` argument is also removed
from `AI4RAGSearchSpace.__init__`, `prepare_search_space_with_maas`, and
`get_default_ai4rag_search_space_parameters`.

Signed-off-by: Jakub Walaszczyk <jwalaszc@redhat.com>
Assisted-by: Claude Code
@jakub-walaszczyk
jakub-walaszczyk force-pushed the feat/replace-chromadb-with-milvus-lite branch from 0a49fef to b7406b2 Compare September 11, 2026 14:18
@jakub-walaszczyk
jakub-walaszczyk merged commit 7562d74 into main Sep 11, 2026
4 checks passed
@jakub-walaszczyk
jakub-walaszczyk deleted the feat/replace-chromadb-with-milvus-lite branch September 11, 2026 20:23
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