Conversation summaries
Use topic summaries, atomic memories, and recent history together instead of maintaining one ever-growing transcript summary.
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
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
const facts = await agent.recall("decisions and open questions", {
limit: 10,
tokenBudget: 1000,
});Step 3: Graft broader context
const context = await agent.graftByRelevance(
"decisions and open questions",
{ topK: 4, hopDepth: 1 },
);Full example
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
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.