Short answer: It shrinks many turns or episodic notes into one bounded memory the agent can load affordably.
Bounded conversation summaries rewrite one summary per conversation as messages arrive. Pipeline buffers roll daily facts into aggregates. Pair a running summary with discrete facts so decisions are not lost. Prefer Engram buffers for order and durability. Summarization does not replace contradiction handling; further consolidation lifts episodes into semantic knowledge.
Summarization is compression with a job description. Soft forgetting only demotes weak hits. Pruning removes stale rows. Supersession keeps one current fact with a short past clause. Summarization shrinks many turns, notes, or episodic scraps into one bounded memory the agent can afford to load every time. Weaviate Engram supports that shape directly. A bounded ConversationSummary topic rewrites one summary per conversation as messages arrive. Pipeline buffers can later roll many daily facts into a single aggregate memory. The token cost stays flat. The narrative spine stays available.
This chapter covers when summarization beats raw recall, how Engram’s bounded summary and buffer-aggregate paths work, how to pair a running summary with discrete facts, and how to avoid lossy compression that erases decisions. The aim is a store that stays searchable and prompt-friendly as sessions grow.
When is a summary the right compression, and when should facts stay atomic?
After supersession keeps preferences tidy, long sessions still balloon. Fifty turns of makeready chatter should not all enter the next prompt. A summary compresses intent, decisions, blockers, and open questions into a short paragraph. Atomic facts still matter for precise recall. “Prefers soy-based ink on newsprint” should remain a discrete UserKnowledge memory. The summary explains why that preference came up during a press check.
Use summaries for continuity across a conversation or a workday. Use extracted facts for durable preferences and constraints. Use neither as a dumping ground for every utterance. Research on agent memory often pairs semantic triples with conversation summaries for exactly this reason. Triples are cheap to retrieve. Summaries restore narrative context when the triple alone feels thin.
Aggressive summarization has a risk. Continual rewrite loops can drop rare but critical detail. Keep safety constraints and hard configuration values as atomic memories outside the summary. Let the summary point to them in plain language without being the only copy.
How does Engram keep a running conversation summary bounded?
Once you know you need continuity without full history, Engram’s personalization template offers an optional ConversationSummary topic. It is bounded. That means at most one memory per scope. Scope includes user_id and conversation_id. Each memories.add with those properties updates the same summary in place. The pipeline rewrites the object as the dialogue grows.
Fetch that summary with FetchRetrieval, not hybrid ranking. Fetch returns the bounded memory by topic and scope. Query text is ignored for scoring. Token cost for including the summary in the system prompt stays roughly constant whether the session has ten turns or two hundred. Pair it with the last few raw messages so pronouns and “that” still resolve.
If the topic is not enabled on the project, fetch raises a topic-not-found style error. Handle that in application code and fall back to hybrid search over facts. Enabling the topic at project creation is the clean path. Retrofitting later means creating a project configuration that includes the bounded summary topic.
How do buffers turn many memories into a compressed rollup?
Conversation summaries compress one thread. Buffers compress across runs. Engram can extract and commit immediately, then hold memories in a buffer until a trigger fires. Triggers include count thresholds, idle timers, or wall-clock windows such as every twenty-four hours. When the buffer flushes, a later transform can combine the batch into one daily activity memory and commit again.
That pattern is summarization at pipeline scale. Intermediate extracts stay out of the final store until the rollup is ready, or they exist briefly then get consolidated depending on how you chain commits. Continual-learning examples use the same idea. Atomic pieces wait in a buffer until enough context exists, then a transform writes one experience memory and drops the noisy intermediates from the retrieval surface.
Application-side jobs can mimic this if your pipeline is fixed. Search a day’s worth of episodic notes in a scope, ask a model for a compact rollup, add the rollup as a new memory, then delete or archive the verbose originals. Prefer Engram buffers when you can. They keep ordering and durability inside the memory service.
What does a dual-layer compress-and-recall loop look like?
Imagine a letterpress shop agent on print-shop-makeready-bench-2. The session covers ink density, packing, and a switch to soy ink. You want a running summary for the session plus durable facts for later jobs.
import os
import uuid
from engram import EngramClient, HybridRetrieval, FetchRetrieval
from engram.exceptions import APIError
client = EngramClient(api_key=os.environ["ENGRAM_API_KEY"])
press_operator = "operator-mina-hart"
conversation_id = f"makeready-{uuid.uuid4().hex[:8]}"
bench = {
"conversation_id": conversation_id,
"bench_id": "print-shop-makeready-bench-2",
}
def add_turn(messages: list[dict]):
run = client.memories.add(
messages,
user_id=press_operator,
group="personalization",
properties=bench,
)
client.runs.wait(run.run_id)
def load_summary() -> str | None:
try:
results = client.memories.search(
query="conversation summary",
user_id=press_operator,
group="personalization",
topics=["ConversationSummary"],
properties={"conversation_id": conversation_id},
retrieval_config=FetchRetrieval(limit=1),
)
except APIError:
return None
return results[0].content if results else None
def load_facts(query: str):
return client.memories.search(
query,
user_id=press_operator,
group="personalization",
topics=["UserKnowledge"],
properties={"bench_id": "print-shop-makeready-bench-2"},
retrieval_config=HybridRetrieval(limit=5),
)
add_turn(
[
{"role": "user", "content": "Makeready on print-shop-makeready-bench-2 for a newsprint run."},
{"role": "assistant", "content": "I can track packing and ink. Any constraints?"},
{
"role": "user",
"content": "Switch to soy-based ink. Keep packing at two sheets. Density felt high last time.",
},
]
)
summary = load_summary()
facts = load_facts("soy ink packing density newsprint")
print("summary:", summary)
for m in facts:
print("fact:", m.content)
# Prompt pattern: constant-size summary + recent turns + top facts.
system = (
"You are a letterpress makeready assistant.\n"
f"Session summary:\n{summary or '(none)'}\n"
"Durable facts:\n"
+ "\n".join(f"- {m.content}" for m in facts)
)
print(system[:500], "...")
The summary absorbs the story of the makeready. Hybrid search still surfaces the soy-ink preference as a crisp fact. Together they compress hundreds of tokens of chatter into a stable prompt block. If summary fetch fails because the topic is off, facts alone still personalize the next reply.
How do you keep summarization from erasing what still matters?
Measure whether agents can answer decision questions after compression. If “why did we reject solvent ink” disappears from both summary and facts, your compression is too lossy. Instruct summaries to retain decisions, constraints, and open loops. Instruct extraction topics to pull durable preferences into atomic memories before episodic text is rolled up.
Schedule rollups. Do not summarize on every token. End of session, end of day, or buffer flush are safer cadences. After a rollup, prune verbose episodic siblings that the summary now covers. Keep superseding current facts as their own maintenance path. Summarization compresses narrative. It does not replace contradiction handling.
When summaries themselves grow long, consolidate again into higher-level semantic memories. That step turns “what happened in many episodes” into “what is generally true,” which is the next maintenance move after compression.
Our next chapter, What is consolidation from episodic to semantic memory?, focuses on lifting repeated experiences into stable knowledge the agent can reuse across sessions.