AWS releases SMART: spin up a WhatsApp agent on AgentCore with one command
The hard part of a WhatsApp AI agent is the plumbing: webhooks, voice messages, memory, Meta templates and more than 10 AWS services. AWS has published SMART, an open-source toolkit: you write agent.py on Bedrock AgentCore, and the socialagent deploy command provisions all the infrastructure through Terraform. The Webmotors team finished in six weeks instead of the planned two months. If your agent already runs on AgentCore, you may not need to build the WhatsApp channel from scratch.
AI-processed from AWS Machine Learning Blog; edited by Hamidun News
In Latin America, India and Southeast Asia, WhatsApp is the main way customers talk to businesses, so that is the logical place to put an AI agent. The problem is that the agent itself comes together quickly, while connecting it to the messenger eats up weeks. AWS has released SMART (Social Messaging Agent Runtime Toolkit), an open-source Python SDK and Terraform stack that handles the entire channel layer.
What hurts when you connect an agent to WhatsApp
Incoming messages arrive as deeply nested JSON structures whose shape depends on the message type. They have to be verified as authentic and normalized into a single format. Voice messages, images and documents each need their own processing pipeline. Beyond that, you need memory that survives across sessions, reliable schedules for reminders, and secured access for external systems that want to trigger an outgoing message.
Meta's rules add a trap of their own: anything you send more than 24 hours after the customer's last message must go out as a pre-approved template. By AWS's estimate, assembling all of this by hand means configuring more than 10 services and learning WhatsApp behavior that teams usually discover the hard way. The usual choice is between building it yourself and handing it to a third-party service. SMART is a third option, and it runs inside your own AWS account.
How it works
The contract between SMART and the agent is deliberately tiny: the agent receives the text of an incoming message and returns text, optionally with attachments. The agent runs in AgentCore Runtime, and memory lives in AgentCore Memory, automatically keyed to the phone number. By default, history is kept for 7 days. You choose the framework: with Strands Agents, memory connects automatically, and LangGraph or Pydantic-AI can also be plugged in through the same hooks.
In AWS's example, the entire agent.py fits in a few lines. One detail worth noting is the socialagent_notify_context wrapper. If a tool wants to send buttons or an interim status while the agent is still thinking, sending immediately corrupts the conversation history, and the user's next message fails with an error. The wrapper collects such messages and sends them in order once the turn is complete.
Under the hood, incoming events flow through Amazon SNS. A Lambda function verifies the signature, normalizes the data and caps each user at 20 messages per minute (when the DynamoDB table is enabled). It then sends a read receipt and a typing indicator so the conversation doesn't look dead. Amazon Transcribe transcribes voice messages. If the agent crashes or hits its limits, the user gets a clear message instead of silence. Proactive broadcasts go through EventBridge Scheduler, and external systems call API Gateway with a key and a Lambda authorizer. By default, Terraform also creates Bedrock Guardrails: you can keep the defaults, plug in your own, or turn them off entirely.
How to get started and what to do with it
Clone the repository, then run socialagent init to create a project from one of three templates: minimal (an empty echo agent), personal-assistant (memory, schedules, voice, images) and appointment-scheduler (service bookings with reminders). The socialagent dev command runs the real agent and real tools in the terminal with no infrastructure at all; the AWS channels are replaced with stubs. The model call is real, though, so you need Bedrock access and AWS credentials. Local mode does not simulate IAM or Meta template validation, so testing on a deployed stack is still mandatory. Deployment is socialagent deploy, which runs terraform apply under the hood. The container image is built in CodeBuild, so no local Docker is needed.
There is also a step Terraform cannot do: in the WhatsApp Business Account, you must manually set the SNS topic as the event destination. Until you do, incoming messages go nowhere, and without any error. Also note that Meta often reclassifies templates with emoji and a promotional tone as promotional, and a rejected template breaks the deployment. The --force flag sends already-approved templates for re-review, so it is best not to use it unless you have to.
For fleets of bots, there is an optional admin console: reading live conversations with manual replies, managing schedules, restarting Lambda, deployment history, logs and template statuses. Sign-in goes through Cognito with mandatory MFA. Conversations stay with two providers, Meta and AWS, although model calls may be processed in other regions because of Bedrock's cross-region routing.
One caveat matters: AWS explicitly calls the code a sample not intended for production use, and it needs to go through security and legal review. Still, for teams building customer-facing services on WhatsApp on AWS, this is a ready-made foundation. According to AWS, Webmotors cut the project from two months to six weeks and brought its internal team into a controlled production environment before the full launch. The practical takeaway is simple: don't spend a quarter on webhooks and templates, invest in the prompt, tools and business logic.
- Nov 18, 2026Decision models took over 25% of requests in Vercel's router a month after launching
- Nov 18, 2026StarSling Cuts Mastra's Slowest Build from 29 Minutes to 5
- Nov 18, 2026MoEngage Plugs AI Agents Into Its Existing APIs: Glance's Push CTR Up 38%
- Nov 18, 2026AI agent left SOC 27 minutes to respond versus 53 for a junior attacker
Key Questions Answered
What hurts when you connect an agent to WhatsApp?
Incoming messages arrive as deeply nested JSON structures whose shape depends on the message type. They have to be verified as authentic and normalized into a single format. Voice messages, images and documents each need their own processing pipeline. Beyond that, you need memory that survives across sessions, reliable schedules for reminders, and secured access for external systems that want to trigger an outgoing message.
How it works?
The contract between SMART and the agent is deliberately tiny: the agent receives the text of an incoming message and returns text, optionally with attachments. The agent runs in AgentCore Runtime, and memory lives in AgentCore Memory, automatically keyed to the phone number. By default, history is kept for 7 days. You choose the framework: with Strands Agents, memory connects automatically, and LangGraph or Pydantic-AI can also be plugged in through the same hooks.
How to get started and what to do with it?
Clone the repository, then run socialagent init to create a project from one of three templates: minimal (an empty echo agent), personal-assistant (memory, schedules, voice, images) and appointment-scheduler (service bookings with reminders). The socialagent dev command runs the real agent and real tools in the terminal with no infrastructure at all; the AWS channels are replaced with stubs. The model call is real, though, so you need Bedrock access and AWS credentials.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.