Certopolis

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.

Written from Amazon Web Services's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A company uses an Amazon Bedrock knowledge base that stores embeddings from Amazon Titan Text Embeddings V2 in an Amazon OpenSearch Serverless vector index. The data source is an Amazon S3 bucket of English product manuals. The company is adding Spanish and Japanese manuals to the same bucket. An evaluation shows poor retrieval for Spanish and Japanese questions. A GenAI developer decides to use the Cohere Embed Multilingual model and must embed every manual, including the English manuals, with that model. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Foundation Model Integration, Data Management, and Compliance building.

    Not that one: C is right. In the game your Foundation Model Integration, Data Management, and Compliance building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The embedding model ARN sits inside knowledgeBaseConfiguration, so the change needs a new knowledge base, a new index sized for the new vectors, and a full ingestion.

    Written from docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateKnowledgeBase.html

  2. A company's RAG application stores 1,024-dimension float embeddings from Amazon Titan Text Embeddings V2 in an Amazon OpenSearch Service vector index. The embeddings use too much memory. The company will re-embed all 30 million text chunks into a new index, with float embeddings that are half the current length. A test run of the re-embedding job, which sends one InvokeModel request for each chunk, is throttled by Amazon Bedrock. The company will request a quota increase so that the full job can finish within 2 days. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Foundation Model Integration, Data Management, and Compliance building.

    Not that one: A is right. In the game your Foundation Model Integration, Data Management, and Compliance building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The Titan embeddings request page (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-embed-text.html) says for V2: "dimensions – (optional) The number of dimensions the output embedding should have. The following values are accepted: 1024 (default), 512, 256." The Titan Text Embeddings models page (https://docs.aws.amazon.com/bedrock/latest/userguide/titan-embedding-models.html) says "Embedding models on Amazon Bedrock are throttled by Requests Per Minute (RPM), not Tokens Per Minute (TPM). When planning capacity or requesting quota increases for embedding models, use the RPM quota."

    Written from docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-embed-text.html

  3. A company runs an Amazon Bedrock knowledge base over 9 million chunks of English product documentation. The knowledge base uses Amazon Titan Embeddings G1 - Text and stores floating-point vectors in a table in an Amazon Aurora PostgreSQL cluster. Vector storage is now the largest cost of the solution. The company will create a new knowledge base and ingest the same Amazon S3 data source again. The new knowledge base must store binary vector embeddings instead of floating-point embeddings. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Foundation Model Integration, Data Management, and Compliance building.

    Not that one: C is right. In the game your Foundation Model Integration, Data Management, and Compliance building would lose a little Renown, and this question would come back later.