Skip to documentation
Docs navigation
Docs/Conversation summaries
Guide

Conversation summaries

Use topic summaries, atomic memories, and recent history together instead of maintaining one ever-growing transcript summary.

Estimated time: 8 minutes
Level: Intermediate
Prerequisites:Installation·Quick Start

Overview

MemoGrafter preserves several layers of context. Recent raw history supports immediate continuity, topic summaries preserve broad historical segments, atomic memories support precise recall, and grafting assembles selected topic context.

When to use this

Conversations outgrow a practical raw-history window.
The application needs broad decisions and exact facts.
Older context should be retrieved by relevance rather than recency alone.
Historical summaries must remain auditable when facts later change.

Step 1: Ingest complete turns

Use invoke() for ordinary chat so completed turns enter public history and the incremental memory pipeline together. For imported transcripts, use the explicit session-oriented MemoGrafter.ingest() path.

Step 2: Recall exact facts

facts.ts
const facts = await agent.recall("decisions and open questions", {
  limit: 10,
  tokenBudget: 1000,
});

Step 3: Graft broader context

summary-context.ts
const context = await agent.graftByRelevance(
  "decisions and open questions",
  { topK: 4, hopDepth: 1 },
);

Full example

long-conversation.ts
await agent.invoke("We chose PostgreSQL for transactional storage.");
await agent.invoke("The remaining question is regional failover.");

const exact = await agent.recall("What storage decision did we make?");
const broad = await agent.graftByRelevance("architecture decisions and risks");

console.log(exact.facts);
console.log(broad.systemPrompt);

Choose the right context layer

Recent history: immediate conversational continuity.
Topic summaries: broad historical context for a segment.
Memory nodes: exact facts, tasks, questions, insights, and references.
Grafted context: selected topic summaries, active facts, nearby source context, and maintenance notes.

Historical versus current facts

Topic summaries are historical and are not rewritten when a fact changes. Maintenance can mark memory nodes conflicting, superseded, or decayed; graft prompts then add deterministic notes and active facts so downstream models know what to prefer.

Common mistakes

Treating one rolling summary as the only source of truth.
Expecting old topic summaries to be rewritten after a correction.
Using full transcript replay where targeted recall is sufficient.
Ignoring token budgets when grafting many topics.
Assuming a topic summary always has corresponding atomic memory rows.