An embedding is a model-generated list of numbers that represents an item—such as a passage of text—in a form computers can compare. A vector database stores and indexes those numerical representations so an application can find items whose vectors are near a query vector. The model creates the representation; the database retrieves candidates. Together, they can support semantic search and retrieval-augmented generation (RAG), but they do not guarantee that a result is relevant or factually correct.
What is an embedding?
An embedding is a numerical vector produced by a machine-learning model from an input such as text, an image, or audio. The model maps inputs into a vector space in which proximity can represent a learned relationship. For example, passages about similar concepts may be near one another even if they use different words. The exact coordinates depend on the model and the data it was trained on; they are not usually human-readable labels or features.
As an Amazon Associate I earn from qualifying purchases.
Google’s educational material explains how embeddings represent relationships between data points and how their values depend on the training corpus: Google for Developers: Embeddings and Embedding space.
What does a vector database do?
A vector database stores vectors, builds or maintains an index for finding nearby vectors, and returns matches for a query. Applications commonly store each vector alongside the original text or a pointer to it, plus metadata such as a document ID, category, or access rule. The vector supports similarity retrieval; the accompanying data helps the application identify, filter, and display the result.
#1 Best Overall
The embedding model and the database have separate jobs. The model turns content and queries into vectors; the database searches those vectors. Vector search can be provided by a dedicated vector service or as a capability within a broader search, cloud, or database product. For example, Google Cloud documents vector search in BigQuery and Spanner, while Microsoft documents vector fields in Azure AI Search.
How does vector search work?
- Prepare the searchable items. Split or otherwise organize source material into units the application can retrieve, such as paragraphs or document sections. Keep enough source information and metadata to identify and filter each unit.
- Generate and store embeddings. Use an embedding model to turn each item into a vector, then store that vector with its source text or reference and relevant metadata.
- Embed the query. Convert the user’s search query into a vector that is compatible with the document vectors. Query and document representations must be designed to work together; unrelated embedding spaces cannot be meaningfully compared.
- Retrieve nearby candidates. Search the index using the selected distance or scoring method, optionally applying metadata filters, and return the most relevant candidates for the application to inspect or display.
- Use the retrieved content. In RAG, an application can supply selected passages as context to a language model so its answer is grounded in retrieved material. Google Cloud describes vector search as a RAG building block, and Microsoft documents a generative-search pattern using retrieved content: BigQuery vector search and Azure AI Search RAG overview.
Exact search and approximate search
Finding the nearest vectors can be done by comparing a query with every vector or by using an index to reduce the work. The choice affects search cost and the chance of finding the true nearest matches.
| Approach | How it works | Trade-off |
|---|---|---|
| Exact nearest-neighbor search | Calculates distances against every vector in the collection. | Returns exact nearest neighbors, but the amount of work grows with the collection. |
| Approximate nearest-neighbor (ANN) search | Uses an index to narrow the candidates considered. | Can reduce search work and improve scalability, but may miss some true nearest neighbors. |
That missed-match risk is often described as a recall trade-off. Indexes such as ScaNN, DiskANN, HNSW, and IVF are implementation choices, not interchangeable performance guarantees. Results depend on the data, configuration, filters, and workload. Google Cloud describes exact KNN and indexed ANN approaches in its vector search overview; Microsoft Learn discusses vector database options including DiskANN, HNSW, and IVF in its vector database material.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Semantic, lexical, and hybrid search
Semantic search ranks results by learned similarity between vectors. It can retrieve conceptually related material when the query and result use different wording. Lexical search instead matches words or tokens, which is important when the exact characters matter or a term is unfamiliar to the embedding model.
Rank #3
| Search method | Best suited to | Limitation to consider |
|---|---|---|
| Semantic (vector) search | Finding related concepts despite differences in wording. | May not reliably identify an exact code, newly added product name, or proprietary codename. |
| Lexical (keyword) search | Exact phrases, names, codes, SKUs, and other literal terms. | May miss relevant material that expresses the same idea with different words. |
| Hybrid search | Combining semantic matches with exact-term matches. | Requires choosing how to combine or rank the different kinds of results. |
Google’s documentation gives arbitrary product numbers, newly added product names, and proprietary codenames as cases where semantic search can fall short, making keyword retrieval useful alongside vectors: Google Cloud: Hybrid search.
Do you need a separate vector database for RAG?
No. RAG needs a way to create embeddings, retrieve useful source content, and pass that content to a language model; it does not inherently require a separately operated vector database. A dedicated vector service is one option. A search index with vector fields or a relational or cloud database with vector search may also fit, depending on the rest of the application. Google Cloud documents vector search in BigQuery and Spanner, and Microsoft documents it in Azure AI Search.
Rank #4
Choose an architecture against the application’s requirements rather than assuming a dedicated service is automatically better:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match- Embedding fit: Check supported input types and languages, vector dimensions, domain suitability, and whether query and document embeddings are designed to be compared.
- Retrieval quality: Decide whether exact search or ANN is appropriate, measure recall and relevance on representative queries, and determine whether keyword or hybrid retrieval is needed.
- Filtering and data model: Consider metadata filters, permissions, joins, transactional needs, and whether source text and vectors should be managed together.
- Scale and operations: Account for corpus size, update frequency, latency targets, deployment region, scaling approach, and the work of maintaining separate services or data pipelines.
- Cost and portability: Evaluate current embedding-generation, storage, indexing, and service costs, as well as data movement and the effort required to change models or providers.
What vector similarity can—and cannot—tell you
A nearby vector is a candidate ranked according to a model’s learned representation and the configured scoring method. Similarity is not proof that two passages mean exactly the same thing, that a result answers the question, or that a claim is true. A reliable application still needs appropriate filters and access controls, relevance evaluation, and—when a language model generates factual answers—source grounding and validation.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




