Skip to content

AWS Bedrock embedder

Embeds through AWS Bedrock using Cohere Embed English v3. Selected via EMBEDDING_PROVIDER=bedrock.

Enable it

bash
EMBEDDING_PROVIDER=bedrock
BEDROCK_EMBEDDING_MODEL=cohere.embed-english-v3
BEDROCK_REGION=ap-south-1
EMBEDDING_DIMS=1024

pip install boto3 (imported lazily only when this provider is selected).

Configuration

VariableDefaultDescription
EMBEDDING_PROVIDERopenaiSet to bedrock.
BEDROCK_EMBEDDING_MODELcohere.embed-english-v3Bedrock embedding model id.
BEDROCK_REGIONap-south-1AWS region for the bedrock-runtime client.
EMBEDDING_DIMS1024Vector dimension; must match the embedding model.

Notes

  • Credentials come from the ambient AWS role (the ECS task role in staging and prod, or the local AWS profile in dev), so there is no API key to fund or rotate.
  • Cohere v3 uses the query and document distinction: search_query on search, search_document otherwise.
  • Texts are truncated client side to 2000 characters because Bedrock rejects inputs over 2048 characters before token truncation; batches are capped at 96 texts per request.
  • Bedrock returns no token count, so usage is estimated at roughly 4 characters per token; failures raise so callers surface a clean 503.

The memory layer for AI agents.