awslabs / awslabs/agentcore-samples

Amazon Bedrock AgentCore Samples – [Proposal] Add Nova Sonic Real-Time Voice Agent Example

Open
#73 0 comments 0 reactions 0 assignees View on GitHub
03-integrations agentic-frameworks enhancement
Dominant language
Python
Stars
3.4k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
30

Description

**Background**
The current integrations folder includes examples for Strands Agents, LangChain, and CrewAI, but there is no sample demonstrating how to host a real-time speech-to-speech agent using Amazon Nova Sonic within AgentCore Runtime.

**Proposal**
Create a new subfolder under `03-integrations/` named `04-nova-sonic-voice-agent` that includes:

- A FastAPI backend using the AgentCore Python SDK to invoke AgentCore Runtime sessions.
- A WebSocket endpoint that manages bidirectional audio streaming to/from Amazon Nova Sonic.
- Integration of AgentCore Memory to persist conversation history across audio chunks.
- Use of built-in AgentCore tools (e.g., Code Interpreter) to demonstrate dynamic function calling during a voice conversation.
- Sample Jupyter Notebook walkthrough and a complete README with setup, deployment steps, and architecture diagram.

**Acceptance Criteria**

- Developers can clone the repo and run `uvicorn main:app --reload` to start the voice agent.
- The voice agent maintains session context for multi-turn conversations lasting up to 8 hours.
- Memory persistence is demonstrated by recalling earlier user inputs in later turns.
- The sample includes code snippets for starting/stopping sessions, streaming audio, and handling tool calls.
- CI workflow verifies that the example builds and passes basic smoke tests.

**Additional Context**

- Leverage the existing Nova Sonic WebSocket code examples as a foundation: https://docs.aws.amazon.com/nova/latest/userguide/speech-code-examples.html
- Reference community FastAPI demo: https://github.com/aws-samples/sample-nova-sonic-agentic-chatbot
- Highlight the advantages of AgentCore Runtime over AWS Lambda for long-running audio sessions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.