Skip to content

add AWS AgentCore zero code example#131

Open
mesutoezdil wants to merge 1 commit intoagentevals-dev:mainfrom
mesutoezdil:feature/agentcore-zero-code-example
Open

add AWS AgentCore zero code example#131
mesutoezdil wants to merge 1 commit intoagentevals-dev:mainfrom
mesutoezdil:feature/agentcore-zero-code-example

Conversation

@mesutoezdil
Copy link
Copy Markdown

@mesutoezdil mesutoezdil commented May 1, 2026

Closes #93

Adds a zero code example for AWS AgentCore.

AgentCore runs on Strands Agents with Amazon Bedrock models.

The setup follows the same pattern as the existing Strands example: StrandsTelemetry with an OTLPSpanExporter pointed at the agentevals receiver.

To run:
pip install -r examples/zero-code-examples/agentcore/requirements.txt
export AWS_DEFAULT_REGION=us-east-1
agentevals serve --dev
python examples/zero-code-examples/agentcore/run.py

@mesutoezdil
Copy link
Copy Markdown
Author

mesutoezdil commented May 1, 2026

Imports work. OTel setup follows the same pattern as the existing Strands example. roll_die and check_prime tool logic is correct.

@mesutoezdil
Copy link
Copy Markdown
Author

mesutoezdil commented May 1, 2026

Tested the OTel pipeline locally (agentevals serve --dev) using a separate script with Strands and a Nebius Cloud endpoint in place of BedrockModel. The actual run.py was not executed end to end.
I do not have an AWS account..

What was verified:

  • StrandsTelemetry sets up the tracer provider correctly
  • OTLPSpanExporter sends spans to agentevals on port 4318
  • roll_die and check_prime are called and captured in traces
  • Sessions showed up in agentevals

What still needs AWS to verify:

  • BedrockModel connecting to Amazon Bedrock
  • e2e tests in tests/integration/test_live_agents.py (skipped without AWS_DEFAULT_REGION)

I think, it will work.

@mesutoezdil mesutoezdil force-pushed the feature/agentcore-zero-code-example branch from 7790773 to e79db6f Compare May 1, 2026 18:03
@mesutoezdil mesutoezdil force-pushed the feature/agentcore-zero-code-example branch 2 times, most recently from 6f8a84d to 18b69d7 Compare May 1, 2026 18:48
@krisztianfekete
Copy link
Copy Markdown
Contributor

krisztianfekete commented May 4, 2026

Hi, thanks for the PR!

Apologies for not being clearer in #93, but this PR seems to be adding another Strands example via Bedrock models, but not really an AgentCore example. We are looking for an example running on/using AgentCore runtime/SDK, e.g. via https://github.com/aws/bedrock-agentcore-sdk-python.

If I understand correctly, you can use agentcore dev for local testing, so having an AWS account might not be a hard requirement to test traces.

@mesutoezdil
Copy link
Copy Markdown
Author

mesutoezdil commented May 4, 2026

@krisztianfekete thanks.

Rewrote the example to use BedrockAgentCoreApp from bedrock-agentcore-sdk-python.

The handler is now an async generator decorated with @app.entrypoint and the server starts with app.run(), which is the AgentCore runtime pattern.

You were right about AWS not being a hard requirement for tracing.

Strands still exports OTLP spans even when BedrockModel raises NoCredentialsError, so all three e2e tests pass without AWS credentials.

…ntCoreApp

Wraps a Strands agent with BedrockAgentCoreApp from bedrock-agentcore-sdk-python.
The handler uses @app.entrypoint and the server starts with app.run(), matching
the AgentCore runtime pattern.

E2E tests use subprocess.Popen, wait for /ping, then POST to /invocations.
Tests pass without AWS credentials because Strands exports OTLP spans even
when BedrockModel raises NoCredentialsError.
@mesutoezdil mesutoezdil force-pushed the feature/agentcore-zero-code-example branch from 466d35a to acb22d9 Compare May 4, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add AWS AgentCore zero code example

2 participants