Skip to content
AI.info

The Pulse

AWS details open-source stack for Bedrock WhatsApp agents

AWS has described an open-source toolkit for connecting WhatsApp conversations to agents running on Amazon Bedrock AgentCore. The sample stack handles messaging, memory and scheduling, but AWS says its code is for non-production use.

AWS details open-source stack for Bedrock WhatsApp agents

Developers can use an open-source toolkit to connect WhatsApp conversations to AI agents running on Amazon Bedrock AgentCore, with infrastructure for message handling, memory and scheduling. Amazon Web Services described the Python software development kit and Terraform stack in a post on November 17. AWS says its sample code is for non-production use.

The toolkit, called Social Messaging Agent Runtime Toolkit, or SMART, supplies the messaging layer around an agent. A developer supplies an agent running on AgentCore and retains control over its framework, model, prompt and business logic. AWS says one command deploys the infrastructure to the developer’s AWS account.

Handling the conversation

The post says integrating an agent with WhatsApp requires configuring more than 10 AWS services, alongside handling different message types, media and conversation history. Messages sent more than 24 hours after a user’s last message must use a pre-approved Meta message template.

Incoming WhatsApp messages reach AWS End User Messaging Social and are routed to the processing layer. For each event, an AWS Lambda function verifies the Amazon Simple Notification Service message signature, normalizes the payload and applies a per-user rate limit. With the optional DynamoDB state table enabled, the default limit is 20 messages per minute.

Voice notes are sent through Amazon Transcribe, while other media is turned into a descriptor or passed to a developer-defined handler. After processing, the webhook function passes the message to the AgentCore runtime, which runs the agent.

Memory and outbound messages

AgentCore memory keeps conversation history across sessions and deployments, scoped to each phone number. The default retention period is seven days. Messages generated by tools while an agent is still working are collected and sent in order after the turn finishes.

Separate functions handle notifications outside an agent turn, including proactive and scheduled messages. External systems can trigger event handlers through an Amazon API Gateway endpoint protected by an API key and a Lambda authorizer. Amazon EventBridge Scheduler handles timed outreach such as reminders and recurring check-ins.

The Terraform stack creates an Amazon Bedrock Guardrails resource by default. Developers can use that resource, supply their own guardrail or opt out. The post says the choice of controls is up to the developer.

Starting and deploying

AWS says memory is wired automatically for agents built with Strands Agents; other frameworks, including LangGraph and Pydantic-AI, can also integrate. The toolkit includes three project blueprints. The minimal blueprint is an echo agent without tools, skills or message templates.

The other two blueprints provide a personal assistant and an appointment scheduler. The appointment agent walks users through items and time slots, confirms bookings, stores them as per-user state and sends reminders.

Deployment requires AWS End User Messaging Social with a linked WhatsApp Business Account and registered phone number. It also requires an AWS account with AgentCore runtime and memory available in the relevant AWS Region, plus model access. The local prerequisites include Python 3.11 or later, Terraform 1.7 or later, uv and the AWS Command Line Interface.

AWS says the agent container image and Lambda layer are built in AWS CodeBuild during deployment, so Docker is not required locally. The post advises teams to work with their security and legal teams on organizational security, regulatory and compliance requirements before deployment.

Source

  1. Amazon Web Services

Companies in this story

Related stories

Explore

More articles