Build1 publisher3 min readPublished
Sharing long-term memory across two agents comes down to the actorId you write under
A dev.to walkthrough gives a Nova Sonic voice agent and an Amplify AI Kit chat agent one long-term memory in Amazon Bedrock AgentCore Memory, where every record is filed under an actorId and a sessionId. Both channels already had short-term context.
The Engineer · Build desk

What happened
- One shopping assistant runs through two channels in this walkthrough: a text chat built with the Amplify AI Kit, and a voice agent built as a Strands BidiAgent using Amazon Nova Sonic.
- Tell the voice agent you are into ultralight camping gear, then ask the chat agent for a recommendation, and it has no idea who you are; the post calls the pair two strangers.
- AgentCore Memory takes raw event writes and runs extraction strategies in the background that distill them into long-term records, with the developer choosing which strategies run.
- The gap the service fills is the long-term, cross-session, cross-channel one: distilled preferences and facts that neither the AI Kit nor the BidiAgent carries between channels on its own.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- decision Anyone copying this design has to settle where the user identifier comes from before the first voice turn, because the write needs an actorId that both channels will later read under.
- constraint Background extraction sets a floor on how continuous a channel switch can feel: a budget stated by voice is not retrievable in chat until the distillation has run.
- exposure A single actorId now holds stated preferences and purchase history together, so a bad identity mapping puts one customer's record in front of another.
- cost Getting the keying wrong is cheap to ship and expensive to undo, since the records written under session keys are not re-filed when the key changes.
The failure mode is filing. A record extracted from a voice session is stored under that session's key, and a chat turn looks up a different key, so neither agent reads the other's records [2]. The post names the temptation plainly, letting each agent use its own runtime session as the identity, and introduces the choice as "the insight that makes or breaks the whole thing" [5].
So the key has to be the person, present in both entry points before the first turn [4]. The walkthrough has that to hand because the chat agent and the voice agent sit in one Amplify Gen 2 backend [14]. A voice channel that answers before the caller is identified does not. In my view you should refuse to write long-term records at all until an authenticated user id exists. A record written under a placeholder is worse than no record, because lookups will find it.
What gets stored is distilled knowledge [13]. You write raw events, AgentCore Memory runs extraction strategies in the background, and you pick which ones run [6]. The walkthrough enables two of the three strategies it names [1]. User Preference takes subjective likes and dislikes, such as "prefers ultralight gear" or "budget around 150 euros" [7]. Semantic takes objective facts, such as "bought a DayHike 25L Pack" or "camps in winter" [8]. Summarization is left off, on the grounds that for a shopping assistant the preferences and the facts are what matter [9].
Because extraction is background work, the event write and the usable long-term record are two moments rather than one [3]. The post does not say how long the gap runs [15]. A shopper who says a budget out loud and opens the chat immediately afterwards hits that gap.
The good engineering here is how much of the problem was already solved. On chat, the Amplify AI Kit persists the conversation to DynamoDB and replays it on every turn, so following "make it cheaper" needs no AgentCore events at all [10]. On voice, the BidiAgent keeps the live context inside the open bidirectional stream with Nova Sonic [11]. Both are handled, by different mechanisms with different lifetimes: the chat copy sits in a table, the voice copy exists only while the stream is open [5]. Neither one covers the long-term, cross-session, cross-channel layer [12].
That layer brings a new exposure with it. One actorId holds both what someone said they like and what they actually bought [4][7][8], so an identity mapping error does not merely weaken a recommendation, it merges two customers [6]. Records already written under a session key also stay filed under it, so a team that ships session keying and corrects it later cannot read its own history back through the new lookup [7].
For the number in this walkthrough to transfer to your build, two things have to be true: your voice entry point knows who the user is before it opens the stream, and both channels can agree on one identifier without a lookup that can fail. Both of those are auth questions.
What to watch
- Whether the series publishes the retrieval path and shows how the voice agent receives the user id from the Amplify backend before the stream opens.
- Whether AWS documents extraction latency for AgentCore Memory strategies, since the cross-channel experience depends on it.
- Whether the Amplify AI Kit gains native long-term memory, which would change the build-versus-adopt call on the chat side.