# Text Embeddings

Text embeddings are numerical vector representations of text that allow software to compare meaning and retrieve semantically related information.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/text-embeddings

> An embedding model maps text into a vector space where related passages tend to have similar representations. These vectors support semantic search and retrieval augmented generation (RAG), helping applications find relevant external information even when a question and its answer use different wording.

Practice exams covering Text Embeddings: [AIF-C01 AWS Certified AI Practitioner](https://blowstack.com/practice-exams/aws-certified-ai-practitioner), [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional).

## 6 key aspects of Text Embeddings

Effective text embedding systems combine compatible models, deliberate chunking, relevant retrieval, lifecycle management, and access-controlled grounding.

1. **Semantic representation**: Embeddings encode learned relationships in numerical vectors, allowing retrieval across different wording. They are useful for meaning-based matches but do not establish that retrieved content is true.
2. **Compatible embedding spaces**: Query and document vectors must come from compatible encoders and configurations. Track model versions and vector dimensions, and plan a corpus re-embedding process when changing models.
3. **Chunking and metadata**: Split documents so each chunk contains enough context to answer realistic questions. Preserve source references, document versions, and access-control metadata with each indexed chunk.
4. **Retrieval before generation**: In embedding-based RAG, vector search identifies passages that become context for a generative model. This supplies external knowledge at inference time without updating the model's weights.
5. **Quality and cost trade-offs**: Embedding inference, index storage, search latency, and retrieved prompt tokens all contribute to application cost. Tune chunk size, retrieval count, and index settings against measured relevance and latency.
6. **Security and grounding**: Protect vectors and source text with appropriate access controls, and enforce user permissions before retrieved content reaches the model. Evaluate source support and citations because relevant retrieval alone does not guarantee a grounded answer.

## Cloud services for Text Embeddings

A typical AWS implementation stores source documents in Amazon S3 and uses Amazon Bedrock Knowledge Bases to process them with an embedding model. The resulting vectors and associated metadata are indexed in a supported store, such as Amazon OpenSearch Service or an appropriate Aurora PostgreSQL configuration. At query time, the application embeds the question, retrieves relevant passages, and supplies those passages to a generative model through Amazon Bedrock. These components have separate responsibilities: document storage preserves source material, embedding models create representations, vector stores perform similarity search, and generative models compose answers.

- **[Amazon Bedrock](https://blowstack.com/tools/cloud-services-hub/amazon-bedrock)**: Provides access to embedding models and generative models. Amazon Bedrock Knowledge Bases manages supported RAG workflows, including chunking, embedding generation, vector-store integration, retrieval, and retrieval-augmented answer generation.
- **[Amazon OpenSearch Service](https://blowstack.com/tools/cloud-services-hub/amazon-opensearch-service)**: Stores and searches embedding vectors using vector search capabilities. Applications can combine semantic retrieval with keyword search and metadata filtering, or use supported configurations as a vector store for Amazon Bedrock Knowledge Bases.
- **[Amazon Aurora](https://blowstack.com/tools/cloud-services-hub/amazon-aurora)**: Aurora PostgreSQL supports the pgvector extension for storing and querying embedding vectors alongside relational data. Supported configurations can serve as a vector store for Amazon Bedrock Knowledge Bases.
- **[Amazon S3](https://blowstack.com/tools/cloud-services-hub/amazon-s3)**: Stores source documents that an embedding pipeline ingests, including documents used by Amazon Bedrock Knowledge Bases. Applications must synchronize relevant source changes and deletions with their retrieval index.

## Text Embeddings exam questions

Real practice exam questions on Text Embeddings, with the correct answer and its explanation.

### Question 1 (AIF-C01)

**Question:**

A consulting firm uses a retrieval-augmented generation (RAG) assistant to answer questions about market research. Document embeddings are stored in an Amazon OpenSearch Service vector index. The firm switches to a different embedding model for user questions but leaves the existing document embeddings unchanged. Although both embedding models produce vectors of the same length, the assistant now retrieves unrelated passages. Which change should the firm make to restore meaningful retrieval?

**Correct answer:** Regenerate the document embeddings with the new embedding model, rebuild the OpenSearch vector index, and use that model for query embeddings.

**Explanation:** Document and query embeddings must use compatible representations for meaningful vector similarity searches. Regenerating the document embeddings with the new model aligns them with query embeddings. Equal vector lengths alone do not establish compatibility.

### Question 2 (AIP-C01)

**Question:**

A medical-device manufacturer is selecting an Amazon Bedrock text embedding model for semantic search over maintenance reports. Reports contain specialized terminology and abbreviations that differ from ordinary English. The current model performs well on public benchmarks but frequently retrieves reports about similar symptoms in the wrong equipment subsystem.

The company has a representative corpus and held-out queries with expert-labeled relevant passages and difficult nonrelevant passages. The replacement must achieve Recall@10 of at least 92% and query-embedding p95 latency below 150 milliseconds at expected production concurrency. Chunking, metadata filters, and vector-search settings must remain fixed during evaluation. Candidate models produce vectors of the same dimensionality but have different architectures and request formats.

Which evaluation approach should the developer use to select a model?

**Correct answer:** Build a separate corpus index for each candidate using that model's documented document-embedding configuration. Encode held-out queries with its corresponding query configuration. Measure Recall@10 using the expert labels, and measure query-embedding p95 latency under expected production concurrency. Select a candidate that satisfies both thresholds.

**Explanation:** This evaluates domain fit through labeled retrieval outcomes while testing the actual online embedding latency requirement. Each candidate needs its own document embeddings and compatible query embeddings; model-specific request formats and retrieval configurations must be respected. Holding the other retrieval variables fixed makes the comparison meaningful.

## Practice Text Embeddings in a full exam

Questions on Text Embeddings in each practice exam, with every answer option and an explanation for each:

- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 4 questions
- [AIF-C01](https://blowstack.com/practice-exams/aws-certified-ai-practitioner): 3 questions

## What is Text Embeddings

Text embeddings represent words, sentences, or passages as arrays of numbers generated by a machine learning model. Their usefulness comes from the relationships between vectors: text with related meaning tends to appear close together under an appropriate similarity measure. For example, a question about “recovering access to an account” may match a document titled “Password reset procedure” without sharing the same keywords. Embeddings capture learned patterns, not guaranteed understanding or factual correctness.

In cloud applications, an ingestion pipeline typically extracts text from documents, divides it into manageable chunks, and sends those chunks to an embedding model. It stores the resulting vectors in a searchable index alongside the source text or references to it, plus metadata such as document version, department, and access permissions. At query time, the application embeds the user's question and searches for similar document vectors. Cosine similarity, dot product, and Euclidean distance are common comparison methods; the correct choice depends on the model and index configuration.

Retrieval augmented generation is an application pattern that retrieves relevant information from an external source and supplies it as context to a generative model. Embeddings commonly power the retrieval step, although RAG can also use keyword search, structured queries, or hybrid retrieval. The retrieved passages, rather than the vectors themselves, usually enter the generation prompt. A service such as Amazon Bedrock Knowledge Bases can orchestrate document ingestion, embedding generation, retrieval, and integration with answer generation.

Typical business applications include employee policy assistants, customer support systems, technical documentation search, and research tools. An employee might ask whether a particular travel expense is reimbursable. A RAG application retrieves passages from the current expense policy and asks a foundation model to answer using that evidence, ideally with source citations. Updating the indexed policy can change the available evidence without retraining the generative model. RAG does not modify the model's weights and is not the same as fine-tuning.

Chunking is an important design decision. Very small chunks may lose qualifications or surrounding context, while very large chunks can mix unrelated subjects and consume more prompt tokens. Overlap can preserve context across boundaries but increases storage and processing. Document structure, language, domain terminology, and embedding model input limits also affect retrieval quality. Evaluate representative questions against expected source passages rather than selecting a model solely by vector size.

Document and query vectors must use a compatible embedding space, normally provided by the same model and version with the appropriate document and query settings. Equal vector dimensions do not make vectors from different models comparable. Changing the embedding model generally requires re-embedding the corpus and rebuilding or migrating the index. Higher-dimensional vectors can increase storage and search costs without necessarily improving results for a particular workload.

Vector similarity is not a probability that a passage is correct or sufficient. Approximate nearest-neighbor indexes trade some retrieval recall for speed, and semantic matching can miss exact identifiers, dates, or product codes. Hybrid keyword and vector search, metadata filters, and reranking can improve relevance. RAG can reduce unsupported answers but does not eliminate hallucinations or malicious instructions embedded in retrieved documents. Apply authorization during retrieval, treat embeddings as potentially sensitive data rather than anonymized text, propagate document updates and deletions, and measure both retrieval quality and answer grounding.

## Learn Text Embeddings in lessons

2 short lessons on Text Embeddings in 2 certification courses.

- AIF-C01: Text Embeddings: retrieving passages by meaning (Premium), https://app.blowstack.com/lessons/text-embeddings-retrieving-passages-by-meaning-aif-c01
- AIP-C01: Text Embeddings: selecting efficient model configurations (Premium), https://app.blowstack.com/lessons/text-embeddings-selecting-efficient-model-configurations-aip-c01
