How aws-samples/sample-logistics-agent-agentcore-runtime works
This sample deploys a logistics-tracking agent on Amazon Bedrock AgentCore Runtime, connected privately to PostgreSQL in RDS. The principal workflow is a query sent to the runtime, handled by the agent and its shipment tools, then answered using database results and an OpenAI model. The README also documents the VPC/RDS foundation and a helper-instance workflow for loading schema and seed data. Source excerpts show the agent and CDK wiring; CloudFormation relationships below rely on README descriptions, not inspection of template contents.
Main entry points: rds-vpc-setup.yaml Shipment database · app.py CDK app · agent.py Strands agent · logistics_agent_runtime_stack.py AgentCore Runtime
Components 17
Agent query runtime
- Invocation client
cdk/invoke_agent.py - AgentCore Runtime
cdk/logistics_agent_runtime_stack.py - Query entrypoint
agent/agent.py - Strands agent
agent/agent.py - Shipment tools
agent/agent.py - OpenAI model
agent/agent.py
Shipment data
- DB configuration
agent/agent.py - Shipment database
infrastructure/rds-vpc-setup.yaml - Database schema
infrastructure/schema.sql - Shipment seed data
infrastructure/seed_data.sql
AWS infrastructure
- Parameter Store
- Secrets Manager
- DB setup helper
infrastructure/db-setup-helper.yaml - Private network
infrastructure/rds-vpc-setup.yaml - CDK app
cdk/app.py
Other components
- User
- OpenAI API
Connections 20
- User → Invocation client: submits query
cdk/invoke_agent.py - Invocation client → AgentCore Runtime: invokes
cdk/invoke_agent.py - AgentCore Runtime → Query entrypoint: runs agent code
cdk/logistics_agent_runtime_stack.py - Query entrypoint → Strands agent: executes query
agent/agent.py - Strands agent → Shipment tools: dispatches tools
agent/agent.py - Strands agent → OpenAI model: uses model
agent/agent.py - OpenAI model → Secrets Manager: loads API key
agent/agent.py - OpenAI model → OpenAI API: sends model requests
agent/agent.py - Shipment tools → DB configuration: opens connection
agent/agent.py - DB configuration → Parameter Store: reads parameters
agent/agent.py - DB configuration → Secrets Manager: loads credentials
agent/agent.py - Shipment tools → Shipment database: queries shipments
agent/agent.py - Private network → Shipment database: hosts privately
README.md - DB setup helper → Database schema: loads schema
README.md - DB setup helper → Shipment seed data: loads seed data
README.md - Database schema → Shipment database: defines tables
README.md - Shipment seed data → Shipment database: populates data
README.md - CDK app → AgentCore Runtime: creates stack
cdk/app.py - CDK app → Private network: receives network IDs
cdk/app.py - CDK app → Shipment database: receives DB secret ARN
cdk/app.py