Multichannel AI Agent: Shared Memory Across Messaging Platforms
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)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
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
claudeopen-sourceproduct
At 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 Hardware
At 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 Hardware

qwen3.5 vs gemma4 vs cloud llms in python turtle
I have found python turtle to be a pretty good test for a model. All of these models have received the same prompt: "write a python turtle program that draws a cat" you can actually see similarity in gemma's and gemini pro's outputs, they share the color pallete and minimalist approach in terms of details. I have a 16 gb vram gpu so couldn't test bigger versions of qwen and gemma without quantisation. gemma_4_31B_it_UD_IQ3_XXS.gguf Qwen3_5_9B_Q8_0.gguf Qwen_3_5_27B_Opus_Distilled_Q4_K_S.gguf deepseek from web browser with reasoning claude sonnet 4.6 extended gemini pro from web browser with thinking submitted by /u/SirKvil [link] [comments]
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Products

At 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 Hardware
At 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 Hardware

Pakistan’s peace plan a ‘critical opportunity’ for US-Iran talks ahead of Trump deadline
As US President Donald Trump’s Tuesday deadline for reopening the Strait of Hormuz approached, Pakistan put forward a fresh proposal for an immediate ceasefire on Monday, offering what one analyst described as “a critical opportunity” for talks. The plan was brokered through overnight contacts between Pakistani army chief Asim Munir, US officials including Vice-President J.D. Vance and Iran’s Foreign Minister Abbas Araghchi, according to Reuters. It called for an immediate halt to hostilities...




Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!