{"id":1810,"library":"bedrock-agentcore","title":"Amazon Bedrock AgentCore Python SDK","description":"The Amazon Bedrock AgentCore Python SDK provides a higher-level abstraction for developing and deploying AI agents on Amazon Bedrock AgentCore. This SDK simplifies operations related to agent runtime, memory, authentication, and tools, offering framework-agnostic primitives. It is actively maintained with frequent releases, currently at version 1.6.0.","status":"active","version":"1.6.0","language":"en","source_language":"en","source_url":"https://github.com/aws/bedrock-agentcore-sdk-python","tags":["aws","bedrock","ai","agents","llm","sdk","generative-ai"],"install":[{"cmd":"pip install bedrock-agentcore","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required Python version.","package":"python","version":">=3.10"},{"reason":"Underlying AWS SDK for interacting with Bedrock AgentCore APIs.","package":"boto3","version":">=1.39.8"},{"reason":"Underlying AWS SDK dependency, often needs to be updated with boto3.","package":"botocore","version":">=1.33.8"}],"imports":[{"symbol":"BedrockAgentCoreApp","correct":"from bedrock_agentcore.agent import BedrockAgentCoreApp"},{"symbol":"entrypoint","correct":"from bedrock_agentcore.agent import entrypoint"},{"symbol":"MemorySessionManager","correct":"from bedrock_agentcore.memory import MemorySessionManager"}],"quickstart":{"code":"import os\nfrom bedrock_agentcore.agent import BedrockAgentCoreApp, entrypoint\n\n# Initialize the AgentCore application\napp = BedrockAgentCoreApp(\n    region_name=os.environ.get('AWS_REGION', 'us-east-1')\n)\n\n# Define your agent's entrypoint\n@app.entrypoint()\ndef handler(event):\n    \"\"\"Handles incoming agent invocations.\"\"\"\n    prompt = event.prompt\n    # In a real agent, you would process the prompt, use tools, or interact with memory.\n    response_content = f\"Hello from your AgentCore agent! You said: {prompt}\"\n    \n    # The response must be a dictionary with a 'response' key for simple text responses\n    return {\"response\": response_content}\n\n# To run the agent locally (for development and testing)\n# Make sure to set AWS_REGION and have AWS credentials configured.\n# The `app.run()` method starts a local HTTP server on port 8080.\n# You can test it with `curl -X POST http://localhost:8080/invocations -H \"Content-Type: application/json\" -d '{\"prompt\": \"What's up?\"}'`\nif __name__ == \"__main__\":\n    print(\"Starting Bedrock AgentCore agent locally. Access at http://localhost:8080/invocations\")\n    print(\"Ensure AWS_REGION environment variable is set and AWS credentials are configured.\")\n    app.run()","lang":"python","description":"This quickstart demonstrates how to define a simple AI agent using the `bedrock-agentcore` SDK. It initializes a `BedrockAgentCoreApp` and registers a handler function with the `@entrypoint` decorator. The agent echoes back the received prompt. The `app.run()` method allows for local testing by starting an HTTP server. Remember to set your AWS region and configure AWS credentials for local execution."},"warnings":[{"fix":"Review your observability setup if you were leveraging OTEL attributes from AgentCore Evaluation. You may need to adjust your tracing configuration or find alternative metrics.","message":"Version 1.5.1 reverted the feature to emit OTEL (OpenTelemetry) attributes for AgentCore Evaluation support. If your application relies on these specific OTEL attributes for observability, this change will break that integration.","severity":"breaking","affected_versions":"1.5.1"},{"fix":"Ensure your AWS identity has `bedrock-agentcore:CreateAgentRuntime` and other necessary permissions. Verify the agent's execution role grants required permissions to interact with Bedrock services and any tools it uses. Consult AWS IAM documentation for Bedrock AgentCore specific policies.","message":"AccessDeniedException is a common issue due to insufficient IAM permissions for the caller or the agent's execution role. This can occur during agent creation or runtime invocation.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update `boto3` and `botocore` to their latest versions: `pip install --upgrade boto3 botocore`. Ensure both are at or above the minimum required versions (boto3 1.39.8+, botocore 1.33.8+).","message":"Using outdated `boto3` or `botocore` libraries can lead to `Unknown service: 'bedrock-agent-core-runtime'` errors when attempting to interact with Bedrock AgentCore APIs.","severity":"gotcha","affected_versions":"<1.39.8 (boto3) or <1.33.8 (botocore)"},{"fix":"Always explicitly specify the `region_name` when initializing SDK clients, or consistently set the `AWS_REGION` environment variable in your deployment environment to avoid ambiguity.","message":"The AWS region resolution order can be complex. If not explicitly passed as a parameter to SDK clients, the region is determined by `boto3_session`, `AWS_REGION` environment variable, `AWS_DEFAULT_REGION`, or falls back to `us-west-2`. Inconsistent region configuration can lead to resources not found or `AccessDeniedException` if the agent attempts to operate in an unintended region.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}