Skip to main content

Milvus vector database adapter for cognee

Project description

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
from community.adapters.vector.milvus import MilvusAdapter

# Register the adapter
cognee.use_vector_adapter("milvus", MilvusAdapter)

# Configure Milvus
cognee.config.vector_db_provider("milvus")
cognee.config.vector_db_url("./milvus.db")
cognee.config.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:

python community/tests/test_milvus.py

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file cognee_community_vector_adapter_milvus-0.1.0.tar.gz.

File metadata

File hashes

Hashes for cognee_community_vector_adapter_milvus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76c1e98ef05ecbc4f1cae2b31cde460e1aafd7c189dafdb01ad752ae805ccc8d
MD5 ea3f0d2db1121f85ac67674dc7a7de68
BLAKE2b-256 39b8f63aab656b3933cc8aa322ec1a3308ba7f32979bb01c45e7df05e2ee6878

See more details on using hashes here.

File details

Details for the file cognee_community_vector_adapter_milvus-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cognee_community_vector_adapter_milvus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36fd0bb0c501d31fb58ba1a509b1fa65c60164bdffa98f86f0536e7d7fd980c8
MD5 944d73ed9305708f5eb2a09e3a1c888f
BLAKE2b-256 9f1d9284320b6a5aad228d2f5caa349467a5b01a0799c60d6ae9e2c29b5bf85a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page