Agentic AI Notebook
Agent Memory
Phase 5Module 8 of 15

Conversation Memory

Chat is the default UI. If history is messy, the agent contradicts itself mid-thread.

A meeting transcript with names on each line — not a pile of unmarked quotes.

Visual Workflows

Start here — scroll inside each diagram frame to explore, then use + / to zoom up to 200% if needed.

Overview

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

Pack the next call

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

Pin the goal, keep recent turns, summarize the tail.

Key Takeaways

  • 1.Conversation memory is the chat thread: roles, turns, and order. Strategies: keep last N, summarize older, or pin key turns.
  • 2.Role tags matter — user vs assistant vs tool must stay intact. A broken thread makes the model invent a past that never happened.
  • 3.Store turns with role and id. Trim from the middle or summarize the oldest block.
  • 4.Never merge user and tool messages into one blob.

Learn elsewhere

  • Working Memory
  • Memory Summarization

Real Example

Scenario

A 60-turn design chat: pin the original brief, keep the last eight turns, replace turns 1–50 with a one-paragraph summary.

What you would do

In Agent Memory, apply Conversation Memory to this scenario: A 60-turn design chat: pin the original brief, keep the last eight turns, replace turns 1–50 with a one-paragraph summary. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Commands

Commands to Remember

  • Keep roles on every turn
  • Last N + summary
  • Pin the goal
  • Do not flatten tools into user text

Cheat Sheet

Quick recap

quick ref
  • Thread with names
  • Last N + summary
  • Pin what matters
  • Roles stay intact

Common Mistakes

  • Dropping tool messages from history
  • Summarizing so hard the user's constraint disappears
  • Sending the entire 200-turn log every time