Setup
- Before using the AWS Bedrock LLM, make sure you have the appropriate model access from Bedrock Console.
- Model availability is per-region.
anthropic.claude-sonnet-4-20250514-v1:0supports on-demand inference inus-east-1andap-southeast-4; from any other region, use the cross-region inference profile IDus.anthropic.claude-sonnet-4-20250514-v1:0instead. - Install the AWS SDK for your language:
pip install boto3(Python) ornpm install @aws-sdk/client-bedrock-runtime(TypeScript). - Both SDKs fall back to the standard AWS credential chain (environment variables,
~/.aws/credentials, or an attached IAM role), so exportingAWS_REGION,AWS_ACCESS_KEY_ID, andAWS_SECRET_ACCESS_KEYis the quickest way to get started. In TypeScript you can also pass credentials inline withawsRegion,awsAccessKeyId,awsSecretAccessKey, andawsSessionToken, as shown below.
Usage
@aws-sdk/client-bedrock-runtime is an optional peer dependency of mem0ai, so npm will not install it for you. The TypeScript provider loads it lazily and throws a clear error on the first request if the package is missing.The TypeScript provider calls the Bedrock Converse API, a single uniform interface across the current Bedrock model families. Streaming and
InvokeModel-only models are not supported yet.Application inference profiles
Bedrock resolves the model family from the model identifier. An application inference profile ARN ends in an opaque ID, so there is nothing to resolve from. Setprovider_override (Python) / providerOverride (TypeScript) when your model is one:
Unknown provider in model (Python: ValueError; TypeScript: Error). Plain model IDs and cross-region inference profiles such as us.anthropic.claude-sonnet-4-20250514-v1:0 still resolve automatically and need no override.
Config
All available parameters for theaws_bedrock config are present in Master List of All Params in Config.