Milvus Plugin for Dify
A plugin that integrates Milvus vector database with the Dify platform, providing vector operations for collection management, data insertion, search, and querying.
中文文档 | English
Features
🗂️ Collection Management
- List Collections: View all available collections
- Describe Collection: Get detailed collection information
- Collection Stats: Retrieve collection statistics
- Check Existence: Verify if collections exist
📥 Data Operations
- Insert Data: Add vectors and metadata to collections (vectors must be precomputed by the caller)
- Upsert Data: Insert or update existing data
- Query Data: Retrieve data by ID or filter conditions (auto-detects the primary-key field)
- Delete Data: Remove data from collections (accepts IDs or filter expressions)
When inserting, provide vectors directly in each entity, for example:
🔍 Vector Search
- Similarity Search: Find similar vectors using various metrics
- Filtered Search: Combine vector similarity with metadata filters
- Multi-Vector Search: Search with multiple query vectors
- Custom Parameters: Adjust search behavior parameters
🔀 Hybrid Search
- Combine results from multiple vector fields in one request and rerank with a strategy.
- Endpoint: (the plugin auto-injects ).
- Tool name in Dify: Milvus Hybrid Search.
Parameters (Dify tool form)
- (string, required)
- (string, required): JSON array of search objects with precomputed vectors. Each object should include at least:
- : list of embeddings (precomputed), e.g.
- : target vector field name
- : per-route top-K
- Optional per-route keys supported by REST API: , , , , , ,
- (select): or
- (string or JSON object): For use ; for use
- Optional top-level: , , (comma-separated string or JSON array), (comma-separated string or JSON array), , , , (boolean), (JSON)
Built-in validation
- Each search item must have (non-empty) and (> 0 integer), and provide (non-empty array) with numeric vectors.
- If , must be numeric and its length must equal the number of search routes.
- If top-level is provided, ensure (API limit).
- If or are provided as strings, they are split by comma after trimming whitespace.
Example
If you manage tool parameters via code, and can also be passed as native JSON structures (list/dict) instead of strings. The plugin will normalize both formats.
Installation & Configuration
Connection Configuration
Configure your Milvus connection in the Dify platform:
- URI: Milvus server address (e.g., )
- Token: Authentication token (optional, format: )
- Database: Target database name (default: )
License
MIT License