|
1 | 1 | ---
|
2 |
| -title: Build AI apps with vector search |
3 |
| -titleSuffix: Azure Cosmos DB for MongoDB vCore |
4 |
| -description: Enhance AI-powered applications with Retrieval Augmented Generation (RAG) by using Azure Cosmos DB for MongoDB vCore vector search. |
| 2 | +title: Open-Source Vector Databases |
| 3 | +titleSuffix: |
| 4 | +description: Open-Source Vector Databases |
5 | 5 | author: gahl-levy
|
6 | 6 | ms.author: gahllevy
|
7 | 7 | ms.reviewer: sidandrews
|
8 | 8 | ms.service: cosmos-db
|
9 | 9 | ms.subservice: mongodb-vcore
|
10 | 10 | ms.topic: conceptual
|
11 |
| -ms.date: 08/28/2023 |
| 11 | +ms.date: 04/02/2024 |
12 | 12 | ---
|
13 | 13 |
|
14 |
| -# Build AI apps with Azure Cosmos DB for MongoDB vCore vector search |
| 14 | +# Open-Source Vector Databases |
15 | 15 |
|
16 | 16 | [!INCLUDE[MongoDB vCore](../../includes/appliesto-mongodb-vcore.md)]
|
17 | 17 |
|
18 |
| -Language models available in Azure OpenAI Service can elevate the capabilities of your AI-driven applications. To fully unleash the potential of language models, you must give them access to timely and relevant data from your application's data store. You can accomplish this process, known as Retrieval Augmented Generation (RAG), by using Azure Cosmos DB. |
| 18 | +When considering vector databases, the open-source options provide numerous advantages. “Open source” means that the software's source code is available freely, enabling users to customize the database according to their specific needs. This flexibility is particularly beneficial for organizations that are subject to unique regulatory requirements on data, such as companies in the financial services industry. |
19 | 19 |
|
20 |
| -This article delves into the core concepts of RAG. It provides links to tutorials and sample code that exemplify RAG strategies by using vector search in Azure Cosmos DB for MongoDB vCore. |
| 20 | +Another advantage of open-source vector databases is the strong community support they enjoy. Active user communities often contribute to the development of these databases, provide support, and share best practices, promoting innovation. |
21 | 21 |
|
22 |
| -RAG elevates AI-powered applications by incorporating external knowledge and data into model inputs. With vector search in Azure Cosmos DB for MongoDB vCore, this process becomes seamless. You can use it to integrate the most pertinent information into your AI models with minimal effort. |
| 22 | +Some individuals also opt for open-source vector databases because they are "free," meaning there is no cost to acquire or use the software. However, to this end users can also leverage the free benefits through the lifetime free tiers offered by managed vector database services. These managed services provide not only cost-free access up to a certain usage limit but also simplify the operational burden by handling maintenance, updates, and scalability. Therefore, users who seek the economic advantages of open-source solutions can achieve similar cost savings with the added benefit of reduced management overhead by using the free tier of managed vector database services. This approach offers a balance between cost efficiency and operational convenience, allowing users to focus more on their core activities rather than on database administration. |
23 | 23 |
|
24 |
| -By using [embeddings](../../../ai-services/openai/tutorials/embeddings.md) and vector search, you can provide your AI applications with the context that they need to excel. Through the provided tutorials and code samples, you can become proficient in using RAG to create smarter and more context-aware AI solutions. |
| 24 | +## Working Mechanism of Open-source Vector Databases |
25 | 25 |
|
26 |
| -## What is Retrieval Augmented Generation? |
| 26 | +Open-source vector databases are designed to store and manage vector embeddings, which are mathematical representations of data in a high-dimensional space. In this space, each dimension corresponds to a feature of the data, and tens of thousands of dimensions might be used to represent sophisticated data. A vector's position in this space represents its characteristics. Words, phrases, or entire documents, and images, audio, and other types of data can all be vectorized. These vector embeddings are used in similarity search, multi-modal search, recommendations engines, large languages models (LLMs), etc. |
27 | 27 |
|
28 |
| -RAG uses external knowledge and models to efficiently manage custom data or domain-specific expertise. This process involves extracting information from an external data source and integrating it into the model's input through prompt engineering. A robust approach is essential to identify the most pertinent data from the external source within the [token limitations of a request](../../../ai-services/openai/quotas-limits.md). |
| 28 | +These databases' architecture typically includes a storage engine and an indexing mechanism. The storage engine optimizes the storage of vector data for efficient retrieval and manipulation, while the indexing mechanism organizes the data for fast searching and retrieval operations. |
29 | 29 |
|
30 |
| -RAG addresses these limitations by using embeddings, which convert data into vectors. Embeddings capture the semantic essence of the text and enable context comprehension beyond simple keywords. |
| 30 | +In a vector database, embeddings are indexed and queried through vector search algorithms based on their vector distance or similarity. A robust mechanism is necessary to identify the most relevant data. Some well-known vector search algorithms include Hierarchical Navigable Small World (HNSW), Inverted File (IVF), etc. |
31 | 31 |
|
32 |
| -## What is vector search? |
| 32 | +Vector databases are used in numerous domains and situations across analytical and generative AI, including natural language processing, video and image recognition, recommendation system, search, etc. For example, you can use a vector database to: |
33 | 33 |
|
34 |
| -[Vector search](./vector-search.md) is an approach that enables the discovery of analogous items based on shared data characteristics. It deviates from the necessity for precise matches within a property field. |
| 34 | +- identify similar images, documents, and songs based on their contents, themes, sentiments, and styles |
| 35 | +- identify similar products based on their characteristics, features, and user groups |
| 36 | +- recommend contents, products, or services based on individuals' preferences |
| 37 | +- recommend contents, products, or services based on user groups' similarities |
| 38 | +- identify the best-fit potential options from a large pool of choices to meet complex requirements |
| 39 | +- identify data anomalies or fraudulent activities that are dissimilar from predominant or normal patterns |
| 40 | +- implement persistent memory for AI agents |
| 41 | +- enable retrieval-augmented generation (RAG) |
35 | 42 |
|
36 |
| -This method is invaluable in applications like text similarity searches, image association, recommendation systems, and anomaly detection. Its functionality revolves around the use of vector representations (sequences of numerical values) that are generated from your data via machine learning models or embeddings APIs. Examples of such APIs encompass [Azure OpenAI embeddings](/azure/ai-services/openai/how-to/embeddings) or [Hugging Face on Azure](https://azure.microsoft.com/solutions/hugging-face-on-azure/). |
| 43 | +## Selecting the Appropriate Open-source Vector Database |
37 | 44 |
|
38 |
| -The technique gauges the disparity between your query vector and the data vectors. The data vectors that show the closest proximity to your query vector are identified as semantically akin. |
| 45 | +Choosing the best open-source vector database requires considering several factors. Performance and scalability of the database are crucial, as these determine whether the database can handle your specific vector data requirements. Databases with efficient indexing and querying capabilities usually offer optimal performance. |
39 | 46 |
|
40 |
| -## How does vector search work in Azure Cosmos DB for MongoDB vCore? |
| 47 | +Another factor is the community support and documentation available for the database. A robust community and ample documentation can provide valuable assistance. Comparing different open-source vector database options based on features, supported data types, and compatibility with existing tools and frameworks is critical to finding the best fit for your needs. Ease of installation, configuration, and maintenance should also be considered to ensure smooth integration into your workflow. |
41 | 48 |
|
42 |
| -You can truly harness the power of RAG through the native vector search capability in Azure Cosmos DB for MongoDB vCore. This feature combines AI-focused applications with stored data in Azure Cosmos DB. |
| 49 | +Here are some popular open-source vector databases: |
43 | 50 |
|
44 |
| -Vector search optimally stores, indexes, and searches high-dimensional vector data directly within Azure Cosmos DB for MongoDB vCore, alongside other application data. This capability eliminates the need to migrate data to costlier alternatives for vector search functionality. |
| 51 | +- Chroma |
| 52 | +- Milvus |
| 53 | +- Qdrant |
| 54 | +- Weaviate |
45 | 55 |
|
46 |
| -## Code samples and tutorials |
| 56 | +## Challenges with Open-source Vector Databases |
47 | 57 |
|
48 |
| -- [.NET tutorial - recipe chatbot](https://github.com/microsoft/AzureDataRetrievalAugmentedGenerationSamples/tree/main/C%23/CosmosDB-MongoDBvCore): Walk through creating a recipe chatbot by using .NET, to showcase the application of RAG in a culinary scenario. |
49 |
| -- [Python notebook tutorial - Azure product chatbot](https://github.com/microsoft/AzureDataRetrievalAugmentedGenerationSamples/tree/main/Python/CosmosDB-MongoDB-vCore): Learn how to construct an Azure product chatbot that highlights the benefits of RAG. |
| 58 | +Open-source vector databases pose challenges that are typical of open-source software: |
50 | 59 |
|
51 |
| -## Next steps |
| 60 | +- Setup: Users need in-depth knowledge to install, configure, and operate, especially for complex deployments. Optimizing resources and configuration while scaling up operation requires close monitoring and adjustments. |
| 61 | +- Maintenance: Users must manage their own updates, patches, and maintenance. Thus, ML expertise would not suffice; users must also have extensive experience in database administration. |
| 62 | +- Support: Official support can be limited compared to managed services, relying more on community assistance. |
| 63 | + |
| 64 | +Therefore, while free initially, open-source vector databases incur significant costs when scaling up. Expanding operations necessitates more hardware, skilled IT staff, and advanced infrastructure management, leading to higher expenses in hardware, personnel, and operational costs. Scaling open-source vector databases can be financially demanding despite the lack of licensing fees. |
| 65 | + |
| 66 | +## Addressing the Challenges with Open-Source Vector Databases |
52 | 67 |
|
53 |
| -- Learn more about [Azure OpenAI embeddings](../../../ai-services/openai/concepts/understand-embeddings.md) |
54 |
| -- Learn how to [generate embeddings using Azure OpenAI](../../../ai-services/openai/tutorials/embeddings.md) |
| 68 | +A fully managed database service, such as the Integrated Vector Database in Azure Cosmos DB for MongoDB vCore, helps developers avoid the hassles from setting up, maintaining, and relying on community assistance for an open-source vector database. The life-time free tier allows developers to enjoy the same financial benefit associated with open-source vector databases, while the service provider handles maintenance, updates, and scalability. When it’s time to scale up operations, switching to paid tier is quick and easy while keeping a low [total cost of ownership (TCO)](introduction.md#low-total-cost-of-ownership-tco). |
| 69 | + |
| 70 | +## Next steps |
| 71 | +> [!div class="nextstepaction"] |
| 72 | +> [Create a lifetime free-tier vCore cluster for Azure Cosmos DB for MongoDB] |
0 commit comments