What is Milvus? —— 向量数据库 Milvus

https://www.ibm.com/think/topics/milvus

What is Milvus?

Milvus is an open-source vector database developed by Zilliz. Milvus is known for providing scalable storage for large amounts of vector embeddings and supporting high-performance similarity searches of vector data.

Zilliz first developed Milvus in 2017 and contributed the project to the Linux® Foundation in 2020. Milvus is now available as both an open-source software under the Apache License 2.0 and as a fully managed cloud service from Zilliz.

Milvus是由Zilliz开发的开源向量数据库。该数据库以提供海量向量嵌入的可扩展存储,并支持向量数据的高性能相似性搜索而著称。

Zilliz于2017年首次开发Milvus,并于2020年将该项目捐赠给Linux®基金会。目前Milvus既可作为Apache License 2.0协议下的开源软件使用,也可通过Zilliz提供的全托管云服务获取。

What are vector databases, and why do they matter?

Vector databases store and manage datasets in the form of vectors. They can help organizations manage unstructured data, and they are critical to advanced artificial intelligence (AI) and machine learning (ML) efforts.

Vectors are arrays of numbers that represent complex concepts and objects, such as words and images.  

Unstructured data—such as text, video and audio—makes up a significant portion of enterprise data today, but traditional databases are often ill-suited to organize and manage this data.  

Organizations can feed this data to specialized deep learning embedding models, which output vector representations called “embeddings.” For example, the word “cat” might be represented by the vector [0.2, -0.4, 0.7], while the word “dog” might be represented by [0.6, 0.1, 0.5].

Transforming data into vectors enables organizations to store different kinds of unstructured data in a shared format in one vector database.  

Vectors also help organizations unlock the value of this data for AI and ML. Vectors capture the semantic relationships between elements, enabling effective processing by large language models (LLMs) and generative AI (gen AI) tools. Most advanced AI and ML applications today rely on vectors for training and content generation.

Like other vector databases, Milvus gives organizations a way to manage and organize embedding vectors. The Milvus vector database’s highly scalable storage and efficient vector search capabilities have made it a popular choice for retrieval augmented generation (RAG), recommendation systems and other AI applications.  

向量数据库以向量的形式存储和管理数据集。它们能帮助企业处理非结构化数据,对高级人工智能(AI)和机器学习(ML)应用至关重要。

向量是表示复杂概念(如单词、图像)的数值数组。如今非结构化数据(如文本、视频、音频)在企业数据中占比巨大,但传统数据库往往难以有效组织这类数据。

企业可将这类数据输入专门的深度学习嵌入模型,输出称为"嵌入"的向量表示。例如单词"猫"可能表示为向量[0.2, -0.4, 0.7],而"狗"可能表示为[0.6, 0.1, 0.5]。

将数据转化为向量后,企业就能以统一格式在单个向量数据库中存储各类非结构化数据。向量还能帮助释放这些数据对AI/ML的价值——通过捕捉元素间的语义关系,支持大语言模型(LLM)和生成式AI工具高效处理。当前大多数先进AI/ML应用都依赖向量进行训练和内容生成。

与其他向量数据库类似,Milvus为企业提供了管理嵌入向量的解决方案。其高度可扩展的存储架构和高效的向量搜索能力,使其成为检索增强生成(RAG)、推荐系统等AI应用的热门选择。

Milvus's architecture

Milvus is a cloud-native vector database with a mulitlayered, microservices-based architecture. Milvus separates storage and compute resources, which enables organizations to scale each layer independently and horizontally.

Milvus is compatible with several different embedding models. Organizations can connect their models to Milvus, which ingests the embeddings along with metadata and other pertinent information. Milvus supports streaming and batch embedding uploads.

Milvus has 4 layers:

  • Access layer: This is the external-facing layer, which accepts inputs from users and services and returns outputs.  

  • Coordinator service: Zilliz refers to this layer as the system’s “brain” because it orchestrates load balancing, data management, query execution and other important tasks. 

  • Worker nodes: This layer executes queries, updates data and builds indexes. 

  • Object storage layer: This layer includes a metadata store, a log broker that records real-time data changes and an object store that holds log snapshots, index files and intermediate computation results.

Milvus deployment types

  • Milvus Lite: A Python library that allows users to run Milvus in local environments. Milvus Lite currently supports Ubuntu and MacOS, but not Microsoft Windows.
     
  • Milvus Standalone: A complete Milvus database packaged in a single Docker image and run on a single machine. 
     
  • Milvus Cluster: A distributed vector database that spreads services across groups of nodes in a Kubernetes cluster.  
     
  • Zilliz Cloud: The fully managed version of Milvus.

Milvus vs. other vector databases

Milvus vs. Pinecone

Both Pinecone and Milvus offer low-latency search and scalable storage, but Pinecone is a proprietary vector database and is available only as a managed service.

Milvus vs. Weaviate

Like Milvus, Weaviate is open source and supports hybrid searches. One key difference is that Milvus offers more indexing types than Weaviate.

Milvus vs. Qdrant

Another open-source vector database, Qdrant is known for its strong metadata filtering capabilities. While Qdrant is well suited for moderate-scale uses, Milvus can generally handle higher volumes of vector data.

Milvus vs. Chroma

Chroma focuses on ease of use and quick local deployments. Chroma does not have a distributed architecture, making it less scalable. While Chroma is commonly used for prototyping and testing, Milvus can support a wider range of use cases.

Common Milvus use cases

Organizations use Milvus to support numerous AI applications, including:

  • Retrieval augmented generation (RAG)

  • Recommendation systems

  • Media searches 

  • Anomaly and fraud detection

Retrieval augmented generation (RAG)

RAG is an architecture that connects AI models to external knowledge bases to help them deliver more relevant, accurate results.  

Milvus is common in RAG implementations because of its support for efficient hybrid searches. By combining the contextual understanding of semantic search with the precision of keyword search and metadata filtering, Milvus can help surface relevant docs, code snippets and other information from RAG sources.

CacheGPT, an open source semantic cache for LLMs developed by Zilliz, also helps Milvus support RAG implementations. CacheGPT stores responses from generative AI apps as vector embeddings.

Connected services—such as RAG interfaces—don’t need to make an API call to the generative AI for every search. Instead, they can check the cache first and call the gen AI only if the answer isn’t there.

Recommendation systems

Milvus is popular in recommendation systems that match content, products and ads to users based on past behaviors. 

User preferences can be represented as vectors, and a similarity search can surface the vector representations of products, ads and content that are close to the user’s preferences.

Media searches

Milvus's similarity search capabilities can help streamline image search, audio search, video search and other media searches.

Anomaly and fraud detection

Milvus can be used to help spot defects in products by comparing the vectors of product images against the vectors representing those products' proper forms. Differences between the vectors might indicate defects.

Milvus can also help spot anomalies in other contexts. In cybersecurity, vectors representing authorized network activity can be compared to vectors representing known malicious activity. Likewise, in finance, vectors representing transactions can be analyzed to identify deviations that might indicate fraud.

Key characteristics and capabilities of Milvus

Advanced search capabilities 

Milvus supports high-performance vector similarity searches, a type of vector search that returns results that are semantically similar to a query. The benefit of similarity search is that it is not limited to exact matches, as a traditional keyword search would be.  

For example, a keyword search for “best pizza restaurant” would return only results containing the words “best”, “pizza” and “restaurant.” A similarity search for the same keyword would find any results for highly recommended pizza places, even if the exact words "best pizza restaurant" are not used in the content.

Milvus supports several similarity search types, including top-k approximate nearest neighbor (ANN) and range ANN.  

Milvus also supports hybrid searches, which combine semantic vector searches with other criteria, such as metadata filtering or keyword search.

Hybrid searches can make searches more efficient and more relevant. Consider a search that combines keyword and vector search. The search can first use specific keywords to filter results based on exact matches and then use vector similarity search to search those filtered results for the most semantically relevant content.  

Indexing 

Milvus supports several indexing types, including hierarchical navigable small world (HNSW), inverted file (IVF) and GPU-based indexes.

Indexing vectors can help speed up searches. For example, HNSW clusters similar vectors together during the index construction process, making it easier to find relevant results faster.

Scalability 

Milvus’s layers can scale independently of one another, which can give organizations a cost- and resource-effective way to handle massive amounts of vector data and intensive searches.

Integrations and compatibility 

Milvus offers numerous software development kits (SDKs) to support development in various languages, including Python (pymilvus), Java and Go.

Milvus can also integrate with analytics tools such as Apache Spark, frameworks such as LangChain and gen AI models such as IBM watsonx™, Meta’s Llama and OpenAI’s GPT models. 

Open source

A large open-source community contributes bug fixes, updates and other enhancements to Milvus’s GitHub repos.

高级搜索能力

Milvus支持高性能向量相似性搜索,这种向量搜索能返回与查询语义相似的结果。相似性搜索的优势在于不像传统关键词搜索那样局限于完全匹配。

例如,关键词搜索"最佳披萨餐厅"仅会返回包含"最佳"、"披萨"和"餐厅"字样的结果。而相同关键词的相似性搜索会找出所有被强烈推荐的披萨店,即使内容中并未使用"最佳披萨餐厅"这个确切表述。

Milvus支持多种相似性搜索类型,包括top-k近似最近邻(ANN)和范围ANN搜索。

该系统还支持混合搜索,可将语义向量搜索与其他条件(如元数据过滤或关键词搜索)相结合。

混合搜索能提升搜索效率和相关性。例如结合关键词与向量搜索时,可先用特定关键词筛选完全匹配结果,再通过向量相似性搜索找出语义最相关的内容。

索引技术

Milvus支持多种索引类型,包括分层可导航小世界(HNSW)、倒排文件(IVF)及基于GPU的索引。

建立向量索引能加速搜索过程。以HNSW为例,它在构建索引时将相似向量聚类,从而更快定位相关结果。

弹性扩展

Milvus各层级可独立扩展,使企业能以经济高效的方式处理海量向量数据和密集搜索请求。

集成与兼容性

提供多语言软件开发工具包(SDK),支持Python(pymilvus)、Java和Go等语言。

可与Apache Spark等分析工具、LangChain等框架,以及IBM watsonx™、Meta的Llama和OpenAI的GPT等生成式AI模型集成。

开源生态

庞大的开源社区通过GitHub仓库为Milvus贡献错误修复、功能更新及其他优化。

相关内容

https://zilliz.com/

https://milvus.io/zh

 开源 https://github.com/milvus-io/milvus

🐦 Milvus is a high-performance vector database built for scale. It powers AI applications by efficiently organizing and searching vast amounts of unstructured data, such as text, images, and multi-modal information.

🧑‍💻 Written in Go and C++, Milvus implements hardware acceleration for CPU/GPU to achieve best-in-class vector search performance. Thanks to its fully-distributed and K8s-native architecture, Milvus can scale horizontally, handle tens of thousands of search queries on billions of vectors, and keep data fresh with real-time streaming updates. Milvus also supports Standalone mode for single machine deployment. Milvus Lite is a lightweight version good for quickstart in python with pip install.

Want to use Milvus with zero setup? Try out Zilliz Cloud ☁️ for free. Milvus is available as a fully managed service on Zilliz Cloud, with ServerlessDedicated and BYOC options available.

https://opensearch.org/platform/vector-engine

An open-source, all-in-one vector database for building scalable and future-proof AI apps

To power artificial intelligence (AI) apps at scale, you need a database specially designed for the way AI understands data. OpenSearch Vector Engine is designed for accuracy, speed, and scalability, enabling you to build stable AI applications on a proven platform that scales to tens of billions of vectors, with low latency and high availability built-in. Unlike traditional databases that struggle with unstructured information, vector databases are designed for high-dimensional data—delivering lightning-fast results for chatbots, recommendations, image search, and other AI use cases.

<think>嗯,用户现在想知道Chroma向量数据库和LlamaIndex的介绍、特点、使用方法以及对比。之前的引用里有很多细节可以参考,但需要整理清晰的结构。 用户提到的四个引用中,引用[1]介绍了Chroma的核心特点:轻量级、内存优先设计,适合原型和小项目,也提到它支持客户端-服务器模式及与其他数据库集成。引用[2][3][4]则集中在LlamaIndex如何与Chroma协作,特别是封装Chroma集合的步骤。这些引用中,用户特别指出"上述引用仅供参考",说明需要结合问题本质回答,而非简单堆砌引用。 用户的需求很明确,但深层可能是在评估技术选型——比如是否适合当前项目规模,是否需要学习集成成本。用户身份可能是开发者或技术决策者,因此需要强调实践场景(如RAG系统构建)和代码示例的真实性。 准备分三块回答:先独立介绍两者(避免混淆概念),再说明集成方法(核心是VectorStore封装),最后对比场景。技术细节要准确,比如引用[4]的转换代码必须验证过语法(chroma_collection参数名是否正确)。性能对比表格能直观帮助决策,但需标注数据来源(如Chrom官方文档提到的测试条件)。 用户可能后续会问"如何在生产部署"或"性能优化",所以相关问题要预留扩展性。另外,所有LaTeX数学表达式(如维度$d$)需严格用$...$包裹,独立公式如欧氏距离用$$...$$单独成段——这点在思考时要检查避免遗漏。 </think>以下是关于**Chroma向量数据库**与**LlamaIndex**的详细介绍、特点、使用方法及对比分析: --- ### **一、Chroma向量数据库** #### **介绍** Chroma 是一个轻量级、开源向量数据库,专为存储和检索文本嵌入向量设计,尤其适合与大语言模型(LLM)集成,支撑RAG(检索增强生成)系统。 #### **核心特点** 1. **轻量级与内存优先** - 内存优先架构,适合快速原型开发和小型项目(如本地实验)。 - 支持**客户端-服务器模式**,便于扩展到生产环境[^1]。 2. **易用性** - 提供简洁的Python API,仅需几行代码即可实现向量存储与查询: ```python import chromadb client = chromadb.Client() collection = client.create_collection("docs") collection.add(ids=["id1"], documents=["Chroma is a vector database"]) results = collection.query(query_texts=["What is Chroma?"], n_results=1) ``` 3. **灵活性** - 支持本地持久化存储(如磁盘保存索引)[^2]。 - 可与其他向量库(如Pinecone、Milvus)集成,应对大规模数据场景[^1]。 --- ### **二、LlamaIndex** #### **介绍** LlamaIndex 是一个专注于**LLM应用的数据框架**,用于高效构建索引、管理上下文及检索非结构化数据(如文档、PDF)。 #### **核心特点** 1. **索引抽象层** - 提供统一接口连接向量数据库(如Chroma)、传统数据库或本地文件系统。 - 简化索引创建流程(如树索引、关键词索引)。 2. **无缝集成向量数据库** - 通过`VectorStore`接口封装Chroma等数据库,实现业务逻辑与存储解耦: ```python from llama_index.vector_stores import ChromaVectorStore from llama_index import VectorStoreIndex # 将Chroma集合转换为LlamaIndex的VectorStore vector_store = ChromaVectorStore(chroma_collection=chroma_collection) index = VectorStoreIndex.from_vector_store(vector_store) # 创建索引[^4] ``` 3. **高级查询能力** - 支持语义搜索、混合检索(关键词+向量)。 - 自动处理上下文注入,优化LLM问答效果。 --- ### **三、两者集成使用方法** #### 步骤概览 1. **初始化Chroma** ```python import chromadb chroma_client = chromadb.PersistentClient(path="./chroma_db") # 持久化存储 chroma_collection = chroma_client.get_or_create_collection("docs") ``` 2. **封装为LlamaIndex VectorStore** ```python from llama_index.vector_stores.chroma import ChromaVectorStore vector_store = ChromaVectorStore(chroma_collection=chroma_collection) # 关键转换[^3][^4] ``` 3. **构建索引与查询** ```python from llama_index import VectorStoreIndex, ServiceContext index = VectorStoreIndex.from_vector_store(vector_store) query_engine = index.as_query_engine() response = query_engine.query("Chroma的特点是什么?") # 语义检索 ``` --- ### **四、对比分析** | **维度** | **Chroma** | **LlamaIndex** | |-------------------|-----------------------------------------|------------------------------------------| | **定位** | 向量存储引擎 | LLM数据编排框架 | | **核心功能** | 向量存储、相似检索 | 索引构建、查询路由、上下文管理 | | **集成关系** | 被LlamaIndex调用(作为存储后端) | 调用Chroma(通过VectorStore接口)[^4] | | **适用场景** | 轻量级嵌入存储、快速检索 | 复杂LLM应用(如RAG、知识库问答) | | **性能扩展** | 依赖客户端-服务器模式扩展 | 通过索引策略优化检索效率 | > ⚡️ **关键协作点**: > Chroma 提供**底层向量存储能力**,LlamaIndex 在其上层实现**业务逻辑抽象**(如多模态索引、查询优化),二者共同构成高效RAG系统[^1][^2]。 --- ### **五、典型应用场景** 1. **本地开发原型** Chroma内存模式 + LlamaIndex索引,快速验证RAG流程。 2. **生产级文档问答系统** Chroma持久化存储 + LlamaIndex混合检索,支撑高并发查询。 3. **多源数据融合分析** LlamaIndex集成Chroma与其他数据库(如MySQL),实现跨模态检索。 --- **相关问题** 1. Chroma如何实现大规模数据的分布式存储? 2. LlamaIndex支持哪些非向量索引类型?(如树索引、关键词索引) 3. 如何在RAG系统中评估Chroma+LlamaIndex的检索准确性? 4. Chroma与其他向量数据库(如Milvus)的性能对比有何差异? [^1]: Chroma 向量数据库学习笔记 [^2]: 使用LlamaIndex和Chroma进行向量存储与查询 [^3]: 在LlamaIndex中指定Chroma集合的方式 [^4]: LlamaIndex封装Chroma的方法详解
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值