Milvus Vector Store

The Milvus Vector Store node connects to a Milvus vector database to store and retrieve embeddings. This node is used to query semantically similar documents or vectors based on the user’s questions or inputs. 

Inputs

  • Documents – Accepts vectorized documents (e.g., from embedding nodes) to be stored in Milvus
  • Questions – Accepts vectorized queries for similarity search in the Milvus collection

Outputs

  • Documents – Emits associated metadata or document references retrieved by the query
  • Answers – Returns the most relevant document matches based on vector similarity
  • Questions – Returns the input question for chaining with other nodes like LLMs

Configuration

GUI

  • Type of Milvus Host – Choose your Milvus environment.
    • Example – Milvus cloud server
  • Host – Define the endpoint of your Milvus instance.
    • Format – <your-instance-name>.<region>.zillizcloud.com
  • Port – Set the port number used for Milvus API communication.
    • Example – 443
  • API Key – Enter the access key provided by your Milvus service.
  • Retrieval Score – Set the minimum similarity score for returning search results.
    • Options – Related, Highly Related, Most Relevant
  • Collection – Name the target collection where your vectors are stored and retrieved.
    • Example – APARAVI

Milvus Vector Store supports several deployment modes:

Standalone Mode

Connects to a standalone Milvus server.

{
"host": "localhost",
"port": 19530,
"collection": "aparavi_docs",
"alias": "default"
}

Cluster Mode

Connects to a Milvus cluster for high availability and scalability.

{
"hosts": ["milvus-1:19530", "milvus-2:19530", "milvus-3:19530"],
"collection": "aparavi_docs",
"alias": "production",
"consistency_level": "Strong"
}

Cloud Mode

Connects to a Milvus cloud instance.

{
"uri": "https://your-instance.milvus-service.com",
"token": "your-api-token",
"collection": "aparavi_docs",
"secure": true
}

Advanced Settings

  • Vector Dimension – Dimension of vector embeddings
    • Default – 1536
    • Notes – Must match your embedding model
  • Index Type – Type of vector index
    • Default – HNSW
    • Options – FLAT, IVF_FLAT, HNSW, etc.
  • Metric Type – Distance metric for similarity
    • Default – COSINE
    • Options – L2, IP, COSINE
  • Search Parameters – Parameters for search operations
    • Default – {}
    • Notes – Index-specific parameters
  • Consistency Level – Data consistency level
    • Default – Session
    • Options – Strong, Session, Bounded, Eventually

Example Usage

Basic RAG Pipeline

This example shows how to use Milvus Vector Store in a basic Retrieval Augmented Generation (RAG) pipeline:

  1. Connect a Document Parser to extract text from documents
  2. Connect a Preprocessor to clean and prepare the text
  3. Connect an Embeddings node to convert text to vector embeddings
  4. Connect the Embeddings output to the Milvus Vector Store Documents input
  5. Connect a question input to the Milvus Vector Store Questions input
  6. Connect the Milvus Answers output to an LLM for generating responses

Configuration for Production Use

For production environments, we recommend using Cluster mode with these settings:

{
"hosts": ["milvus-1.prod:19530", "milvus-2.prod:19530", "milvus-3.prod:19530"],
"collection": "production_data",
"alias": "prod",
"consistency_level": "Strong",
"vector_dimension": 1536,
"index_type": "HNSW",
"metric_type": "COSINE",
"search_parameters": { "ef": 64, "nprobe": 16 }
}

Best Practices

  • Use separate collections for different data domains
  • Choose the appropriate index type based on your dataset size and query requirements
  • For large datasets, IVF_FLAT or HNSW indices provide better performance
  • Adjust search parameters based on your precision vs. speed requirements
  • Use Strong consistency for critical applications, Eventually for higher throughput

Troubleshooting

Connection Problems

  • Connection refused – Verify host and port settings
  • Authentication failure – Check API token validity
  • Timeout errors – Check network connectivity and Milvus server status

Query Performance

  • Slow queries – Optimize index type and search parameters
  • Memory errors – Check Milvus server resources
  • Poor search results – Ensure vector dimensions match between embeddings and collection

Technical Reference

For detailed technical information, refer to: