Skip to content

feat: add Milvus memory service#167

Open
zc277584121 wants to merge 4 commits into
google:mainfrom
zc277584121:feat/milvus-memory-service
Open

feat: add Milvus memory service#167
zc277584121 wants to merge 4 commits into
google:mainfrom
zc277584121:feat/milvus-memory-service

Conversation

@zc277584121

Copy link
Copy Markdown

Summary

  • Add MilvusMemoryService, a BaseMemoryService implementation backed by Milvus.
  • Support session/event ingestion, direct memory writes, stable record IDs, scoped vector search by app_name and user_id, and configurable Milvus URI/token/database/collection settings.
  • Add a milvus optional extra, sample documentation, unit tests, and opt-in end-to-end tests for Milvus Lite and Zilliz Cloud.

Closes #69

Testing

  • uv run pytest tests/unittests/memory/test_milvus_memory_service.py
  • RUN_MILVUS_LITE_E2E=1 uv run pytest tests/integration/memory/test_milvus_memory_service_e2e.py::test_milvus_lite_memory_e2e -q
  • uv run pytest tests/integration/memory/test_milvus_memory_service_e2e.py::test_zilliz_cloud_memory_e2e -q
  • uv run pytest

Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
@zc277584121

Copy link
Copy Markdown
Author

Updated the integration coverage with live embedding-provider E2E tests for both Milvus Lite and Zilliz Cloud, while keeping the deterministic embedding tests for stable local/CI smoke coverage.

Local validation:

  • uv run pytest tests/unittests/memory/test_milvus_memory_service.py -> 12 passed
  • RUN_MILVUS_LITE_E2E=1 uv run pytest tests/integration/memory/test_milvus_memory_service_e2e.py -q -> 4 passed, 2 skipped
  • uv run pytest -> 88 passed, 18 skipped

The skipped live embedding checks are for a provider endpoint that is unavailable from the current location.

Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
@zc277584121

Copy link
Copy Markdown
Author

Tightened the live integration tests so external services are fully opt-in. Having credentials in the environment is no longer enough to trigger network-backed Milvus/Zilliz/OpenAI/Google checks; callers must also set the relevant RUN_*_E2E=1 flags.

I also expanded the Milvus memory sample to clarify that the service accepts any embedding function, with both Gemini and OpenAI embedding examples.

Local validation:

  • uv run pytest tests/integration/memory/test_milvus_memory_service_e2e.py -q -> 6 skipped
  • RUN_MILVUS_LITE_E2E=1 RUN_ZILLIZ_CLOUD_E2E=1 RUN_OPENAI_EMBEDDING_E2E=1 RUN_GOOGLE_EMBEDDING_E2E=1 uv run pytest tests/integration/memory/test_milvus_memory_service_e2e.py -q -> 4 passed, 2 skipped
  • uv run pytest tests/unittests/memory/test_milvus_memory_service.py -> 12 passed
  • uv run pytest -> 86 passed, 20 skipped

Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
@zc277584121

Copy link
Copy Markdown
Author

Added the RAG side of the Milvus integration in a separate commit.

What changed:

  • Added MilvusVectorStore for collection setup, schema validation, text ingestion, sync/async similarity search, and configurable URI/token/db/consistency settings.
  • Added MilvusToolset with a prefixed milvus_similarity_search retrieval tool.
  • Added unit coverage plus opt-in live E2E coverage for Milvus Lite and Zilliz Cloud.
  • Added a sample README for using the toolset with ADK agents.

Validation:

  • uv run --with isort isort src/google/adk_community/tools/milvus tests/unittests/tools/milvus tests/integration/tools/test_milvus_toolset_e2e.py
  • uv run --with pyink pyink --config pyproject.toml src/google/adk_community/tools/milvus tests/unittests/tools/milvus tests/integration/tools/test_milvus_toolset_e2e.py
  • uv run pytest tests/unittests/tools/milvus/test_milvus_toolset.py -> 11 passed
  • uv run pytest tests/integration/tools/test_milvus_toolset_e2e.py -q -> 6 skipped by default
  • Opt-in live E2E against Milvus Lite and Zilliz Cloud with live embedding checks -> 4 passed, 2 skipped. The skipped cases are the Google embedding checks because that API is not available from the current test location.
  • uv run pytest tests/unittests/tools -> 32 passed
  • uv run pytest -> 97 passed, 26 skipped

@zc277584121

Copy link
Copy Markdown
Author

Hi @DeanChensj and @secprog, this is ready for review when you have a chance.

This implements the Milvus memory and RAG toolset support in the community repo, including the use case from #70, with opt-in live E2E coverage for Milvus Lite and Zilliz Cloud. The companion docs PR is google/adk-docs#1924.

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.

Feature Request: Add Milvus-backed Memory Service

1 participant