Accordion
Lets an AI coding agent forget without losing anything.
Sponsor Track winner (The Token Company), UC Berkeley AI Hackathon 2026
Team of four: Tyler Darisme, Aaditya Desai, Sheel Shah, Thy Tang · since Jun 2026
Results
- 5 /
6 vs 2 / 6SlopCodeBench @ 100K tokens83.3% vs 33.3% for naive compaction, DeepSeek V4 Pro - 240+GitHub stars, team repoa-Fig/accordion
- 10,000+Site visits, get-accordion.devpassed in Oct 2026
- Publishednpm package@a-fig/accordion
Accordion highlights
Legend & ranking pipeline
A session fills up.
A long coding-agent session is a stream of blocks: user turns, replies, thinking, tool calls, tool results. The window has a budget. The usual fix flattens it into one lossy summary.
Fold, don't delete.
Accordion hides blocks that aren't carrying weight. Folding changes only what the agent sees, never what is stored, so anything can come back. A protected tail is never folded.
Decide what to bring back.
When the agent needs something folded, the unfold shortlist goes through three stages: keyword scoring, bi-encoder retrieval, and a cross-encoder rerank (ms-marco MiniLM). A self-calibrating target holds context between 0.60 and 0.92 of the budget.
Measure whether it helped.
The health layer scores every session: metrics, a folding evaluator, a session evaluator, and a harness against naive compaction. On SlopCodeBench at a 100K budget, Accordion reached 5 of 6 checkpoints (83.3%) against 2 of 6 (33.3%).
Why
Agents get worse on long tasks because their context fills with material that no longer matters. Compaction flattens the session into one lossy summary, and sliding windows drop the oldest tokens. Accordion hides what isn't carrying weight, reversibly and inspectably: folding changes only what the agent sees, never what is stored, so anything can come back, and a protected tail is never folded. It is a pi extension plus a Tauri and SvelteKit desktop app, and it won the Sponsor Track (The Token Company) at the UC Berkeley AI Hackathon 2026. In November 2026 I started taking it in a new direction: independent of pi, with an algorithm-based conductor in place of a small model, weighing cost against performance as a replacement for /compact. It is the most technically demanding project I have worked on.
What I built
I built the conductor, the folding policy that decides what to hide and what to bring back, plus its health and evaluation layer and the conductor activity dashboard.
- Built the conductor, Accordion's folding policy: a budget that persists across reconnects, a self-calibrating fold target that holds context in a 0.60 to 0.92 band, and a three-stage relevance pipeline (keyword scoring, bi-encoder retrieval, cross-encoder rerank) on the unfold shortlist.
- Built the health and evaluation layer: health metrics with tests, a folding evaluator, a session evaluator, and a harness that compares against naive compaction. With the Thermocline conductor, Accordion reached 5 of 6 SlopCodeBench checkpoints against 2 of 6.
- Built the conductor activity dashboard: health verdict, needed-fold rate, calibration events, fact ledger, relevance table of contents, and a per-decision view of everything the conductor did.
- Ported the conductor onto Accordion's fold, replace and group command contract (PRs #68 and #71), with retention telemetry, query-aware extractive trim and a fact ledger.
Built with
TypeScript, Hugging Face Transformers, SvelteKit, Tauri, Node.js, WebSockets, Vitest
From the build
