CLOUD CONCEPT

Vector Search

Vector search retrieves items by comparing numerical representations called vectors and ranking them by similarity to a query vector.

Cloud Concepts Hub →

What is Vector Search

Embedding models represent text, images, audio, or other data as vectors whose relative positions can reflect meaningful relationships. Vector search uses these representations to find related content even when exact words differ, supporting semantic retrieval, recommendations, and retrieval-augmented generation.

Vector search finds items whose numerical representations are close to a query vector under a chosen similarity measure. An embedding is a vector produced by a model to represent characteristics of an input, such as the meaning of a paragraph or the visual features of an image. For example, a search for “recover account access” might retrieve a document titled “Reset your password” even without matching the query's exact wording. Retrieval quality depends on what the embedding model captures; numerical proximity does not prove relevance or factual correctness.

A typical cloud implementation starts with an ingestion pipeline. The pipeline extracts content, divides long documents into useful chunks, generates an embedding for each chunk, and stores each vector with an identifier and metadata. Source text can reside alongside the vector or in another system accessible through the identifier. At query time, the application embeds the query into a compatible vector space and retrieves the closest matching records. Query and document embeddings must use compatible models and configurations; matching vector dimensions alone does not make unrelated embedding spaces comparable.

In retrieval-augmented generation, or RAG, the application supplies retrieved passages to a foundation model as context. For an internal support assistant, vector search can retrieve troubleshooting instructions that the model uses to draft an answer with source references. The vector database stores and searches embeddings; it does not inherently generate embeddings or write answers. Retrieval does not retrain the foundation model, and providing relevant context does not guarantee that the generated answer will be correct.

Several cloud storage patterns support this design. Amazon OpenSearch Service provides vector indexing and search alongside lexical search and metadata filtering. Amazon Aurora PostgreSQL-Compatible Edition and Amazon RDS for PostgreSQL support the pgvector extension, allowing embeddings to reside near relational records and participate in SQL queries. Within the Amazon Neptune family, Neptune Analytics supports vector similarity search over embeddings associated with graph vertices. This enables similarity retrieval to be combined with relationship analysis. Capabilities differ by engine, deployment option, and extension version, so a service-family name alone is not sufficient to establish support.

Search designs balance accuracy, latency, memory, storage, and update cost. Exact nearest-neighbor search returns the true nearest neighbors under the selected metric. Brute-force exact search compares the query against every eligible vector, while some exact indexing methods can prune candidates without sacrificing exactness. Approximate nearest-neighbor indexes reduce search work at scale but may miss some true nearest neighbors. Their usefulness depends on measured recall and latency for the workload. Cosine similarity, dot product, and Euclidean distance are common comparison methods; select the method and normalization that match the embedding model's guidance.

Vector search does not automatically replace keyword search. Product codes, error identifiers, and precise names often benefit from lexical matching. Hybrid retrieval combines lexical and vector results, and a reranking model can reorder retrieved candidates. Evaluate retrieval with representative questions and relevance judgments rather than interpreting similarity scores as probabilities of correctness. Chunk size, metadata filters, candidate counts, and embedding quality all affect results.

Operational controls are essential. Enforce tenant and document permissions before retrieved content reaches the model; semantic similarity is not authorization. Propagate source updates and deletions to the vector store, and track embedding model versions. Changing models generally requires re-embedding the corpus and rebuilding or migrating indexes. Budget for embedding generation, ingestion, index capacity, replication, and queries. Protect embeddings as potentially sensitive derived data rather than assuming they anonymize their source content.

Key aspects of Vector Search

Effective vector search combines compatible embeddings, suitable similarity measures, evaluated indexing strategies, authorized retrieval, and disciplined data lifecycle management.

Compatible embedding representations

Represent content and queries as vectors in a compatible embedding space. Choose a model appropriate for the data and retrieval task, and track its version, dimensions, and configuration.

Similarity measures

Rank candidates using measures such as cosine similarity, dot product, or Euclidean distance. Follow the embedding model's guidance because normalization and metric choice can change the ranking.

Exact and approximate retrieval

Exact search preserves the true nearest-neighbor result, whether implemented through exhaustive scanning or an exact index. Approximate indexes can improve latency or resource usage at the cost of potentially missing true neighbors, so measure recall under realistic workloads.

Filtering and hybrid retrieval

Combine vector similarity with constraints such as tenant, language, product, and document status. Add lexical retrieval when exact terms matter, and verify that filtering preserves authorization and sufficient result coverage.

Foundation-model grounding

Retrieve relevant passages as external context for RAG instead of placing the entire knowledge base into every prompt. This supports grounded answers but does not eliminate generation errors or replace evaluation.

Index lifecycle and security

Keep embeddings synchronized with source changes, deletions, and permissions. Plan model migrations and protect vectors, metadata, and retrieved text according to their sensitivity.

Cloud services for Vector Search

An embedding model, such as one available through Amazon Bedrock, converts source content and queries into compatible vectors. OpenSearch Service provides a search-oriented backend, while Aurora PostgreSQL-Compatible Edition and RDS for PostgreSQL support SQL-based vector storage through pgvector. Neptune Analytics supports retrieval involving graph embeddings and relationships. These services are usually alternative retrieval backends, not components every application must deploy together. An application or supported managed RAG workflow retrieves authorized passages from the selected backend and supplies them to a foundation model. Ingestion processes maintain source freshness, embedding consistency, and deletion handling.

Amazon OpenSearch Service image Amazon OpenSearch Service

Stores and indexes embeddings for vector similarity search and supports combining vector retrieval with lexical search and metadata filters. It is useful when an application needs a search-oriented retrieval layer across multiple content sources.

Open Amazon OpenSearch Service →
Amazon Aurora image Amazon Aurora

Amazon Aurora PostgreSQL-Compatible Edition supports the pgvector extension for storing and searching embeddings with SQL. Applications can combine vector retrieval with relational records and joins; do not assume the same extension support applies to Aurora MySQL-Compatible Edition.

Open Amazon Aurora →
Amazon Neptune image Amazon Neptune

Within the Neptune family, Amazon Neptune Analytics supports storing embeddings associated with graph vertices and performing vector similarity searches. Applications can combine similarity retrieval with graph relationships; distinguish these capabilities from those of Neptune Database.

Open Amazon Neptune →
Amazon Bedrock

Provides access to embedding models and foundation models used around the retrieval pipeline. Amazon Bedrock Knowledge Bases can orchestrate supported RAG workflows with compatible vector stores, but model invocation itself is not a vector database.

Open Amazon Bedrock →