Skip to content

Add optional Milvus vector store - #1345

Open
zc277584121 wants to merge 1 commit into
Future-House:mainfrom
zc277584121:feat/milvus-vector-store
Open

Add optional Milvus vector store#1345
zc277584121 wants to merge 1 commit into
Future-House:mainfrom
zc277584121:feat/milvus-vector-store

Conversation

@zc277584121

Copy link
Copy Markdown

Summary

  • add an optional MilvusVectorStore backed by pymilvus.MilvusClient
  • support a Milvus Lite file by default and remote Milvus or Zilliz Cloud through URI and token configuration
  • preserve the existing vector-store contract for payload reconstruction, hashes, clear and copy behavior, COSINE scores, async calls, and inherited MMR
  • add explicit schema validation with a COSINE AUTOINDEX and a compatibility guard for the Milvus Lite 3.0 score regression
  • add the milvus optional dependency, lockfile entries, shared provider tests, and README usage examples

Compatibility

The default NumpyVectorStore behavior is unchanged. Importing PaperQA without the optional dependency continues to work, while constructing MilvusVectorStore without it raises an installation-focused error.

Testing

  • provider and Milvus Lite tests on Python 3.11: 8 passed
  • provider and Milvus Lite tests on Python 3.13: 8 passed
  • live embedding and Milvus Lite retrieval smoke test
  • changed-file pre-commit hooks
  • Ruff, Black, mypy, pylint, and refurb checks
  • package build and lockfile validation

Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
Copilot AI review requested due to automatic review settings July 23, 2026 01:07
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new optional Milvus-backed vector store implementation to PaperQA while keeping the default in-memory vector store behavior unchanged and preserving the existing vector-store contract.

Changes:

  • Introduces MilvusVectorStore implemented on top of pymilvus.MilvusClient, including schema/index validation and a Milvus Lite 3.0 score-normalization guard.
  • Adds shared vector-store conformance tests plus Milvus-specific tests (schema, copy semantics, dependency error path, and Docs integration).
  • Wires up the optional milvus extra (plus lockfile updates) and documents usage in the README.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
uv.lock Adds Milvus-related dependencies (and lockfile refresh) to support the new optional extra.
tests/test_vector_stores.py Adds provider-style conformance coverage across Numpy/Qdrant/Milvus plus Milvus-specific behavior tests.
src/paperqa/llms.py Implements MilvusVectorStore, including collection/schema/index management and search behavior.
src/paperqa/__init__.py Exposes MilvusVectorStore in the package public API.
README.md Documents how to install and use Milvus (Lite and remote) as a vector store.
pyproject.toml Adds the milvus optional dependency extra and includes it in the dev extra set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants