{"id":135778,"date":"2026-09-07T11:33:18","date_gmt":"2026-09-07T06:03:18","guid":{"rendered":"https:\/\/www.guvi.in\/blog\/?p=135778"},"modified":"2026-09-07T11:33:21","modified_gmt":"2026-09-07T06:03:21","slug":"milvus-tutorial","status":"publish","type":"post","link":"https:\/\/www.guvi.in\/blog\/milvus-tutorial\/","title":{"rendered":"Milvus Tutorial: Open-Source Vector Database Guide"},"content":{"rendered":"\n<p>Milvus is an open-source vector database designed for large-scale similarity search over embeddings.<br>It supports local development with Milvus Lite and production deployments with standalone or distributed clusters.<br>This tutorial shows how to set up Milvus, create a collection, insert vectors, and run your first vector search in Python.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TL;DR Summary<\/strong><\/h2>\n\n\n\n<ul>\n<li>Milvus is an open-source vector database for similarity search.<\/li>\n\n\n\n<li>You store embeddings in collections with defined schemas and indexes.<\/li>\n\n\n\n<li>Queries return the most similar vectors based on distance metrics.<\/li>\n\n\n\n<li>Milvus Lite is ideal for local development; clusters are for production.<\/li>\n\n\n\n<li>Common use cases include semantic search, recommendations, and RAG.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Direct Answer<\/strong><\/h3>\n\n\n\n<p><strong>Milvus Vector Database<\/strong> stores high-dimensional vector embeddings and provides fast approximate nearest-neighbor search. You define a collection schema, insert vectors with optional metadata, build an index, and then query the collection with a new embedding to find the most similar items. Milvus can run locally as Milvus Lite or as a scalable cluster, making it suitable for prototypes and production AI applications such as semantic search, recommendations, and RAG.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What Is Milvus?<\/strong><\/h2>\n\n\n\n<p><strong>Milvus<\/strong> is an open-source vector database built for managing, indexing, and searching large collections of vector embeddings. It is designed for <a href=\"https:\/\/www.guvi.in\/blog\/what-is-artificial-intelligence\/\" target=\"_blank\" rel=\"noreferrer noopener\">AI<\/a> workloads that require fast, scalable similarity search over high-dimensional data.<\/p>\n\n\n\n<p>Key characteristics:<\/p>\n\n\n\n<ul>\n<li>Open-source with a large community and ecosystem.<\/li>\n\n\n\n<li>Supports local (Milvus Lite), standalone, and distributed deployments.<\/li>\n\n\n\n<li>Optimized for low-latency approximate nearest-neighbor search.<\/li>\n\n\n\n<li>Supports metadata filtering, hybrid search, and multi-vector fields.<\/li>\n\n\n\n<li>Integrates with popular embedding models and frameworks.<\/li>\n<\/ul>\n\n\n\n<p>Milvus is commonly used for:<\/p>\n\n\n\n<ul>\n<li>Semantic search over documents, products, or knowledge bases.<\/li>\n\n\n\n<li>Recommendation systems.<\/li>\n\n\n\n<li>Retrieval-Augmented Generation (RAG) for <a href=\"https:\/\/www.guvi.in\/blog\/guide-to-large-language-models\/\" target=\"_blank\" rel=\"noreferrer noopener\">LLMs<\/a>.<\/li>\n\n\n\n<li>Image, audio, and multimodal search.<\/li>\n\n\n\n<li>Clustering, deduplication, and anomaly detection.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why Use Milvus?<\/strong><\/h2>\n\n\n\n<p>Milvus offers:<\/p>\n\n\n\n<ul>\n<li>Flexible deployment options from local file-based databases to cloud-native clusters.<\/li>\n\n\n\n<li>Rich indexing strategies for different performance and accuracy trade-offs.<\/li>\n\n\n\n<li>Support for scalar fields alongside vector fields for filtering and joins.<\/li>\n\n\n\n<li>Horizontal scalability for large datasets and high query throughput.<\/li>\n\n\n\n<li>A Python SDK and integrations with <a href=\"https:\/\/www.guvi.in\/blog\/build-a-language-model-application-with-langchain\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangChain<\/a>, LlamaIndex, and other tools.<\/li>\n<\/ul>\n\n\n\n<p>This makes Milvus suitable for both experimentation and production-grade AI systems.<\/p>\n\n\n\n<p><em>Milvus is an open-source vector database you can run locally or on Kubernetes, letting you store embeddings, build indexes, and run fast similarity and hybrid searches for RAG and other GenAI. Learn AI &amp; ML with HCL GUVI\u2019s<\/em><a href=\"https:\/\/www.guvi.in\/mlp\/artificial-intelligence-and-machine-learning?utm_source=milvus-tutorial\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.guvi.in\/mlp\/artificial-intelligence-and-machine-learning?utm_source=milvus-tutorial\" rel=\"noreferrer noopener\"><em> Artificial Intelligence and Machine Learning course<\/em><\/a><em>.\u00a0<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Core Concepts: Collections, Schema, and Indexes<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"940\" height=\"497\" src=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/08\/image-563.png\" alt=\"Core Concepts: Collections, Schema, and Indexes\" class=\"wp-image-135781\" srcset=\"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/08\/image-563.png 940w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/08\/image-563-300x159.png 300w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/08\/image-563-768x406.png 768w, https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/08\/image-563-150x79.png 150w\" sizes=\"(max-width: 940px) 100vw, 940px\" title=\"\"><\/figure>\n\n\n\n<p>Before using Milvus, you need to understand three core ideas.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Collections<\/strong><\/h3>\n\n\n\n<p>A <strong>collection<\/strong> in Milvus is similar to a table in a relational database.<\/p>\n\n\n\n<ul>\n<li>It holds entities (rows) with vector and scalar fields.<\/li>\n\n\n\n<li>Each collection has a defined schema.<\/li>\n\n\n\n<li>You can have multiple collections for different datasets or use cases.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Schema<\/strong><\/h3>\n\n\n\n<p>A <strong>schema<\/strong> defines the fields in a collection.<\/p>\n\n\n\n<ul>\n<li>Vector fields store embeddings (for example, float vectors of dimension 768).<\/li>\n\n\n\n<li>Scalar fields store metadata (for example, IDs, text, categories, timestamps).<\/li>\n\n\n\n<li>You specify which field is the primary key and which fields are indexed.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Indexes<\/strong><\/h3>\n\n\n\n<p>An <strong>index<\/strong> in Milvus accelerates vector search.<\/p>\n\n\n\n<ul>\n<li>You choose an index type (for example, HNSW, IVF_FLAT, SCANN).<\/li>\n\n\n\n<li>You configure parameters such as M, efConstruction, or nlist.<\/li>\n\n\n\n<li>Milvus builds the index over the vector field to enable fast approximate nearest-neighbor search.<\/li>\n<\/ul>\n\n\n\n<p>Without an index, search over large datasets can be slow.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step-by-Step: Setting Up Milvus<\/strong><\/h2>\n\n\n\n<p>This section walks you through a minimal end-to-end setup using Python and Milvus Lite.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Install the Python Client<\/strong><\/h3>\n\n\n\n<p>Install the pymilvus package, which includes the Python client and Milvus Lite.<\/p>\n\n\n\n<p>bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -U pymilvus<\/code><\/pre>\n\n\n\n<p>Optionally, install the model utilities for built-in embeddings:<\/p>\n\n\n\n<p>bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install \"pymilvus&#91;model]\"<\/code><\/pre>\n\n\n\n<p>Milvus Lite requires:<\/p>\n\n\n\n<ul>\n<li>Python 3.8 or higher.<\/li>\n\n\n\n<li>A supported OS (Linux, macOS, or Windows with WSL).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Create a Local Milvus Database<\/strong><\/h3>\n\n\n\n<p>Milvus Lite stores data in a local file. You can instantiate a client by specifying a file path.<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from pymilvus import MilvusClient\n\nclient = MilvusClient(\"milvus_demo.db\")<\/code><\/pre>\n\n\n\n<p>This creates or opens a local vector database in milvus_demo.db.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Define a Collection Schema<\/strong><\/h3>\n\n\n\n<p>Define a collection with a vector field and optional scalar fields.<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>collection_name = \"demo_collection\"\n\n# Drop collection if it exists (for tutorial purposes)\n\nif client.has_collection(collection_name):\n\n&nbsp;&nbsp;&nbsp;&nbsp;client.drop_collection(collection_name)\n\nclient.create_collection(\n\n&nbsp;&nbsp;&nbsp;&nbsp;collection_name=collection_name,\n\n&nbsp;&nbsp;&nbsp;&nbsp;dimension=768, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Match your embedding dimension\n\n&nbsp;&nbsp;&nbsp;&nbsp;metric_type=\"COSINE\",&nbsp; &nbsp; # or \"L2\", \"IP\"\n\n&nbsp;&nbsp;&nbsp;&nbsp;auto_id=False&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # We will provide our own IDs\n\n)<\/code><\/pre>\n\n\n\n<p>Adjust:<\/p>\n\n\n\n<ul>\n<li>dimension to match your embedding model (for example, 768, 1536).<\/li>\n\n\n\n<li>metric_type based on your model\u2019s recommended distance.<\/li>\n\n\n\n<li>auto_id depending on whether you want Milvus to generate IDs.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Prepare Sample Data<\/strong><\/h3>\n\n\n\n<p>Suppose you have a few documents:<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>documents = &#91;\n\n&nbsp;&nbsp;&nbsp;&nbsp;{\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"id\": 1,\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"text\": \"Milvus is an open-source vector database for similarity search.\",\n\n&nbsp;&nbsp;&nbsp;&nbsp;},\n\n&nbsp;&nbsp;&nbsp;&nbsp;{\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"id\": 2,\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"text\": \"Vector search enables semantic search over embeddings.\",\n\n&nbsp;&nbsp;&nbsp;&nbsp;},\n\n&nbsp;&nbsp;&nbsp;&nbsp;{\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"id\": 3,\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"text\": \"RAG systems use vector databases to retrieve relevant context.\",\n\n&nbsp;&nbsp;&nbsp;&nbsp;},\n\n]<\/code><\/pre>\n\n\n\n<p>Each document has:<\/p>\n\n\n\n<ul>\n<li>A unique id.<\/li>\n\n\n\n<li>A text field to embed.<\/li>\n\n\n\n<li>Optionally, additional metadata fields.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5: Generate Embeddings<\/strong><\/h3>\n\n\n\n<p>Use an <a href=\"https:\/\/www.youtube.com\/watch?v=ftLS-SF3vgI\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">embedding model<\/a> to convert text into vectors. With pymilvus[model], you can use the default embedding function:<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from pymilvus import model\n\nembedding_fn = model.DefaultEmbeddingFunction()\n\ntexts = &#91;doc&#91;\"text\"] for doc in documents]\n\nvectors = embedding_fn.encode_documents(texts)<\/code><\/pre>\n\n\n\n<p>vectors will be a list of vectors (lists of floats) matching the specified dimension.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 6: Insert Data into Milvus<\/strong><\/h3>\n\n\n\n<p>Combine IDs, vectors, and metadata, then insert:<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>entities = &#91;\n\n&nbsp;&nbsp;&nbsp;&nbsp;{\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"id\": doc&#91;\"id\"],\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"vector\": vec,\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"text\": doc&#91;\"text\"],\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add more metadata if needed\n\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;for doc, vec in zip(documents, vectors)\n\n]\n\nclient.insert(\n\n&nbsp;&nbsp;&nbsp;&nbsp;collection_name=collection_name,\n\n&nbsp;&nbsp;&nbsp;&nbsp;data=entities\n\n)<\/code><\/pre>\n\n\n\n<p>Milvus stores and indexes these entities in the collection.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Querying for Similar Vectors<\/strong><\/h2>\n\n\n\n<p>Now you can perform vector search.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 7: Embed a Query<\/strong><\/h3>\n\n\n\n<p>Embed your query text using the same embedding function:<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>query_text = \"How does vector search work?\"\n\nquery_vectors = embedding_fn.encode_queries(&#91;query_text])<\/code><\/pre>\n\n\n\n<p>Using the same embedding model is critical for meaningful similarity.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 8: Run a Vector Search Query<\/strong><\/h3>\n\n\n\n<p>Query the collection for the top-k most similar vectors:<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>results = client.search(\n\n&nbsp;&nbsp;&nbsp;&nbsp;collection_name=collection_name,\n\n&nbsp;&nbsp;&nbsp;&nbsp;data=query_vectors,\n\n&nbsp;&nbsp;&nbsp;&nbsp;limit=2,\n\n&nbsp;&nbsp;&nbsp;&nbsp;output_fields=&#91;\"id\", \"text\"]\n\n)\n\nfor hits in results:\n\n&nbsp;&nbsp;&nbsp;&nbsp;for hit in hits:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(\"ID:\", hit&#91;\"id\"])\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(\"Score:\", hit&#91;\"score\"])\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(\"Text:\", hit&#91;\"text\"])\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(\"-\" * 40)<\/code><\/pre>\n\n\n\n<p>Milvus returns:<\/p>\n\n\n\n<ul>\n<li>id: the document ID.<\/li>\n\n\n\n<li>score: similarity score (higher is more similar for cosine\/IP).<\/li>\n\n\n\n<li>text and other requested fields.<\/li>\n<\/ul>\n\n\n\n<p>This is the core of semantic search: you search by meaning, not by exact keywords.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Filtering by Scalar Fields<\/strong><\/h2>\n\n\n\n<p>Milvus supports filtering by scalar fields during search.<\/p>\n\n\n\n<p>For example, filter by an ID range or category:<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>results = client.search(\n\n&nbsp;&nbsp;&nbsp;&nbsp;collection_name=collection_name,\n\n&nbsp;&nbsp;&nbsp;&nbsp;data=query_vectors,\n\n&nbsp;&nbsp;&nbsp;&nbsp;limit=2,\n\n&nbsp;&nbsp;&nbsp;&nbsp;filter=\"id &gt;= 2\",\n\n&nbsp;&nbsp;&nbsp;&nbsp;output_fields=&#91;\"id\", \"text\"]\n\n)<\/code><\/pre>\n\n\n\n<p>Common filter expressions include:<\/p>\n\n\n\n<ul>\n<li>&#8220;id == 1&#8221; \u2013 exact match.<\/li>\n\n\n\n<li>&#8220;id in [1, 2, 3]&#8221; \u2013 in a list.<\/li>\n\n\n\n<li>&#8220;category == &#8216;tutorials'&#8221; \u2013 string equality.<\/li>\n\n\n\n<li>&#8220;timestamp &gt; 1700000000&#8221; \u2013 time-based filtering.<\/li>\n\n\n\n<li>Logical combinations using and, or, not.<\/li>\n<\/ul>\n\n\n\n<p>Metadata filtering is useful for:<\/p>\n\n\n\n<ul>\n<li>Restricting search to certain users, tenants, or domains.<\/li>\n\n\n\n<li>Limiting by date, language, or content type.<\/li>\n\n\n\n<li>Implementing access control alongside semantic search.<\/li>\n<\/ul>\n\n\n\n<p><em>Milvus is an open-source vector database you can run locally or on Kubernetes, letting you store embeddings, build indexes, and run fast similarity and hybrid searches for RAG and other GenAI. Learn AI &amp; ML with HCL GUVI\u2019s<\/em><a href=\"https:\/\/www.guvi.in\/mlp\/artificial-intelligence-and-machine-learning?utm_source=milvus-tutorial\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.guvi.in\/mlp\/artificial-intelligence-and-machine-learning?utm_source=milvus-tutorial\" rel=\"noreferrer noopener\"><em> Artificial Intelligence and Machine Learning course<\/em><\/a><em>.\u00a0<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Building a Simple RAG Example<\/strong><\/h2>\n\n\n\n<p>Milvus is often used in Retrieval-Augmented Generation (RAG) pipelines.<\/p>\n\n\n\n<p>A minimal <a href=\"https:\/\/www.guvi.in\/blog\/rag-app-tutorial\/\" target=\"_blank\" rel=\"noreferrer noopener\">RAG<\/a> flow:<\/p>\n\n\n\n<ol>\n<li>User asks a question.<\/li>\n\n\n\n<li>Embed the question.<\/li>\n\n\n\n<li>Query Milvus for top-k relevant documents.<\/li>\n\n\n\n<li>Pass the retrieved text plus the question to an LLM.<\/li>\n\n\n\n<li>LLM generates an answer grounded in the retrieved context.<\/li>\n<\/ol>\n\n\n\n<p>Conceptual code:<\/p>\n\n\n\n<p>python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. User question\n\nquestion = \"What is Milvus used for?\"\n\n# 2. Embed question\n\nquery_vectors = embedding_fn.encode_queries(&#91;question])\n\n# 3. Retrieve context\n\nresults = client.search(\n\n&nbsp;&nbsp;&nbsp;&nbsp;collection_name=collection_name,\n\n&nbsp;&nbsp;&nbsp;&nbsp;data=query_vectors,\n\n&nbsp;&nbsp;&nbsp;&nbsp;limit=3,\n\n&nbsp;&nbsp;&nbsp;&nbsp;output_fields=&#91;\"id\", \"text\"]\n\n)\n\ncontexts = &#91;hit&#91;\"text\"] for hits in results for hit in hits]\n\ncontext_text = \"\\n\\n\".join(contexts)\n\n# 4. Build prompt for LLM (pseudo-code)\n\nprompt = f\"\"\"\n\nContext:\n\n{context_text}\n\nQuestion: {question}\n\nAnswer based on the context above:\n\n\"\"\"\n\n# 5. Send prompt to your LLM API and return the response<\/code><\/pre>\n\n\n\n<p>This pattern powers many AI assistants, document Q&amp;A systems, and knowledge-base chatbots.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Deployment Options: Lite, Standalone, and Distributed<\/strong><\/h2>\n\n\n\n<p>Milvus offers several deployment modes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Milvus Lite<\/strong><\/h3>\n\n\n\n<ul>\n<li>Runs locally using a file-based database.<\/li>\n\n\n\n<li>Ideal for prototyping, tutorials, and small projects.<\/li>\n\n\n\n<li>No Docker or cluster management required.<\/li>\n\n\n\n<li>Limited scale compared to full clusters.<\/li>\n<\/ul>\n\n\n\n<p>Use Milvus Lite when you want to experiment quickly on a single machine.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Milvus Standalone<\/strong><\/h3>\n\n\n\n<ul>\n<li>Runs as a single-node server in Docker or Kubernetes.<\/li>\n\n\n\n<li>Suitable for small to medium production workloads.<\/li>\n\n\n\n<li>Supports indexes, multiple collections, and concurrent queries.<\/li>\n\n\n\n<li>Easier to operate than a full distributed cluster.<\/li>\n<\/ul>\n\n\n\n<p>Use Standalone for pilot projects and moderate-scale deployments.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Milvus Distributed<\/strong><\/h3>\n\n\n\n<ul>\n<li>Runs as a multi-node cluster with separate components (coordinators, query nodes, data nodes, index nodes).<\/li>\n\n\n\n<li>Designed for large-scale, high-throughput production systems.<\/li>\n\n\n\n<li>Supports horizontal scaling, high availability, and fault tolerance.<\/li>\n\n\n\n<li>Requires more operational expertise and infrastructure.<\/li>\n<\/ul>\n\n\n\n<p>Use Distributed for enterprise-scale AI applications with large datasets and strict SLAs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Common Mistakes to Avoid<\/strong><\/h2>\n\n\n\n<ul>\n<li>Using different embedding models for indexing and querying.<\/li>\n\n\n\n<li>Choosing a collection dimension that does not match your vectors.<\/li>\n\n\n\n<li>Not defining a primary key or unique ID field.<\/li>\n\n\n\n<li>Ignoring scalar fields and losing the ability to filter or trace results.<\/li>\n\n\n\n<li>Using an inappropriate metric type for your embedding model.<\/li>\n\n\n\n<li>Expecting exact keyword matching instead of semantic similarity.<\/li>\n\n\n\n<li>Not building an index before running large-scale searches.<\/li>\n\n\n\n<li>Treating Milvus as a general-purpose database instead of a vector index.<\/li>\n\n\n\n<li>Skipping evaluation of retrieval quality in RAG applications.<\/li>\n\n\n\n<li>Overlooking resource requirements for distributed deployments.<\/li>\n<\/ul>\n\n\n\n<div style=\"background-color: #099f4e; border: 3px solid #110053; border-radius: 12px; padding: 18px 22px; color: #FFFFFF; font-size: 18px; font-family: Montserrat, Helvetica, sans-serif; line-height: 1.6; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); max-width: 750px;\"> \n  <strong style=\"font-size: 22px; color: #FFFFFF;\">\ud83d\udca1 Did You Know?<\/strong> \n  <br \/><br \/> \n   Milvus can handle billions of vectors across a distributed cluster while maintaining low-latency search.\nYou can combine vector similarity with scalar filters to build multi-tenant, domain-specific, or access-controlled search systems.\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p><strong>Milvus Vector Database<\/strong> provides a flexible, open-source platform for building semantic search, recommendations, and RAG applications. By storing embeddings in collections with defined schemas and indexes, you can retrieve the most similar items based on meaning rather than keywords.<\/p>\n\n\n\n<p>With a few lines of Python, you can run Milvus locally, insert vectors, and perform similarity queries. As your application grows, you can scale to standalone or distributed deployments, add advanced indexing, and integrate with LLMs to build powerful AI-driven experiences.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FAQs<\/strong><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1787737761102\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>What is Milvus used for?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Milvus is used for vector similarity search, semantic search, recommendations, duplicate detection, and retrieval for RAG applications.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1787737768102\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>Do I need to generate embeddings myself?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes. You generate embeddings using an embedding model and store the resulting vectors in Milvus. Milvus focuses on storage, indexing, and search rather than embedding generation.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1787737775268\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>How do I choose the collection dimension?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>The collection dimension must match the output dimension of your embedding model (for example, 768, 1536). Check your model\u2019s documentation.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1787737782907\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>What metric type should I use?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Use the metric type recommended by your embedding model (often COSINE or IP). The metric must be consistent between indexing and querying.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Milvus is an open-source vector database designed for large-scale similarity search over embeddings.It supports local development with Milvus Lite and production deployments with standalone or distributed clusters.This tutorial shows how to set up Milvus, create a collection, insert vectors, and run your first vector search in Python. TL;DR Summary Direct Answer Milvus Vector Database stores [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":135977,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[933],"tags":[],"views":"622","authorinfo":{"name":"HCL GUVI","url":"https:\/\/www.guvi.in\/blog\/author\/guvipr\/"},"thumbnailURL":"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/08\/Milvus-Tutorial-Open-Source-Vector-Database-Guide-300x116.webp","_links":{"self":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/135778"}],"collection":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/comments?post=135778"}],"version-history":[{"count":5,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/135778\/revisions"}],"predecessor-version":[{"id":137527,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/135778\/revisions\/137527"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media\/135977"}],"wp:attachment":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media?parent=135778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/categories?post=135778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/tags?post=135778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}