What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

An embedding is a model-generated numerical representation of an item such as text, an image, or audio. A vector database stores and indexes those representations so an application can retrieve items whose vectors are near a query vector. In practice, the embedding model represents content; the search system finds candidates; and the application decides what to do with them.

What is an embedding?

An embedding is a list of numbers produced by a machine-learning model for an input such as a sentence, document, image, or audio clip. The model maps inputs into a vector space, where distance or another similarity score can reflect relationships the model learned. For text, that can make passages about related ideas close even when they do not use the same words.

The coordinates are generally not plain-language labels that reveal what each number means. Their values depend on the model and its training data, so they are useful as a computational representation rather than a human-readable summary. See Google’s introduction to embeddings and its explanation of embedding space.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What does a vector database do?

A vector database stores vectors, organizes them in an index, and searches for vectors near a query vector. It commonly stores each vector alongside the original content or a reference to it, plus metadata such as a document ID, category, or access attributes. That lets an application return readable source material rather than an unexplained list of numbers.

The embedding model and the database have different jobs: the model creates representations; the database or search service retrieves candidates. A dedicated vector database is one option, but vector search is also available in some broader search and database products. Google Cloud documents vector search in BigQuery and Spanner; Microsoft documents vector fields in Azure AI Search.

How vector search works in an application

  1. Prepare the content. Split or otherwise organize searchable material into items appropriate to the task, such as passages from documents. Keep the source text or a reliable reference to it.
  2. Embed each item. Use an embedding model to turn each item into a vector. Store the vector with its source reference and useful metadata.
  3. Embed the query. When a user searches, encode the query using a model compatible with the document vectors. Query and document representations need to be designed for comparison.
  4. Retrieve candidates. Search for vectors near the query vector, optionally applying metadata filters and access rules.
  5. Return and use the source material. Fetch the corresponding text or records, then show them to the user or pass selected passages to a language model as context.

This last pattern is commonly used in retrieval-augmented generation (RAG): retrieval supplies relevant source content to a language model, which can use it when generating an answer. Vector search is one building block, not the whole RAG system; the quality of the answer still depends on retrieving suitable material and grounding the response in it. Google Cloud describes vector search as a RAG building block in its BigQuery overview, and Microsoft outlines a generative-search pattern in its Azure AI Search overview.

Exact search and approximate search

A search system can find nearest neighbors by comparing a query against every stored vector or by using an index to narrow the candidates. The first approach is exact; the second is approximate and can be faster at scale, but may miss some of the true nearest results.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Approach How it works Main tradeoff
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 reduce the amount of search work. Can improve speed and scalability, with a possible reduction in recall.

Index names such as ScaNN, DiskANN, HNSW, and IVF describe implementation choices, not universal performance rankings. Results depend on the data, configuration, filters, and workload. Google Cloud explains the KNN and ANN distinction in its Vector Search overview; Microsoft describes index options in its vector database material.

Vector search versus keyword search

Semantic or vector search ranks results by learned similarity. It can surface conceptually related material even when the query and result use different wording. Lexical search matches words or tokens and is especially useful when the exact term matters: a product code, name, quoted phrase, or recently introduced term that an embedding model may not represent well.

Hybrid search combines vector retrieval with lexical retrieval. It is useful when a query may express either an idea or an exact string. Google’s documentation gives arbitrary product numbers, newly added product names, and proprietary codenames as examples where semantic search alone may fail; its semantic search guidance explains why lexical matching can complement it.

Do you need a separate vector database for RAG?

No. RAG needs a way to create and retrieve relevant representations, but that capability does not have to live in a standalone vector product. You can use a dedicated vector service, a broader search index with vector fields, or a database that supports vector search. Google documents examples in BigQuery and Spanner, while Microsoft documents vector search within Azure AI Search.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keeping vectors and application records together may simplify data management or filtering; a separate service may fit a system whose retrieval workload or operating model calls for one. Neither architecture is automatically better. Choose based on the actual data model, query patterns, scale, operational constraints, and measured relevance needs.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to choose an implementation

Compare options against your workload rather than relying on product labels or generic rankings. Capabilities and prices change, and performance depends on configuration and data.

  • Embedding fit: Check supported content types and languages, vector dimensions, domain suitability, and whether the model is intended to compare query and document embeddings.
  • Retrieval quality: Decide whether exact results are necessary or ANN is acceptable; define recall and latency requirements; evaluate results against representative queries; and check whether lexical or hybrid retrieval is available.
  • Filtering and data model: Consider metadata filters, permissions, joins or transactional requirements, and whether source content and vectors should be managed together.
  • Scale and operations: Estimate collection size and update frequency, set latency targets, choose an appropriate deployment region, and account for scaling and the work of operating separate services or data pipelines.
  • Cost and portability: Check current pricing for embedding generation, storage, indexing, and queries. Consider data movement and how easily you could change models or providers.

What vector similarity does—and does not—tell you

Nearby vectors are candidates ranked according to a model’s representation and the selected distance or scoring method. Proximity does not prove that two passages are factually equivalent, that a result is correct, or that it is appropriate for every user. Use filters and permissions where needed, evaluate relevance on your own queries, and validate source material before relying on generated answers.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.