Skip to main content
AWS Bedrock is a first-class LLM provider in Cognee. You configure it directly with LLM_PROVIDER="bedrock" and a few AWS environment variables — Cognee talks to Bedrock natively through its built-in Bedrock adapter.

Prerequisites

  • AWS account with Bedrock model access enabled for the models you want to use
  • Python 3.10+
  • Cognee installed with the AWS extra (see below)

Setup (Native Provider)

1. Install Cognee with the AWS extra

2. Configure your .env

Set LLM_PROVIDER="bedrock" and provide your AWS details:

3. Choose an authentication method

The Bedrock adapter supports three ways to authenticate (it uses the first one it finds, in this order):
  1. API key — generate a Bedrock API key on AWS and set it in LLM_API_KEY.
  2. AWS credentials — set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (you can leave LLM_API_KEY unset). If you use temporary credentials (an access key ID starting with ASIA...), you must also set AWS_SESSION_TOKEN.
  3. AWS profile — set AWS_PROFILE_NAME to use a profile from your AWS credentials file (the standard boto3 credential chain).
AWS_REGION is applied with any of these methods, and AWS_BEDROCK_RUNTIME_ENDPOINT optionally overrides the Bedrock runtime endpoint.

Model naming

Use the Bedrock model ID directly in LLM_MODEL — no bedrock/ prefix is needed because the provider is already set to bedrock. Model IDs are region-scoped, so the prefix depends on your region (eu. for Europe, us. for the US, etc.):
  • Amazon Nova: eu.amazon.nova-lite-v1:0, us.amazon.nova-pro-v1:0
  • Anthropic Claude: anthropic.claude-3-5-sonnet-20240620-v1:0
  • OpenAI GPT-OSS: openai.gpt-oss-120b-1:0
The exact model ID (and whether it needs a region prefix) varies by AWS region. Check the AWS Bedrock model catalog for the ID that applies to your region.

Usage Example

Optional: Using a LiteLLM Proxy

A LiteLLM proxy is not required for Bedrock. Use this approach only if you already run a LiteLLM proxy to centralize model routing, credentials, or logging across multiple services.
Use LiteLLM Proxy (not the SDK) for this approach. The proxy runs as a server that Cognee connects to over HTTP.
Install and configure the proxy:
Create a config.yaml:
Start the proxy (it runs on http://localhost:4000 by default):
Then point Cognee at the proxy by treating it as an OpenAI-compatible endpoint:
For detailed proxy setup, see the official LiteLLM Bedrock tutorial.

Troubleshooting

  1. Authentication Errors: Verify your AWS credentials, region, and that Bedrock model access is enabled in the AWS console. For temporary (ASIA...) credentials, ensure AWS_SESSION_TOKEN is set alongside AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY — a session token is not used on its own.
  2. Model Not Found: Confirm the model ID matches your region exactly (including any eu./us. prefix).
  3. Rate Limit / Throttling Errors (BedrockException): When Bedrock returns throttling errors (e.g. Too many requests, ThrottlingException), Cognee automatically retries them with exponential backoff (up to 5 retries). If errors persist, request a quota increase in the AWS console, or enable client-side rate limiting by setting LLM_RATE_LIMIT_ENABLED="true" and tuning LLM_RATE_LIMIT_REQUESTS to stay within your account’s requests-per-minute limit. See Rate Limiting for details.
  4. Connection Issues (proxy only): Check that the LiteLLM proxy is running on the expected port.
To enable verbose LLM logging, set LITELLM_LOG="DEBUG" in your .env.

Resources

LLM Providers

Cognee LLM ConfigurationFull reference for configuring AWS Bedrock and other LLM providers.

AWS Bedrock Models

Available ModelsBrowse all Bedrock models and find the model ID for your region.