Explain it simpler
An embedding is a long list of numbers that captures the meaning of a piece of text, so that texts with similar meanings get similar lists. Vector search means finding the stored lists closest to the list for your question. Cosmos DB can do this inside the same documents you already store. To make it work, you first tell the container where the numbers live in each document, what kind of numbers they are, how many there are, and how to measure closeness. Then you add a special vector index, like adding a map that groups similar items together so the database does not have to compare against everything. Finally you ask, in a query, for the five items closest to your question.
Tomas at Riverbend Appliances, a fictional home-goods maker, is building a support assistant that answers questions from 40,000 pages of product manuals. His first prototype sends every manual chunk to a separate vector database, then joins the results back to product records in Cosmos DB, and the two systems keep drifting out of sync. A teammate asks why they cannot just keep the embeddings inside the same Cosmos DB items. Tomas tries, creates a container, inserts vectors and runs a similarity query, and it is slow and expensive. What did he forget to configure before he loaded a single item?
Embedding models turn text or images into vectors: long arrays of numbers where items with similar meanings sit close together in a high-dimensional space. Vector search finds the stored items whose vectors are nearest to a query vector. Cosmos DB for NoSQL can store embeddings inside the same JSON items as your operational data and search them, so a retrieval-augmented generation (RAG) app does not need a separate vector database to keep in sync. The feature must be enabled on the account first, through the vector search capability for the NoSQL API, before containers can use vector policies.
Keep reading for free
Create a free StudyToCert account to read the rest of this lesson: 8 more sections, 6 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.