cd /news/ai-agents/memory-architecture-for-ai-agents-in… · home › topics › ai-agents › article
[ARTICLE · art-171984] src=twilio.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Memory Architecture for AI Agents: Integrating Twilio Conversations and Amazon Bedrock

Twilio and Amazon Web Services published guidance for a four-tier memory architecture that splits AI agent context across Twilio Conversation Memory, Amazon Bedrock AgentCore Memory, systems of record, and knowledge bases, rather than storing all state in one generic data store. Twilio's layer maintains a persistent customer profile across voice, SMS and chat by normalizing phone numbers to E.164 and matching WhatsApp, email and chat addresses through Identity Resolution, while AgentCore handles active call context and episodic recall of past resolutions. The companies argue that compartmentalizing data by what it is about and where it comes from prevents stale data and conflicting copies of the same fact.

recommendation

Separate customer profiles, episodic context, live business data and static policy into distinct memory tiers, and fetch real-time data like flight status only through tool calls rather than copying it into the agent's profile.

more in playbook: Designing agent systems
by read11 min views1 publishedNov 18, 2026
Memory Architecture for AI Agents: Integrating Twilio Conversations and Amazon Bedrock
Image: Twilio (auto-discovered)

Time to read:

Written by

Owl Air just canceled Flight 103, and a stranded traveler is calling in. Having an AI agent handle the disruption seamlessly requires a complex web of context. The agent needs to know who the traveler is, the real-time status of their flight, what was discussed earlier in the call or perhaps in another communication channel, and what solutions successfully resolved similar disruptions in the past.

If you are tasked with building this experience, you have to decide exactly where each piece of that context lives. When building on the Twilio Conversations platform and Amazon Bedrock AgentCore, you have two platforms built for this problem:

  • Twilio Conversations platform ( includes Twilio Conversation Memory): Twilio's unified communication layer that orchestrates omnichannel interactions (voice, SMS, chat) and keeps a persistent profile for each customer: observations and summaries extracted from conversations, plus traits you define.
  • Amazon Bedrock AgentCore: AWS's agentic platform for building, deploying and operating agents with any framework or model. It hosts the agent runtime, manages short-term memory, supports long-term episodic learning, and connects the agent to backend tools.

Both platforms are capable of storing state and memory. However, treating AI memory as a single, generic data store leads to stale data and conflicting copies of the same fact.

To build reliable agentic customer experiences, data must be compartmentalized based on two questions: what the data is about, and where it comes from. A starting point to consider is a four-tier architecture that separates customer memory, episodic experience, operational data, and organizational rules.

The Four-Tier Memory Architecture #

An enterprise-grade agent draws on four distinct layers of context.

Memory Tier System Primary Focus Good For Caution
Customer Memory Twilio Conversation Memory The user's persistent profile, preferences, and emotional state across channels. And the ability to surface previous frustrated interactions as context. "I prefer aisle seats," or Storing flight statuses or order histories. Storing balance or loyalty tiers.
Short-Term & Episodic AWS AgentCore Memory The active call context, and the agent's historical operational experience. Tracking the current conversation; recalling steps that solved a missed connection. Storing balance or loyalty tiers.
Organizational Context Systems of Record Real-time business data accessed strictly via dynamic tool calls. Whether Flight 103 is operating; current baggage allowances. Hardcoding or copying this data into an AI profile.
Organizational Rules Knowledge Bases Static content that applies to all customers equally. Baggage fee policies; refund guidelines. Storing anything specific to an individual user.

#

Tier 1: Customer Memory (Twilio Conversation Memory) Customer memory tracks what past conversations reveal about the customer. Working alongside the Twilio Conversations platform, this memory layer recognizes a customer whether they text, call, or chat, maintaining a persistent profile across interactions. It does this through identifiers: Twilio normalizes a caller's phone number to E.164 and maps WhatsApp, email and chat addresses the same way, then matches them against existing profiles so a text on Monday and a call on Tuesday land on the same person (Identity Resolution).

The profile relies on three components:

  • Observations: Notes Twilio extracts from a conversation once it goes inactive or closes, depending on how you configure extraction (e.g., "Customer prefers morning departures" or "$50 fee caused frustration"). Your app can also write observations through the API at any time.
  • Summaries: High-level recaps of past conversations, so returning customers don't have to repeat themselves.
  • Traits: Structured, developer-defined fields like name, preferred language, and loyalty tier.

If a fact is declared or comes from an authoritative system, it's a trait. If the agent inferred it from what the customer said, it's an observation. Architectural strengths: Twilio handles the infrastructure for you. By enabling memoryExtractionEnabled in your Conversation Orchestrator, Twilio automatically writes observations and summaries when a conversation goes inactive or closes, depending on how you configure extraction. Because extraction runs after a conversation, nothing said on the current call is in Recall yet. The live context for this call comes from AgentCore short-term memory, which is why you need both layers.

Because this memory sits at the communication layer, it is entirely agnostic to your AI agent runtime. A preference gathered by an agent running on AWS today is available to a human agent in your contact center tomorrow.

Recall is also built for the agent's inner loop. Twilio lists Conversation Memory's data latency as under 100 ms. On voice calls, you choose how often Recall runs, so you can trade context for speed.

If you use Twilio Segment, the [Segment integration](https://www.twilio.com/docs/conversations/memory/segment-customer-memory-integration) syncs mapped profile traits into Conversation Memory as they change. Turn web behavior into a computed trait in Segment, such as a recent visit to the rebooking page, and the agent can greet the traveler already knowing they were looking at rebooking options.

## Tier 2: Short-Term & Episodic Memory (AWS AgentCore)

Where Twilio knows the customer, AgentCore knows the job.

Short-Term Memory: Tracks the immediate context of the current call. Every time the user speaks, the agent replies, or a tool returns a result, the system logs the interactions. This prevents the agent from losing track of the immediate back-and-forth, and lets it pick up where it left off. If a call drops and the traveler calls back, or replies to a text an hour later, the agent reloads the conversation so far. How long a conversation stays open for that is up to you: Conversation Orchestrator lets you set inactive and closed timeouts per channel (Conversation lifecycle). Short-term memory also holds the turns and tool results until the agent, or any processing after the call, has finished with them.

Episodic Memory (Long-Term): Records how the agent solves problems. AWS frames completed tasks as "episodes." The agent records the situation, what the user wanted, the tool calls made, and the final outcome. It then writes "reflections" on which approaches worked best. Episodes come from one customer's session, so they include that customer's situation and intent. Store them per customer (an actor-level namespace), and keep reflections at the actor level too unless you want insights pooled across customers. AWS flags the privacy implications of that (Episodic memory strategy).

To avoid a "split-brain" scenario, where AgentCore builds a second customer profile that drifts from Twilio's, send events for short-term memory, enable only the episodic strategy, and leave the user preference, semantic and summary strategies off. You choose strategies when you create the memory, in the console or the CLI (Enable long-term memory).

Watch for a feedback loop too. If your agent saves what Recall returned as an event, AgentCore treats Twilio's observations as if the traveler had just said them. Put traits and Recall results in the system prompt, and save only what the customer and agent actually said, plus tool results, as events.

Tier 3: Organizational Context (Systems of Record) Your business already runs systems to manage operational data: reservation databases, billing platforms, and CRM platforms. This data is dynamic, interconnected, and can be highly relational.

Refrain from business records into conversational memory. (The one exception, a loyalty tier kept as a trait for greetings and routing, is covered in the decision guide below.) If you copy a booking's status into a memory profile, that copy goes stale the moment the airline changes the flight time. Furthermore, memory systems flatten relational data, destroying the structure of complex orders or multi-leg itineraries. Copied records also add noise: they come back alongside the customer's preferences and crowd the agent's prompt with data it didn't need for this question.

Instead, the agent must fetch this data in real time. Whether using AgentCore Gateway or direct API requests, the agent should execute tool calls to access systems of record exactly when the data is needed. AgentCore Gateway turns your existing APIs and Lambda functions into tools the agent can call, such as a reservations API, a DynamoDB table behind a Lambda function, or a CRM through one of Gateway's built-in integrations, and it handles authentication (AgentCore Gateway).

Tier 4: Organizational Rules (Knowledge Bases) #

Knowledge bases handle the static, universal truths of the business. Examples are Policies, product manuals, and escalation procedures for human handoff.

Twilio Enterprise Knowledge keeps this content next to Conversation Memory. Agent Connect includes a built-in knowledge search tool, and the same knowledge base can ground Twilio's agent-assist suggestions for human agents (Enterprise Knowledge). If your agent runs in AgentCore Runtime, you have two options. Your Agent Connect server can search the knowledge base before it calls the agent and send the results along with the memory context, which keeps all your Twilio API calls and credentials in one place. Or the agent can call the Enterprise Knowledge Search API as one of its own tools, so it only searches when it needs to. If your content already lives in AWS, a Bedrock Managed Knowledge Base connected to SharePoint, Confluence or Amazon S3 can work as well, exposed to the agent through AgentCore Gateway.

Putting It Together: The Owl Air Disruption #

Returning to Flight 103, here is how the distributed architecture resolves the traveler's problem during a single call:

  • Twilio (Customer Memory): As the call connects, Twilio Agent Connect, or TAC , reads the traveler's profile and asks the Recall API for relevant memories. Recall surfaces that this traveler prefers aisle seats and always checks a bag, and the loyalty-tier trait routes the call to the priority queue. And perhaps they had already reached out about this issue via messaging or chat.
  • Systems of Record (Organizational Context): A tool call to the reservation system confirms Flight 103 is canceled, the user has a connecting flight in Dallas, and their bag is currently routed to the original destination.
  • AWS AgentCore (Short-Term & Episodic Memory): A reflection from past disruptions tells the agent that travelers with tight connections usually prefer a later direct flight to a reroute with a new connection, so it offers that first.
  • Knowledge Base (Organizational Rules): A quick tool query confirms that Owl Air waives all rebooking fees for airline-initiated cancellations and to offer a complimentary beverage for this customer due to their loyalty-tier.

The Agent's Response:

"I'm sorry, Flight 103 is canceled. I can move you to a later direct flight today, in an aisle seat, so you won't need to make a connection in Dallas. Your bag will be rerouted with you. Because we canceled the flight, there is no fee for this change and I’d like to offer you a complimentary beverage of choice for the inconvenience."

Decision Guide When deciding where a specific fact belongs in your agentic customer engagement flow, weigh these factors in order of importance:

  • The Cost of Being Wrong: If an out-of-date answer misleads the customer about money or logistics (e.g., flight times, refunds), it must be a real-time tool call. This outranks all other considerations.
  • System Ownership: If a backend system already owns the data, that system is the source of truth. A copy in memory is one more thing to keep in sync and in some circumstances data privacy policy may restrict that data from leaving the approved system.
  • Volatility: Data that changes frequently belongs in the backend.
  • Speed and Reach: Data used constantly across routing and personalization, like a user's loyalty tier, can safely live in the Customer Memory tier to speed up greetings and queue routing, as long as it's synced from the system of record.

Future-Proofing Your Architecture #

Ultimately, this separation protects your architecture from lock-in. AgentCore already lets you change foundation models without touching memory. Because customer memory lives in Twilio at the communication layer, you can go further: move your agent to a different framework, runtime or cloud, and it still knows the customer.

Each fact has a home, decided by what it's about and where it comes from. Twilio holds what conversations reveal about the customer, AgentCore holds the current interaction and what the agent has learned doing the work, your systems of record hold the business's own data, and the knowledge base holds the rules that apply to everyone. We expect the line to move as both platforms change, and if you're drawing it somewhere else, we'd like to hear where and why.

To start building, set up a memory store with the Conversation Memory docs, connect your agent through Agent Connect's AWS integration, and configure the episodic strategy from the AgentCore Memory documentation.

Twilio Docs

From APIs to SDKs to sample apps API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.

Resource Center

The latest ebooks, industry reports, and webinars

Learn from customer engagement experts to improve your own communication.

Ahoy

Twilio's developer community hub

Best practices, code samples, and inspiration to build communications and digital engagement experiences.

── more in #ai-agents 4 stories · sorted by recency
── more on @twilio 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/memory-architecture-…] indexed:0 read:11min 2026-11-18 · —