Skip to content

agilityfeat/agentcore-demo

Repository files navigation

Travel Planner AI Agent

A travel planning agent demonstrating the journey from local PoC to production-ready deployment using Amazon Bedrock AgentCore and Strands Agents SDK.

Architecture Overview

This demo showcases two implementations:

  1. Local PoC Agent (travel_agent_local.py): Simple agent with inline tools for rapid prototyping
  2. Production Agent (travel_agent_production.py): Enterprise-ready agent with:
    • Memory: Short and long-term context via AgentCore Memory
    • Gateway: Centralized MCP-compatible tools via Lambda
    • Identity: OAuth authentication with Cognito
    • Observability: Built-in monitoring and logging

Prerequisites

  • AWS account with credentials configured
  • Python 3.10+
  • Docker or Finch (for local testing)
  • Model Access: Anthropic Claude 3.7 enabled in Amazon Bedrock
  • AWS Permissions: BedrockAgentCoreFullAccess and AmazonBedrockFullAccess

Installation

pip install -r requirements.txt

Quick Start

Step 1: Run Local PoC Agent

No setup required - just run:

python travel_agent_local.py

Interact via CLI:

You: I want to fly from New York to Paris on 2025-06-15
Agent: [response]

Step 2: Deploy Production Agent

Setup AWS resources:

python scripts/setup_memory.py
python scripts/setup_cognito.py
python scripts/setup_gateway.py

This creates:

  • AgentCore Memory with USER_PREFERENCE and SEMANTIC strategies
  • Cognito User Pool and Client for OAuth
  • Lambda function with travel tools
  • AgentCore Gateway with MCP endpoint and JWT auth
  • IAM roles and SSM parameters

Local Testing

Test Production Agent Locally:

python travel_agent_production.py

Then in another terminal:

curl -X POST http://localhost:8080/invocations \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Tell me about Tokyo"}'

Step 3: Deploy to AgentCore Runtime

Deploy production agent to AWS:

python scripts/deploy_runtime.py

This will:

  • Create IAM execution role
  • Build and deploy Docker container
  • Configure Memory, Gateway, and Cognito integration
  • Wait for deployment to be READY

Test deployed agent:

python scripts/test_runtime.py

Cleanup

To delete all created resources:

# If deployed to Runtime
agentcore destroy

# Cleanup AWS resources
python scripts/cleanup_gateway.py
python scripts/cleanup_cognito.py
python scripts/cleanup_memory.py

Example Queries

  • "I want to fly from New York to Paris on 2025-06-15"
  • "Tell me about Tokyo"
  • "What are the top attractions in Sydney?"
  • "Find me flights from Los Angeles to Sydney next month"
  • "I'm planning a trip to London, what should I know?"

Supported Destinations

  • New York ↔ Paris
  • London ↔ Tokyo
  • Los Angeles ↔ Sydney

Additional destinations available for information: Paris, Tokyo, Sydney, London, New York

Key Differences: PoC vs Production

Feature Local PoC Production
Interface CLI HTTP API
Tools Inline Python functions Lambda via Gateway (MCP)
Memory None Short & long-term via AgentCore
Authentication None OAuth with Cognito
Scalability Single instance Auto-scaling Runtime
Monitoring Basic logs Full observability
Deployment Local CLI only AWS-hosted

Memory Capabilities (Production Only)

  • Short-Term Memory: Conversation context within sessions
  • Long-Term Memory:
    • USER_PREFERENCE: Traveler preferences and behavior
    • SEMANTIC: Factual information from conversations

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published