Amazon Bedrock AgentCore
This guide shows how to integrate the AgentDuet SDK with Amazon Bedrock AgentCore for hosted agent runtimes with lifecycle management, memory, governed tools, and observability around live phone agents.
This guide uses the FinAssist sample from agentduet-samples. Speech uses Amazon Nova Sonic over Bedrock.
What this integration provides
A voice agent that:
- Starts an AgentDuet listener when the AgentCore runtime comes up
- Answers inbound calls and bridges 24 kHz PCM to Nova Sonic 2
- Keeps eligibility / tool-style actions reachable over AgentCore
invoke - Can deploy the same app to AWS with
agentcore deploy
Demo domain: SecureFinance loans and insurance claims over the phone.
How the pieces fit
For a Nova-only bridge without AgentCore, see Amazon Nova Sonic.
Prerequisites
- Python 3.12+
- Node.js 20+ and the
@aws/agentcoreCLI - AWS credentials with Bedrock access (SSO recommended)
- AgentDuet API key and connector UUID from agentduet.com
uvfor the app virtualenv
Deploy also needs an IAM role with CloudFormation + AgentCore permissions (Bedrock-only access is not enough).
Step 1: Clone the sample
Layout:
Full source: agentduet-samples / bedrock-agentcore / finassist.
Step 2: Install CLI and app deps
Step 3: Configure credentials
- Set your 12-digit AWS account ID in
agentcore/aws-targets.json. - Fill AgentDuet secrets in
agentcore/.env.local:
- Authenticate AWS in the shell (do not commit access keys):
.env.local is for local agentcore dev only. Cloud deploy reads env from agentcore.json (see Step 6).
Step 4: Run locally
Call your AgentDuet connector number. FinAssist should answer as SecureFinance and walk loan or claim intake.
Optional HTTP-style checks against the same process:
Step 5: How AgentCore starts AgentDuet
AgentCore lifespan starts the voice listener. AgentDuet does not own process signals.
Lifespan starts the voice listener
From app/main.py:
SessionManager runs under AgentCore
From app/finassist_agent/voice_service.py:
On shutdown, request_shutdown() disconnects the SessionManager so run_forever exits cleanly.
Invoke and live audio
@app.entrypoint handles status, evaluate_loan, and evaluate_claim. Live calls go through AgentDuet events and the Nova bridge.
Step 6: Deploy to AWS
Set AGENTDUET_API_KEY and AGENTDUET_CONNECTOR_UUID in agentcore/agentcore.json envVars (placeholders ship in the sample). Then:
Notes
- Keep call control and PCM buffering on the AgentDuet path; use invoke for structured actions only.
- Treat call id, customer identity, and AgentCore
context.session_idas separate namespaces. - This sample uses 24 kHz audio (
CallAudioConfig(sample_rate=24000)). - Runtime region and Nova model region can differ (
AWS_DEFAULT_REGIONvsNOVA_SONIC_REGION). - Optional transcript upload when
TRANSCRIPT_S3_BUCKETis set.
