AWS Certified Generative AI Developer – Professional
Bedrock embedding models and vector stores for AIP-C01
An embedding model turns text into a vector, and the vector store indexes those vectors for similarity search. Titan Text Embeddings V2 outputs 1,024, 512 or 256 dimensions and can return binary vectors. The embedding model and vector store of a Bedrock knowledge base are fixed at creation, so changing either means a new knowledge base and a full re-ingestion.
Titan Text Embeddings V2
Model ID amazon.titan-embed-text-v2:0. Input is up to 8,192 tokens or 50,000 characters. Output size is 1,024 (default), 512 or 256 dimensions, set with the dimensions field in the request body. The embeddingTypes field accepts float, binary or both, and defaults to float.
The model is optimized for English and supports many other languages. AWS says cross-language queries, such as a Korean knowledge base queried in German, give sub-optimal results. For retrieval, AWS still recommends splitting documents into logical segments such as paragraphs or sections, even though the model accepts long input.
Embedding models on Amazon Bedrock are throttled by requests per minute (RPM), not tokens per minute. A quota increase for a bulk embedding job should be for the RPM quota.
Vector types and stores
Binary vectors use less storage than float32 vectors. For a knowledge base, Titan Text Embeddings V2 and Cohere Embed support binary vectors, while Titan Embeddings G1 - Text supports floating-point only, at 1,536 dimensions.
Amazon OpenSearch Serverless and Amazon OpenSearch Managed clusters are the only knowledge base vector stores that can store binary vectors. A knowledge base on Aurora PostgreSQL therefore stays on float vectors.
Changing the embedding model
UpdateKnowledgeBase can change only the name, description and roleArn. You can't change knowledgeBaseConfiguration, which holds the embedding model, or storageConfiguration, which holds the vector store.
Example: a team moves from Titan Text Embeddings V2 to Cohere Embed Multilingual for Spanish and Japanese manuals. They create a new knowledge base with the new model and a new vector index, point it at the same S3 bucket, ingest everything again and switch the application to the new knowledge base ID. Old and new vectors can't share one index, because vectors from different models are not comparable.
Where the exam catches people
- Believing UpdateKnowledgeBase can swap the embedding model: only name, description and roleArn can change.
- Believing a throttled embedding job needs a tokens-per-minute increase: Bedrock embedding models are throttled by requests per minute.
- Believing any vector store can hold binary vectors: for knowledge bases only OpenSearch Serverless and OpenSearch Managed clusters can.
- Believing Titan Embeddings G1 - Text can output 512 dimensions or binary vectors: it is floating-point only, and the dimensions option belongs to Titan Text Embeddings V2.