The `llama-index-embeddings-bedrock` library provides robust integration for Amazon Bedrock embedding models within the LlamaIndex framework. It allows developers to leverage various AWS Bedrock models like Amazon Titan and Cohere for generating text embeddings. The library is actively maintained, with version 0.8.0 released on March 12, 2026, and receives frequent updates to align with LlamaIndex core and Bedrock API changes.
pip install llama-index-embeddings-bedrockVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `BedrockEmbedding` class, configure AWS credentials and region, and generate an embedding for a given text. It highlights using environment variables for sensitive information.
Ensure that text chunks passed to the embedding model are within the model's maximum context length. Adjust LlamaIndex's chunking strategy (e.g., `chunk_size` and `chunk_overlap`) and consider model-specific limitations.
Always ensure the `model_name` passed to `BedrockEmbedding` accurately reflects the model configured in your AWS Application Inference Profile.
Set AWS credentials as environment variables, provide them directly to `BedrockEmbedding` during initialization, or configure an AWS profile, and always specify the `region_name`.
Ensure that the embedding model used for generating vectors matches the expected dimension of your vector store index. Re-index your data if you switch embedding models.
Ensure `region_name` is provided to `BedrockEmbedding` (e.g., `region_name="us-east-1"`) or set the `AWS_REGION_NAME` environment variable. Also check other AWS credential configurations.
Reduce the size of the text chunks being embedded. For LlamaIndex, adjust `chunk_size` and `chunk_overlap` settings in your `Settings` (or `ServiceContext` for older versions) object to ensure chunks adhere to the model's limits.
Ensure consistency in embedding model dimensions. If you intend to use AWS Bedrock embeddings, configure LlamaIndex to use `BedrockEmbedding` for all indexing and querying operations, and re-index your data if the dimensions are mismatched. Explicitly set the embedding model in LlamaIndex's global settings or `ServiceContext`.
Upgrade `llama-index-embeddings-bedrock` to the latest version, which typically has broader `llama-index-core` compatibility. If issues persist, try upgrading `llama-index-core` to its latest version or, as a last resort, downgrade `llama-index-core` to a version compatible with your `llama-index-embeddings-bedrock` (e.g., `pip install llama-index-core==0.10.0`).