EpiContext treats your agent's history like a genome β preserving everything, but dynamically regulating what gets expressed. Inspired by how your cells decide which genes to activate.
Keep every turn in the context window. Token costs explode, and LLM performance degrades from "lost in the middle" effects.
Only keep the last N turns. Simple and fast, but critical early decisions are permanently lost when they scroll out of view.
Store everything (the genome), but dynamically select what to include in each request (epigenetic expression). Content-aware, not time-based.
When the agent resolves a subproblem after extensive trial-and-error, those detailed logs become noise. Methylation detects low-progress segments and replaces them with compact summaries β preserving the insight, discarding the noise.
Modern agents carry 20+ tools, but any task needs only 2β3. Acetylation computes multi-level relevance scores between each tool and the current task, activating only what's needed.
A joint objective over task success, token cost, and information density. After each turn, weights update: successful context is reinforced, failed context is suppressed. The system learns what to keep.
Like driving: use first gear in the parking lot, fifth gear on the highway. Don't use fifth gear everywhere.
| Strategy | N | Avg Turns | Avg Time (s) | Avg Input Tokens | Avg Output Tokens |
|---|---|---|---|---|---|
| Full-Context | 15 | 10.6 | 69.6 | 11,980 | 2,581 |
| Sliding Window | 15 | 8.7 | 42.3 | 4,665 | 1,801 |
| Methylation-Only | 9 | 10.0 | 31.7 | 5,919 | 1,854 |
| Acetylation-Only | 12 | 12.5 | 75.6 | 14,264 | 3,362 |
| EpiContext (v1) | 15 | 12.5 | 61.6 | 13,791 | 3,351 |
| Adaptive EpiContext (v2) | 15 | 3.8 | 15.9 | 1,153 | 667 |
β96%
1,801 vs 43,600 tokens
5 turns vs 20 turns
Turns: p = 0.0001
Tokens: p = 0.022
Paired t-test, 15 matched runs
Both highly significant
12Γ
Token efficiency improvement
From worst to best strategy
Read the full paper β 17 pages with architecture diagrams, mathematical proofs, ablation studies, and complete experimental data.