Glossary · Compaction

Compaction.

Summarize the past to afford the future.

Direct answer

Compaction summarizes a near-full conversation into a high-fidelity seed and restarts a fresh window with it — the standard lever for long-horizon tasks that exceed any context window. Done well it preserves decisions, open threads, and invariants while dropping resolved subtasks and verbose tool dumps. Done blindly (auto-compact at 80–95%) it paraphrases exact code into lossy prose at the worst moment — so manual compaction with keep/drop directives beats automatic.

In Anvaya

How We Implement It.

01CompactionAnvaya compacts structurally, not textually: SessionSynthesizer distills sessions into causal threads and typed nodes (~25x), so the next session reloads knowledge, not a summary of a summary.

Questions

Asked About Compaction.

Q

When should I compact manually?

Before starting a fresh subtask: /compact with a keep-directive naming decisions and invariants, dropping the tangent explicitly.

Q

What must a compaction summary keep?

Decisions + why, open threads, invariants and hard constraints. Drop resolved subtasks, verbose outputs, abandoned attempts.

Q

Is the Compaction API a replacement for session splitting?

For open-ended work it helps; for structured spec→implement→verify flows, explicit fresh sessions still give tighter control.

Stop Starting From Zero.

One binary. 11+9 Rust crates. 545 tests. Hand-written HNSW index. Three transport modes. Four providers, Ollama, Anthropic, OpenAI, Siemens. Zero API keys required to start. Mind remembers everything after the first session.