Memory Compaction for Superintelligent Agents: What to Keep
A practical method for compacting long-running AI agent memory into durable facts and sources, with a checklist for what a future model still needs to see.

Memory compaction for an AI agent means replacing a long history of messages, tool outputs and notes with a smaller set of durable records, each linked to the source where it was first written. Keep the decisions, the reasons behind them, the exact identifiers, the rules with their exceptions, and a pointer to the original document. Drop the conversational filler that no future task will need. A compacted memory is only useful if a later model can check each fact against its source, so the real test is whether someone could rebuild the answer from what you kept.
Key takeaways
- Compact into typed records (facts, decisions, rules, open questions and source pointers), not into one summary paragraph.
- Every kept item needs a source pointer and a version, so a later model or a staff member can verify it.
- Keep the reason behind each decision, because an outcome without its reason invites the wrong repeat.
- Preserve exceptions and qualifiers word for word when they change what the rule means.
- Test compaction by asking questions the full history could answer, then compare the answers before you retire the raw history.
Why compaction loses the details that matter
Long-running agents accumulate context faster than anyone reviews it. When a model summarizes its own history, it tends to keep what sounded important at the time and drop the qualifiers that made a statement correct. A line such as "we do not offer weekend returns except for repeat accounts with an open order" often shrinks to "no weekend returns." Once that happens, the agent confidently answers a question the business never meant to settle that way.
The second loss is provenance. A summary blends what someone confirmed, what someone guessed in a meeting, and what a tool returned last week into one sentence that reads with equal authority. Nobody can tell later which part to trust. If you want a deeper treatment of how compaction can keep decisions intact, the article on AI context compaction without losing important decisions walks through the same risk from the decision side.
What belongs in durable memory
Durable memory is not a shorter transcript. It is a set of records that stay true for longer than the conversation that produced them. In most business agents, four kinds of content earn a place:
- Stable facts about entities such as customers, products, suppliers, locations and staff roles, with identifiers.
- Decisions made by a named owner, with the reason, the date the decision took effect, and what it replaced.
- Rules and their exceptions, quoted from the policy or stated by the owner, not paraphrased by the model.
- Open questions and pending items, with their status and the person responsible for closing them.
Everything else is a candidate for removal: greetings, abandoned drafts, repeated restatements of the same request, tool outputs already reflected in a record, and speculation that was never confirmed. Discarding speculation is not a loss. It prevents the agent from treating a guess as a settled fact on a later Tuesday.
A step-by-step plan for compacting agent memory
Compaction works best as a routine with a clear order, not as a single model call that rewrites everything. A workable sequence looks like this:
- Step 1: Choose a cut point and record which version of the memory it replaces, so you can roll back.
- Step 2: Extract every claim, decision, rule and open item from the history into one candidate list, each with the message or document it came from.
- Step 3: Classify each candidate as fact, decision, rule, open question or discard. When in doubt, keep it as a candidate and mark it for review.
- Step 4: Attach a source pointer and a last-confirmed marker to every kept item.
- Step 5: Resolve conflicts before writing. If two items disagree, keep both, flag the newer one, and route it to the owner instead of letting the summary quietly pick a winner.
- Step 6: Write the compacted records to the active memory and move the raw history to an archive the agent can open on demand.
- Step 7: Run a recall check against the archive and log every question the compacted memory answers wrongly.
The seventh step is the one most teams skip, and it is the one that tells you whether the compaction worked.
Illustrative scenario: a rental shop's booking agent
Illustrative scenario: a small equipment rental shop runs a booking assistant that has handled several months of messages. Buried in that history are three facts. A customer asked for morning pickups, then said the preference applies only during the winter season. A staff member noted that a repeat client received a deposit waiver, and the owner later withdrew it in writing. The shop also changed its late return fee at one point, and the new rule applies only to bookings made after that change.
A naive summary would read "customer prefers morning pickups, deposit waived, late fee is the current amount." Every clause is incomplete, and the agent would apply the waiver to a client who no longer qualifies. A compacted version keeps the preference with its season scope and source message, records the waiver as withdrawn with the owner's note as the source, and states the fee rule with its effective condition. The raw messages stay in the archive, so a staff member can open the original in seconds when a customer disputes a booking.
What a future model needs to verify a fact
A compacted record should let a model answer three questions without guessing: what is the fact, where did it come from, and how current is it. That means storing exact identifiers rather than nicknames, keeping units and conditions next to the value, and recording the source version. If the source is a policy document, the pointer should name the document and its version, not just the folder it lives in. The discipline is similar to the one described in provenance tags for AI agent memory, where each fact carries a trace back to the place it was recorded.
The pointer also protects you from memory that has gone stale. When a source changes, the record should be marked for review rather than left to contradict the new policy silently. Teams that already keep a source of truth for their agents find this step easier, because there is one authoritative place to check.
How to test whether the compacted memory still works
Write ten to twenty questions that the full history could answer. Include ordinary questions, but weight the set toward exceptions, expirations and conflicts, because those are the details compaction loses first. Ask each question twice, once with access to the raw archive and once with only the compacted memory, then compare the answers. A mismatch is not automatically a failure: sometimes the compacted answer is more correct because the raw history contained a superseded statement. Each mismatch should be classified as either a missing detail, a wrong conflict resolution, or a legitimate update.
Repeat the check after each compaction cycle and after any change to the policies behind the records. A test that is never repeated tells you about the day it was written, not about the memory you are using now.
Where Be Human fits in a managed engagement
In a Be Human engagement, compaction is part of the memory policy, not something left to the model's discretion. We define the record types, the source pointer format, the owners who approve rule changes, and the recall checks that run as part of recurring evaluations. When tools are allowed to write into memory, permission review covers those write paths, and any compaction cycle is logged so a change can be traced and reversed. The aim is a memory that a business owner can inspect, not a summary that nobody can explain.
If you are unsure which of your agent's tasks would benefit most from this kind of memory work, take the free Be Human AI diagnostic to find the first task worth handing to an agent.
Frequently asked questions
What is memory compaction for an AI agent? It is the process of reducing a long history of an agent's messages, tool outputs and notes into a smaller set of records that remain accurate and checkable. Good compaction keeps facts with their sources, decisions with their reasons, and rules with their exceptions, while the raw history is archived rather than deleted. The compacted version is meant to be used for future work, so it has to be verifiable as well as short.
What should an agent never compact away? It should not remove exceptions, conditions, expiration dates, identifiers, or the owner's reason for a decision, because these are the details that change what a rule means. It should also keep pointers to the original source, so the record can be checked later. Sensitive personal data is a separate question, and it should generally be excluded from memory altogether rather than compacted.
How often should agent memory be compacted? The right interval depends on how fast the business changes and how much the agent writes into memory. Compaction should run on a schedule that you can review, and it should also run when a major policy, product or staff change makes the existing records out of date. Each run should be logged with the version it replaced so that a bad compaction can be rolled back.
How do you know if compaction went wrong? Run a set of recall questions against the full archive and against the compacted memory, then compare the answers, paying special attention to exceptions and conflicts. Any consistent gap points to a missing detail or a poor conflict rule that needs fixing. Repeating this check after each cycle shows whether the memory is holding up over time.
Your next step
See where an AI agent fits in your company first.
Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.
Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.


