Skip to content

feat(memory): add optional Milvus vector backend - #3041

Open
dajiaohuang wants to merge 1 commit into
zhayujie:masterfrom
dajiaohuang:feat/2956-milvus-vector-backend
Open

feat(memory): add optional Milvus vector backend#3041
dajiaohuang wants to merge 1 commit into
zhayujie:masterfrom
dajiaohuang:feat/2956-milvus-vector-backend

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds the optional Milvus follow-up requested in #2956 after the VectorBackend abstraction landed in #3021.

  • Adds a lazy-imported MilvusVectorBackend for Milvus Lite, Milvus Server, and Zilliz Cloud, with an explicit schema, COSINE/AUTOINDEX search, workspace isolation, metadata filters, collection validation, and embedding-dimension checks.
  • Keeps SQLite as the zero-dependency authoritative store and keeps FTS5 unchanged. A versioned durable outbox backfills existing SQLite vectors, retries idempotent writes/deletes, avoids losing concurrent updates, and falls back to SQLite until Milvus is healthy and fully synchronized.
  • Adds milvus and milvus-lite optional extras plus runtime configuration, token/URI log redaction, rebuild preflight/repopulation, backend health status, and English/Chinese/Japanese documentation.
  • Preserves CowAgent's core requires-python >=3.7; the optional server extra requires Python 3.9+, while current Milvus Lite requires Python 3.10+.

Type of change

  • Bug fix
  • New feature
  • Docs
  • Refactor / chore

Testing

  • pip install -e .[milvus-lite] in an isolated environment, followed by the focused backend, real Milvus Lite, and rebuild suites: 17 passed.
  • Focused unit/config/security suite: 35 passed.
  • Memory/knowledge/search regression matrix: 139 passed, 1 skipped, 14 failed. The same command on a clean origin/master worktree produced 127 passed, 14 failed; all 14 failures are pre-existing Windows/environment issues (symlink privileges, path separators, ripgrep CJK output, missing web.py) or existing workspace/recovery failures.
  • python -m compileall -q agent bridge tests
  • Ruff on the changed memory/backend/test modules
  • git diff --check origin/master...HEAD

Checklist

Closes #2956

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.

Proposal: pluggable memory vector backend and optional Milvus support

1 participant