Live
Black Hat USADark ReadingBlack Hat AsiaAI BusinessPakistan’s peace plan a ‘critical opportunity’ for US-Iran talks ahead of Trump deadlineSCMP Tech (Asia AI)Why Microservices Struggle With AI SystemsHackernoon AIAgentic AI Vision System: Object Segmentation with SAM 3 and QwenPyImageSearchSpain s Xoople raises $130 million Series B to map the Earth for AITechCrunch AIWhy APEX Matters for MoE Coding Models and why it's NOT the same as K quantsReddit r/LocalLLaMAAt least 80 different Microsoft Copilot products have been mapped out by expert, but there may be more than 100 — Microsoft doesn't have a singular list available, so AI consultant mapped out the myriad products - Tom's HardwareGNews AI MicrosoftGoogle Study: AI Benchmarks Use Too Few Raters to Be Reliable - WinBuzzerGNews AI benchmarkNvidia Stock Rises. This Issue Could Hamper Its Next-Generation AI Chips. - Barron'sGNews AI NVIDIABroadcom's CEO Has Line of Sight to $100 Billion in AI Chip Revenue. Is the Stock a Buy? - The Motley FoolGoogle News: AI‘This is 160-million-year-old Jurassic clay’: inside Es Devlin’s bid to reshape AI ethics – through potteryThe Guardian AI‘This is 160-million-year-old Jurassic clay’: inside Es Devlin’s bid to reshape AI ethics – through pottery - The GuardianGNews AI ethicsI gave Claude Code our entire codebase. Our customers noticed. | Al Chen (Galileo)lennysnewsletter.comBlack Hat USADark ReadingBlack Hat AsiaAI BusinessPakistan’s peace plan a ‘critical opportunity’ for US-Iran talks ahead of Trump deadlineSCMP Tech (Asia AI)Why Microservices Struggle With AI SystemsHackernoon AIAgentic AI Vision System: Object Segmentation with SAM 3 and QwenPyImageSearchSpain s Xoople raises $130 million Series B to map the Earth for AITechCrunch AIWhy APEX Matters for MoE Coding Models and why it's NOT the same as K quantsReddit r/LocalLLaMAAt least 80 different Microsoft Copilot products have been mapped out by expert, but there may be more than 100 — Microsoft doesn't have a singular list available, so AI consultant mapped out the myriad products - Tom's HardwareGNews AI MicrosoftGoogle Study: AI Benchmarks Use Too Few Raters to Be Reliable - WinBuzzerGNews AI benchmarkNvidia Stock Rises. This Issue Could Hamper Its Next-Generation AI Chips. - Barron'sGNews AI NVIDIABroadcom's CEO Has Line of Sight to $100 Billion in AI Chip Revenue. Is the Stock a Buy? - The Motley FoolGoogle News: AI‘This is 160-million-year-old Jurassic clay’: inside Es Devlin’s bid to reshape AI ethics – through potteryThe Guardian AI‘This is 160-million-year-old Jurassic clay’: inside Es Devlin’s bid to reshape AI ethics – through pottery - The GuardianGNews AI ethicsI gave Claude Code our entire codebase. Our customers noticed. | Al Chen (Galileo)lennysnewsletter.com
AI NEWS HUBbyEIGENVECTOREigenvector

Multichannel AI Agent: Shared Memory Across Messaging Platforms

Dev.to AIby Elizabeth Fuentes LApril 6, 20266 min read0 views
Source Quiz

Build an AI chatbot that remembers users across WhatsApp and Instagram using Amazon Bedrock AgentCore, unified identity, and DynamoDB message buffering You send a video on WhatsApp. You switch to Instagram. You ask about the video. The chatbot has no idea what you are talking about. Most AI chatbots treat every channel as a separate conversation with no shared context, no shared memory, and no continuity. I built a multichannel AI agent that solves this problem using Amazon Bedrock AgentCore . One deployment serves both WhatsApp and Instagram with shared memory. The agent remembers your name, your photos, your videos, and your preferences regardless of which channel you write from. Assumes familiarity with AWS CDK , AWS Lambda , and WhatsApp/Instagram API concepts. Deployment takes approxi

Build an AI chatbot that remembers users across WhatsApp and Instagram using Amazon Bedrock AgentCore, unified identity, and DynamoDB message buffering

You send a video on WhatsApp. You switch to Instagram. You ask about the video. The chatbot has no idea what you are talking about. Most AI chatbots treat every channel as a separate conversation with no shared context, no shared memory, and no continuity. I built a multichannel AI agent that solves this problem using Amazon Bedrock AgentCore.

One deployment serves both WhatsApp and Instagram with shared memory. The agent remembers your name, your photos, your videos, and your preferences regardless of which channel you write from.

Assumes familiarity with AWS CDK, AWS Lambda, and WhatsApp/Instagram API concepts. Deployment takes approximately 15 minutes per stack.

What does a multichannel AI agent with shared memory look like?

Here is the agent processing different media types on WhatsApp and responding on Instagram with full context.

How does the AI agent process voice notes on WhatsApp?

The agent transcribes voice messages automatically using Amazon Transcribe and responds based on the spoken content. The transcription is stored in memory so the agent can reference it in future conversations.

How does the AI agent analyze videos on WhatsApp?

Send a video and the agent uploads it to TwelveLabs for visual and audio analysis. It describes the content in detail and stores a reference ID so you can ask follow-up questions about the same video later.

How does the AI agent analyze images on WhatsApp?

Send a photo and the agent describes the visual content, answers questions about it, and stores the description in long-term memory. You can ask about the same image days later and the agent recalls the details.

How does cross-channel memory work between WhatsApp and Instagram?

Switch to Instagram. The agent recognizes you by name, knows your preferences, and remembers what you shared on WhatsApp. This works because both channels share the same actor_id in AgentCore Memory.

How does the architecture work?

The project uses three independent AWS CDK stacks that share configuration through AWS Systems Manager Parameter Store:

Stack Purpose Integration path

Stack 00 AI agent with persistent memory

Amazon Bedrock AgentCore Runtime + Memory

Stack 01 WhatsApp only

AWS End User Messaging Social (SNS-based)

Stack 02 WhatsApp + Instagram

Amazon API Gateway webhook, single endpoint for both platforms

The agent uses AgentCore Memory with two layers of persistence:

  • Short-term memory: Conversation turns within a session. Expires after a configurable TTL (Time To Live).

  • Long-term memory: Extracted facts, preferences, and summaries. Persists indefinitely across all sessions and channels. The extraction happens asynchronously in the background.

How does unified identity work across WhatsApp and Instagram?

When you write from WhatsApp, the system creates a deterministic user ID based on your phone number (wa-user-{phone}). When you link your Instagram account, both channels resolve to the same ID. The actor_id sent to AgentCore Memory is identical regardless of channel.

The linking happens through conversation. The agent asks new users if they also write from another channel. If you share your Instagram username or WhatsApp number, a link_account tool merges both identities in a unified users DynamoDB table.

Channel User ID format Lookup method

WhatsApp first wa-user-{phone} GSI on wa_phone

Instagram first ig-user-{sender_id} GSI on ig_id, fallback scan on ig_username

Linked Whichever was created first Both GSIs resolve to the same record

How does message buffering reduce AI invocation costs?

WhatsApp users tend to send 3-5 rapid messages instead of one long text. Without buffering, each message triggers a separate AI invocation, multiplying cost and token usage.

A DynamoDB Streams tumbling window accumulates messages from the same user for 10 seconds, then sends them as a single concatenated prompt to the agent.

User sends 3 messages in 2 seconds:  "hello" -> DDB INSERT (t=0s)  "I have a question" -> DDB INSERT (t=1s)  "about my video" -> DDB INSERT (t=2s)

Tumbling window fires at t=10s: -> Processor receives all 3 records in one batch -> Aggregates: "hello\nI have a question\nabout my video" -> Single AgentCore invocation`

Enter fullscreen mode

Exit fullscreen mode

This pattern is based on Enrique Rodriguez's sample-whatsapp-end-user-messaging-connect-chat, which reported a 4:1 aggregation ratio in real-world WhatsApp usage.

What media types does the AI agent support?

Media Processing method Memory storage

Text Direct prompt to the agent Stored as conversation event

Image

Anthropic Claude vision describes the content Text description stored in long-term memory

Audio and voice notes

Amazon Transcribe converts speech to text Transcription stored as text prompt

Video

TwelveLabs Pegasus analyzes visual and audio content Description and reference ID stored in long-term memory

Documents (PDF, DOCX, XLSX) Claude reads inline and summarizes Summary stored in long-term memory

All multimedia is converted to text understanding before entering memory. This is how the agent recalls what was in a photo or video days later, even across channels.

Frequently asked questions

Can the same agent serve WhatsApp and Instagram at the same time? Yes. Stack 02 uses a single API Gateway webhook that receives both WhatsApp and Instagram messages. The receiver Lambda detects the channel from the payload and normalizes both into a common format.

Does the agent remember conversations when switching channels? Yes. A unified users table maps WhatsApp phone numbers and Instagram IDs to a single user. When both accounts are linked, the agent uses the same actor_id in AgentCore Memory. Long-term facts and preferences persist across both channels.

What happens if I only want WhatsApp without Instagram? Deploy Stack 01 for WhatsApp via AWS End User Messaging, or deploy Stack 02 and configure only the WhatsApp secret. The agent works without Instagram when no Instagram credentials are configured.

How can I add more channels like Telegram or a web chat? The AgentCore Runtime and Memory layer is channel-agnostic. To add a new channel, create a receiver that normalizes messages into the same DynamoDB format and add a reply dispatch function. The agent and memory work without changes.

Get started

The full project with deployment instructions, Instagram setup guide, and architecture documentation:

github.com/elizabethfuentes12/whatsapp-ai-agent-sample-for-aws-agentcore

This is a demo project for learning and experimentation. If you plan to use these patterns in production, add proper security hardening, error handling, and monitoring.

Built with Amazon Bedrock AgentCore, AWS CDK, and Strands Agents. Similar patterns can be applied using LangGraph, AutoGen, or the Amazon Bedrock Agents SDK.

Gracias!

🇻🇪🇨🇱 Dev.to Linkedin GitHub Twitter Instagram Youtube Linktr

Was this article helpful?

Sign in to highlight and annotate this article

AI
Ask AI about this article
Powered by Eigenvector · full article context loaded
Ready

Conversation starters

Ask anything about this article…

Daily AI Digest

Get the top 5 AI stories delivered to your inbox every morning.

Knowledge Map

Knowledge Map
TopicsEntitiesSource
Multichanne…claudeopen-sourceproductapplicationplatformintegrationDev.to AI

Connected Articles — Knowledge Graph

This article is connected to other articles through shared AI topics and tags.

Knowledge Graph100 articles · 197 connections
Scroll to zoom · drag to pan · click to open

Discussion

Sign in to join the discussion

No comments yet — be the first to share your thoughts!

More in Products