Skip to main content

Milvus Vector Database Adapter

This is a community-contributed adapter for integrating Milvus with Cognee.

About Milvus

Milvus is an open-source vector database built to power AI applications. It provides high-performance similarity search and supports various index types, making it ideal for AI applications requiring fast and accurate vector searches.

Installation

  1. Install the required dependencies:

    # Option 1: Install dependencies directly
    pip install pymilvus>=2.5.0
    pip install milvus-lite>=2.4.0  # Linux/Mac only
    
    # Option 2: Install as a package (if published)
    pip install cognee-milvus-adapter
    
    # Option 3: Install from source
    cd community/adapters/vector/milvus
    pip install .
    
  2. Import and register the adapter in your code:

    from cognee_community_vector_adapter_milvus import register
    

Configuration

Configure Cognee to use Milvus:

# For local Milvus Lite
cognee.config.vector_db_provider("milvus")
cognee.config.vector_db_url("path/to/milvus.db")
cognee.config.vector_db_key("")  # No key needed for local

# For remote Milvus server
cognee.config.vector_db_provider("milvus")
cognee.config.vector_db_url("http://localhost:19530")  # Milvus server URL
cognee.config.vector_db_key("your_milvus_token")  # If authentication is enabled

Usage Example

import cognee

# Register the adapter (importing the module registers "milvus" with cognee)
from cognee_community_vector_adapter_milvus import register  # noqa: F401

# Configure Milvus
cognee.config.set_vector_db_config(
    {
        "vector_db_provider": "milvus",
        "vector_db_url": "./milvus.db",
        "vector_db_key": "",
    }
)

# Use Cognee normally
await cognee.add("Your data here")
await cognee.cognify()
results = await cognee.search("search query")

Features

  • High-performance similarity search: Optimized for large-scale vector operations
  • Multiple index types: Supports various indexing algorithms (IVF_FLAT, IVF_SQ8, etc.)
  • Horizontal scaling: Can handle billions of vectors
  • Hybrid search: Combines vector similarity with scalar filtering
  • Enterprise-grade: Production-ready with monitoring and management tools

Testing

Run the tests to verify the adapter works correctly:

pytest tests/unit             # offline contract tests, no server needed
python tests/test_milvus.py   # integration test, needs Milvus + LLM keys

Dependencies

  • pymilvus>=2.5.0,<3: Official Milvus Python client
  • milvus-lite>=2.4.0: Lightweight version of Milvus (Linux/Mac only)

Deployment Options

Local Development (Milvus Lite)

  • Use milvus-lite for local development and testing
  • No server setup required
  • File-based storage

Production (Milvus Server)

  • Deploy Milvus server using Docker, Kubernetes, or cloud services
  • Supports clustering and high availability
  • Better performance for production workloads

Support

For issues specific to this adapter:

  1. Check the Milvus documentation
  2. Create an issue in the main Cognee repository with the "community-adapter" label
  3. Refer to the example and test files for usage patterns

License

This adapter is licensed under the Apache 2.0 license, same as the main Cognee project.

Metadata

Release files for cognee-community-vector-adapter-milvus 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cognee-community-vector-adapter-milvus 0.2.0
File Size Uploaded Provenance
cognee_community_vector_adapter_milvus-0.2.0.tar.gz 325.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cognee-community-vector-adapter-milvus 0.2.0
File Interpreter ABI Platform
cognee_community_vector_adapter_milvus-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 333.3 kB

Release files / cognee_community_vector_adapter_milvus-0.2.0.tar.gz

Download URL cognee_community_vector_adapter_milvus-0.2.0.tar.gz
Size 325.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e7f088f8f8d37a4986153104a3a64f8e18f3f3b97c481e94f914588471d693a6
BLAKE2b-256 checksum
How to use checksums
3ac8579aacac16d22849f1838de140af849403db6047f5b30ea2caeac3e78800
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.18 Darwin/24.1.0

Release files / cognee_community_vector_adapter_milvus-0.2.0-py3-none-any.whl

Download URL cognee_community_vector_adapter_milvus-0.2.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adc6982fc8a97c5c286e9fe2d67fe3d88e8ef9baf70f3e62a691d097a1a2dde6
BLAKE2b-256 checksum
How to use checksums
0f514fd7e592600c245bc66259432533e1b28a69004bc57dcff3ce5587d27e31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.18 Darwin/24.1.0

Security for cognee-community-vector-adapter-milvus 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page