Skip to content

okahu-demos/aws-strands-agentcore

Repository files navigation

AWS Strands agent in AWS Agentcore

This demo includes a mock travel agent that accepts flight and travel booking requests. The agent code is implemented using AWS Strands agentic framework. The demo scripts helps you to deploy this agent in AWS Agentcore service. The agent is enabled to generate Monocle traces and send those to Okahu cloud.

Prerequisites

  • AWS Bedrock with foundational text LLMs enabled.

  • AWS Agentcore

    • Verify that AgentCore is available in your tenant and region for deployment. Refer to Agentcore FAQ
  • AWS CLI

  • AWS credentials

    • This value can be obtained by running AWS CLI aws sts get-session-token in the Terminal. For more options please refer to AWS instructions on CLI auth.
    • Use the two values from the output:
      "Credentials": {
          "AccessKeyId": "<VALUE>",
          "SecretAccessKey": "<VALUE>"
      }
  • Okahu cloud account

  • Okahu API key

Setup demo environment

  • Start a command line shell
    • Create a Python virtual environment
      • python -m venv .venv
    • Activate the virtual environment
      • On macOS/Linux: source .venv/bin/activate
      • On Windows (Git Bash): source .venv/bin/activate
      • On Windows (Command Prompt): .venv\Scripts\activate.bat
      • On Windows (PowerShell): .venv\Scripts\Activate.ps1
  • Install dependencies in your python environment
    • pip install -r requirements.txt
  • Run Okahu demo setup tool. This will deploy demo agent to AWS Agentcore and setup Okahu tenant for consuming traces from that deployment.
    • okahu_agentcore_demo_setup --key <OKAHU-API-KEY>
    • Verify that you see Demo setup completed successfully at the end

Test the agent

Test in Agentcore Sandbox in cloud

  • Goto Agentcore Sandbox
  • Enter the test prompt in the Input field - Book a flight from San Jose to Seattle for 30 March 2026
    • Bedrock Sandbox

Test locally using Agentcore CLI tool

  • Start command shell and source python env
  • Run Agentcore CLI command
    • agentcore invoke '{"prompt": "<prompt>"}'

View agent traces in Okahu

  • Log in to Okahu portal
  • Click on the AgentCore Travel Agent application tab
  • Click on the Traces tab
  • From the Breakdown dropdown list, select GenAI and then click Search
    • GenAI traces
  • View the traces
    • Traces

Try out tests framework example for the travel agent app

  • Start a command line shell
    • Create a Python virtual environment
      • python -m venv .venv
    • Activate the virtual environment
      • On macOS/Linux: source .venv/bin/activate
      • On Windows (Git Bash): source .venv/bin/activate
      • On Windows (Command Prompt): .venv\Scripts\activate.bat
      • On Windows (PowerShell): .venv\Scripts\Activate.ps1
  • Source python env
  • Install python dependencies
    • pip install -r requirements.txt
  • Run pytest
    • pytest -vv test/test_travel_agent.py

Visualize the telemetry to understand the agent execution

  • Install extension Okahu Trace Visualizer from marketplace for your Kiro IDE (or VSCode, Cursor, Antigravity)
  • This will add the Okahu extension in the list of extension (left pane for VSCode or extension dropdown in Cursor).
  • Click on the extension icon. It'll open a new pane on left that will list the traces for each agent turn in the descending order of execution time.
  • When you click on any of the trace list, it will open a new window with the trace visualization.

About

Travel agent built using Kiro with AWS Strands framework and deployed to AgentCore with Bedrock for LLM inference.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages