Give an AI agent two kinds of long-term memory

Annie Wang separates exact facts from semantic preferences and keeps slow memory extraction off a live voice agent’s critical path.

AWAnnie WangVortrag · Google Cloud
Kanal
Google Cloud Tech
Veröffentlicht
28. Okt. 2026
Video
12:26
Lesezeit
3 Min.
Folien
2
Original
Englisch
Auf YouTube öffnen
Beim Scrollen schrumpft das Video in die rechte untere Ecke und läuft weiter. Untertitel folgen Ihrer Lesesprache.
LesespracheIn 2 Sprachen verfügbar
Diesen Artikel gibt es noch nicht auf Deutsch, daher wird das Original (Englisch) angezeigt.
ZUSAMMENFASSUNG

In 30 Sekunden

A multimodal agent should retrieve exact facts, such as purchases and events, from structured records and use semantic search for less precise preferences. Google’s Annie Wang describes loading both at the start of a session, writing explicit factual changes immediately and extracting longer-term patterns asynchronously. Raw audio and video are a separate storage decision; they do not automatically belong in the agent’s memory.

  1. 1Exact facts and user preferences need different retrievalEvents and purchases fit structured records; preferences may need similarity search over context from prior sessions.
  2. 2A similar memory is not a substitute for an exact purchase recordWang recommends database lookup for exact facts and semantic retrieval for questions about a user’s usual preferences.
  3. 3Raw audio and video are a separate storage decisionMedia may be kept for replay or audit, but the agent’s memory usually stores the relevant meaning extracted from it.
  4. 4Keep memory extraction outside the live audio pathThe model can extract semantic memories asynchronously during or after a session without delaying the conversation.

Das Wichtigste

  1. Use exact database queries for facts and semantic search for preferences or patterns.
  2. Do not treat one casual remark as a permanent user preference.
  3. Run model-based memory extraction asynchronously so it does not block live audio.
  4. Treat raw media retention separately from the memories extracted from it.
VOLLTEXT

Den bearbeiteten Text nach Kapiteln lesen

Nur das Transkript
01

Decide what should persist across sessions

Wang uses a styling assistant to distinguish short-term conversation context from durable facts and preferences.

Annie Wang asks what a multimodal agent should remember after a session ends. A styling assistant illustrates the goal: use a customer’s wish list and prior purchases to suggest clothes for an upcoming dinner.

The context held during a conversation resembles short-term memory: it helps while the session runs, but does not automatically carry over. The design question is which information is worth retaining for a future session.

Wang distinguishes exact facts from semantic understanding. A dated event or purchase can be stored as a structured record with an ID; a preference such as choosing understated clothes is a pattern that may emerge across conversations.

02

Store facts and semantic understanding for different queries

Structured databases answer exact questions, while vector search retrieves related patterns. Raw media has its own retention decision.

For exact facts, she recommends a structured database such as PostgreSQL, MySQL or Cloud SQL. A calendar question needs the actual event, not a semantically similar record.

For less structured understanding, a vector store can retrieve related memories by meaning. For example, it might find style preferences relevant to a dinner even if the question does not match the wording of the stored memory.

A vector store is a category rather than one product: vector search can be used inside PostgreSQL or through services such as AlloyDB. Wang also describes Agent Engine Memory Bank as a managed option that can extract useful information from past sessions and update memories over time.

Extracting semantic memory from sessions
FOLIE 1 / 2Extracting semantic memory from sessionsThe diagram shows a memory service extracting a user preference from an agent session.

Putting every fact into similarity search creates a problem when an answer must be exact. A question about a purchase should query the database, whereas a question about usual dinner attire can use semantic recall.

Raw video frames and audio waveforms are separate from agent memory. The application may choose to retain media for replay, audit, debugging or training, but the memory layer generally needs the useful meaning extracted from the signals rather than every raw frame or sound.

03

Load, update and extract memory without blocking audio

The agent reads both forms of context at session start, writes explicit changes and extracts semantic memory asynchronously.

At the beginning of a session, the agent can load structured facts such as upcoming occasions and wish-list items, then retrieve relevant semantic memories such as preferences and comfort constraints. Together, the two sources give it context for an answer.

Wang recommends saving explicit factual changes promptly: when a user asks to add a blazer to a wish list, the agent calls a tool to write that change to the database.

Long-term preferences need more judgment. A single remark about liking yellow today should not automatically become a permanent style preference; repeated behavior or a user’s explanation can provide a stronger signal.

Memory extraction can happen during a conversation or after it. Extracting during shorter intervals can produce cleaner memories and preserve information if a user leaves early, and Memory Bank supports mid-session generation.

For a live voice agent, model-based extraction is slower than a simple database write and should not block audio. Wang recommends running extraction asynchronously, either after a turn or after the session, outside the latency-sensitive path.

Writing a factual change to a structured database
FOLIE 2 / 2Writing a factual change to a structured databaseThe sequence diagram shows an agent saving a requested wish-list update in Cloud SQL.

In her demonstration, structured facts are written immediately and semantic understanding is extracted after the session. The next session loads both again: read context, write changes and carry useful information forward.

Mehr aus diesem Kanal