AI & DATA / TECHNICAL EXPLAINER

AWS AIP-C01: Vector Search and Embeddings for AWS GenAI

Embeddings convert text, images, and other supported content into numerical vectors so software can compare semantic similarity rather than relying only on exact keywords. Vector […]

In this article

Embeddings convert text, images, and other supported content into numerical vectors so software can compare semantic similarity rather than relying only on exact keywords. Vector search then retrieves items whose embeddings are close to the query vector according to a distance or similarity function. In AWS generative-AI systems, this pattern is central to semantic search, recommendation, and Retrieval-Augmented Generation because it helps applications find relevant evidence before invoking a model.

Semantic retrieval appears in AWS Certified Generative AI Developer – Professional (AIP-C01) as part of the architecture behind RAG, embeddings, vector databases, evaluation, and secure production GenAI systems. For readers building the prerequisite mental model, AWS Certified AI Practitioner covers core AI concepts, while AWS Certified Machine Learning Engineer – Associate (MLA-C01) covers practical aspects of operating model-serving and ML data systems.
MLA-C01 availability now depends on language: the English version finished September 28, 2026; MLA-C02 English beta testing began September 29, while MLA-C01 remains available in Japanese, Korean and Simplified Chinese through January 14, 2027.

Understand what an embedding represents

An embedding index may return semantically similar products even when the query requires an exact SKU. Compare lexical and vector retrieval with labeled relevant source IDs, and use ranking only after authorized candidate selection. Evaluate source freshness, permission scope and whether relevant passages fit within the generator’s limited context. A high similarity score is not proof of record identity. Track index versions, document deletions and any model embedding migration so a quality regression can be traced to the data plane rather than blamed automatically on generation. Bedrock retrieval configuration influences source selection and retrieval depth, so benchmark changes before attributing answer quality shifts to the generation model.
An embedding is a high-dimensional vector produced by a model from an input such as text. Semantically related content should land closer in vector space than unrelated content according to the model’s learned representation.

Embedding quality is task-dependent. A general text embedding model may work well for product documentation but less well for specialized legal or scientific language. Evaluate retrieval on the actual corpus. The vector itself is not a human-readable summary and should be treated as derived data with its own storage, access, and lifecycle requirements.
Query embeddings should use the same compatible embedding space as document vectors. Mixing models or dimensions produces invalid similarity comparisons.

Choose dimensions and vector type deliberately

Current Bedrock Knowledge Bases supports several embedding models and vector configurations. Titan Text Embeddings V2, for example, supports multiple vector dimensions and both floating-point and binary embeddings. Higher dimensions can preserve more information but increase storage and search cost. Binary vectors reduce storage significantly at some loss of precision and require a compatible vector store. Benchmark the quality/cost trade-off rather than choosing maximum dimensions by default.
Binary embeddings can reduce storage and memory significantly, but quality should be measured on the application’s queries. The reduced precision can be acceptable for one corpus and harmful for another. Changing embedding model usually requires re-embedding the corpus because vector spaces are not interchangeable. Plan migration as an index rebuild or blue-green index release rather than updating one setting in place.

Model upgrades therefore require controlled rebuilds and dual-running periods if zero-downtime migration is important. Keep both indexes available until retrieval quality and performance pass validation. Embedding throughput quotas should be included in ingestion planning. Large reindexing jobs can hit request-rate limits even when vector storage has ample capacity.

Use the vector store that matches operations

Bedrock Knowledge Bases supports several vector-store options, including Amazon OpenSearch Serverless and other supported databases or services depending on current Region and feature requirements. OpenSearch Serverless integrates naturally with vector search, security policies, VPC access, metadata, and Bedrock quick-create workflows. Other stores may be better where teams already operate PostgreSQL, graph, or specialized vector infrastructure. The storage-system principle applies: retrieval performance depends on the complete storage/index design, not only the embedding model.
OpenSearch Serverless vector collections support network and data access policies. Keep vector indexes private where the application does not require public access and explicitly allow the Bedrock knowledge-base service role where needed.

Corpus size should be forecast because index technology that performs well for fifty thousand vectors may behave differently at hundreds of millions. Evaluate scaling, sharding, service quotas, and operational cost before the first major ingestion wave. OpenSearch vector indexes have engine and method choices that influence memory and performance. Follow current Bedrock compatibility guidance, including supported engines for knowledge-base features, rather than reusing an old index configuration blindly.

Index text and metadata together

Vector similarity answers “what is semantically close?” but metadata answers “what is allowed and relevant?” Store document ID, source, product, region, effective date, tenant, status, and security labels where needed. Metadata filtering can exclude superseded or unauthorized material before semantic ranking. This is critical in enterprise RAG. Keep metadata schema stable enough that application filters and access rules do not break when ingestion changes. The similarity metric should fit both the embedding model and the index. Vector search engines support metrics such as cosine similarity, dot product, or Euclidean distance depending on the store and configuration. The embedding model and index should be compatible with the selected metric. Do not compare raw score thresholds across models or indexes as if they have the same meaning. Calibrate retrieval thresholds on labeled examples.

Quality should be measured by whether the correct documents appear in useful ranking positions, not by one abstract distance number.
Metadata filtering should be applied before or during retrieval, not after the model receives the results. Tenant, geography, confidentiality, document status, and effective date are common filter dimensions. Metadata cardinality affects filtering and storage. Store fields used for security or retrieval decisions; avoid attaching large arbitrary JSON blobs to every vector when the application never filters or displays them. Domain-specific namespaces or filters can preserve relevance when unrelated corpora compete too strongly. One global semantic space is not automatically ideal for every business domain.

Approximate nearest-neighbor search trades exactness for scale

Large vector collections often use approximate k-nearest-neighbor algorithms such as HNSW to avoid comparing a query with every vector. Approximation can dramatically reduce latency and infrastructure cost. The trade-off is recall. Index parameters, memory, compression, and algorithm choice influence whether the true best neighbors are found. Benchmark search quality and latency under realistic corpus size rather than assuming default ANN settings fit every application.
Vector search performance depends on index size, dimensions, data type, ANN parameters, and hardware or service capacity. Benchmark p50 and p95 search latency after the corpus reaches realistic scale.

Chunking determines what gets embedded

RAG systems usually embed chunks rather than entire documents. Chunk size and overlap influence semantic specificity, retrieval precision, and context completeness. Small chunks improve local relevance but can separate a fact from its explanation. Large chunks preserve context but consume more model tokens and can reduce retrieval precision. Use headings, sections, paragraphs, tables, and document structure where possible instead of fixed character windows alone.
Embedding models have input limits, so ingestion should split long documents before embedding. Truncating a long document silently can omit the exact section users later expect to retrieve. Chunk boundaries should preserve heading and source context in metadata. A retrieved paragraph named only “Section 4” is less useful than one carrying the document title, section hierarchy, and page or location.

Overlap should be justified. Some overlap prevents facts that cross a boundary from being split, but excessive overlap creates near-duplicate vectors that crowd search results and increase storage. Duplicate detection before indexing can improve both cost and retrieval diversity. Corporate knowledge bases often contain exported copies, archived versions, and repeated attachments that would otherwise occupy several top ranks. Retrieval pipelines should also detect unsupported or malformed documents before embedding. A parser that emits empty or corrupted text can create useless vectors that still consume index capacity.

Secure vector data and query paths

A vector index can expose sensitive meaning even if users never see raw documents directly. Protect collection access, network paths, KMS keys, service roles, and metadata filters. Bedrock Knowledge Base service roles need explicit access to sources, models, and vector stores. OpenSearch Serverless also uses data-access and network policies that should allow only intended principals and services. Authorization belongs before retrieval, not after the model has already received protected content.
Authorization filters should be derived from trusted application identity, never from model-generated claims such as “the user is an administrator.” Index namespaces or separate stores can provide stronger tenant isolation where metadata filtering alone is difficult to prove. The trade-off is more operational objects to maintain.

Vector-store encryption should include KMS configuration where supported and required by policy. Key rotation and grant changes must be tested because losing decrypt access can make the entire RAG corpus unavailable.

Evaluate retrieval separately from generation

Measure recall, precision, ranking, metadata correctness, and no-result behavior before evaluating final generated answers. If retrieval is wrong, changing the generator may hide rather than solve the problem. Use hard negatives such as old versions, similar product names, wrong geographic policies, and semantically related but unauthorized documents. Bedrock evaluation workflows can help measure knowledge-base retrieval and retrieve-and-generate performance as part of production testing.
Embedding evaluation should use retrieval tasks rather than language-model intuition. Create labeled queries with one or more relevant documents and measure whether the expected evidence appears in the top-k results. Recall at k is useful when missing a relevant document is costly, while precision or ranking metrics matter when irrelevant chunks increase generation noise. The right metric depends on how many retrieved items the application will actually send to the model.

Queries should include synonyms, abbreviations, misspellings, product codes, natural-language descriptions, and exact identifiers. Semantic retrieval performs differently across these query classes. Exact identifiers may require lexical search or hybrid retrieval because an embedding can underweight a rare serial number or error code that a keyword engine would match perfectly. Hybrid search can combine vector similarity with lexical relevance when supported by the architecture. Evaluate whether it improves the hard queries enough to justify additional configuration and cost. In Bedrock Knowledge Bases, HYBRID is available only with compatible vector stores that have a filterable text field; unsupported stores use SEMANTIC retrieval. Verify store compatibility before selecting an override.

Reranking is often more cost-effective after a broad approximate search than making the primary vector index extremely expensive. Retrieve a candidate set quickly, then apply a stronger model to reorder only those candidates. Reranking latency should be included in service-level measurements. A retrieval stack that returns better documents but doubles user latency may need conditional use only for difficult query classes. Search relevance should be reviewed after corpus growth. Adding a large new domain can change nearest-neighbor competition and reduce precision for existing queries even when old vectors never change. Relevance evaluation should be segmented by query type. FAQ-style semantic questions, exact entity lookup, error-code search, and multi-concept policy questions can require different retrieval strategies even inside one application.

When one query class performs poorly, route it to a lexical or structured lookup instead of forcing every question through the same vector path. Hybrid systems often outperform one universal retrieval mechanism.

Operate vector search as a living index

Track ingestion success, index size, query latency, retrieval quality, stale documents, deleted-source propagation, and cost. Corpus growth and embedding-model changes can alter search behavior over time. The AWS GenAI architecture is strongest when embeddings and vector search are treated as a governed search layer. The generator should receive evidence because the retrieval system proved it relevant and authorized, not simply because a vector score happened to be high. Blue-green vector indexes can simplify rollback. Build the candidate with the new model or chunking policy, evaluate it, then switch application retrieval only after it passes. Index version should be part of traces and evaluation results. When retrieval changes unexpectedly, operators need to know whether the query hit the old or new corpus representation.

Incremental ingestion should detect add, modify, and delete operations. Deletion is especially important for permissions and privacy because retaining an old vector can keep removed content discoverable. Re-ingestion should avoid producing duplicate vectors for unchanged chunks. Stable document and chunk identifiers help update or replace the correct records. Observability should capture query text hash or safe identifier, retrieval method, filters, top result IDs, scores, latency, and index version according to privacy policy. The mature vector-search service is treated like a search engine with relevance engineering, not like a database that becomes correct after one ingestion job. Evaluation, metadata, authorization, index operations, and query analytics all continue throughout the application lifecycle.

Backup strategy should reflect rebuild cost. Some indexes can be regenerated easily from authoritative S3 sources, while a large processed corpus with expensive preprocessing may justify snapshot or replication. Index health alerts should include write failures and ingestion lag. Query traffic can remain healthy against old data while new documents silently stop entering the index. Vector search is most effective when engineers treat relevance, security, storage, and operations as one system. The embedding is only the mathematical representation; the production value comes from a governed index that returns the right evidence to the right caller at the right time. Vector indexes should have service-level targets for freshness as well as latency. A fast search against yesterday’s policy corpus is still operationally incorrect when users expect current content.

Index cost should include ingestion compute, storage, query capacity, metadata, backup/rebuild strategy, and reranking. The embedding call itself may be only one part of long-term retrieval economics. Index maintenance should include deletion of orphaned vectors whose source records no longer exist, especially after large source migrations or failed sync jobs. Search quality dashboards can track no-result rate, top-k relevance on sampled queries, filter selectivity, and stale-document retrieval. These metrics expose degradation that raw latency cannot. Keep vector index ownership aligned with the corpus owner so relevance and access issues can be corrected by the team that understands the source content. Schedule major rebuilds so they do not starve interactive query traffic or other Bedrock workloads sharing account quotas.

Document embedding model, dimensions, vector type, index engine, distance metric, chunking policy, and metadata schema together so a future migration can reproduce or intentionally change the retrieval behavior.