feat(vector-store): add optional Milvus backend#780
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for Milvus (including Milvus Lite) as an alternative semantic vector store backend alongside Qdrant. It introduces a common VectorStore protocol, implements MilvusVectorStore, updates configuration and dependency management, and adds corresponding tests and documentation. The review feedback highlights three key improvements: making the milvus-lite version check more robust, adding a guard to prevent a potential IndexError when processing empty search results, and skipping a Milvus-specific test when the optional pymilvus dependency is not installed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Synced this branch with upstream/main at f381c55 and resolved the uv.lock conflict while preserving both the upstream dependency updates and the Milvus optional dependency. Local checks:
The PR is mergeable again. The full type-check job remains delegated to CI because the local base environment does not include the complete semantic extra. |
Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
a2ff1c6 to
87c1c2f
Compare
|
Maintainer update: merged current main into the branch (regenerated uv.lock for the auto version bumps) and made the optional backend imports ty-clean, since the type check would have failed CI (cast(Any, None) fallbacks so the guarded call sites pass while the module-level bindings your tests patch stay intact). Also approved the workflow runs, so CI is now actually running on this PR. |
|
@greptile review |
|
@greptile review |
|
On the type-safety note in the review summary: the Any/cast fallbacks at the optional-import boundary are deliberate. The alternatives each break something real: None fallbacks with ignore markers fail the repo's ty hook at every guarded call site (call-non-callable), and moving the imports inside the functions would break the test suite's module-attribute patching (patch("codebase_rag.vector_store.QdrantClient")). The call sites are runtime-guarded by has_qdrant_client/has_pymilvus gates in _get_vector_store and the client constructors, so the untyped window is confined to the two conditional import blocks. Leaving as is. |
…tic installs stay lean
|
Second maintainer update per review discussion: pymilvus[milvus-lite] moved out of the shared semantic extra into a dedicated milvus extra, so Qdrant users no longer download the embedded server. Docs and CI installs updated accordingly (install with code-graph-rag[semantic,milvus] for the Milvus backend). |
|
@greptile review |
Summary
pymilvusMilvusClientwith explicit schema creation, upsert, delete, verify, and search support.Closes #758
Testing
uv run --with ruff ruff check codebase_rag/vector_store.py codebase_rag/utils/dependencies.py codebase_rag/tests/test_vector_store.py codebase_rag/tests/test_vector_store_batch.py codebase_rag/tests/conftest.py codebase_rag/config.py codebase_rag/constants/providers.py codebase_rag/logs.py codebase_rag/mcp/server.pyuv run --with ruff ruff format --check codebase_rag/vector_store.py codebase_rag/utils/dependencies.py codebase_rag/tests/test_vector_store.py codebase_rag/tests/test_vector_store_batch.py codebase_rag/tests/conftest.py codebase_rag/config.py codebase_rag/constants/providers.py codebase_rag/logs.py codebase_rag/mcp/server.pyuv run --with 'qdrant-client>=1.9.0' --with 'pymilvus[milvus-lite]>=3.0.0' --extra test pytest codebase_rag/tests/test_vector_store.py codebase_rag/tests/test_vector_store_batch.pyuv run --with 'qdrant-client>=1.9.0' --with 'pymilvus[milvus-lite]>=3.0.0' --extra test pytest codebase_rag/tests/test_graph_updater_embeddings.py codebase_rag/tests/test_mcp_server.py