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
-
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 .
-
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 clientmilvus-lite>=2.4.0: Lightweight version of Milvus (Linux/Mac only)
Deployment Options
Local Development (Milvus Lite)
- Use
milvus-litefor 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:
- Check the Milvus documentation
- Create an issue in the main Cognee repository with the "community-adapter" label
- 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cognee_community_vector_adapter_milvus-0.1.1.tar.gz.
File metadata
- Download URL: cognee_community_vector_adapter_milvus-0.1.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.1 CPython/3.11.13 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc1c3b23b17b4752ddf9129eee3110a86ae333bbfb6dbce1e7a89c40993c90fa
|
|
| MD5 |
d3d0bdf5e0d5bfa85a9f36c7d2e75925
|
|
| BLAKE2b-256 |
0d6c7e776a4de7316b84ce834fb2b6a319e00f2f7599484db113bc15fbe04570
|
File details
Details for the file cognee_community_vector_adapter_milvus-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cognee_community_vector_adapter_milvus-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.1 CPython/3.11.13 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f706b0b7ad50ea5f7e8457390dee227d32578733a8032f294ad298e7634634fb
|
|
| MD5 |
fe39343b7385923591690c5956ebcff5
|
|
| BLAKE2b-256 |
49223ec3228c01712e0340391741a695097d76aeaf57e3c67db97b77f867394c
|