TanStack AI Compaction Keeps Chats Rolling
TanStack’s new middleware shrinks the provider-facing message set before each model call while preserving the canonical transcript and system prompt. Developers can choose eviction, LLM summarization, tool-result clearing, or custom strategies, though npm’s current 0.0.0 package is a nonfunctional placeholder.
This is the right abstraction for long-running AI apps: compact the model’s working context without destroying the user’s history. The architecture is strong, but the release currently has a frustrating packaging mismatch.
- –Compaction runs incrementally before model calls, preventing long chats and agent loops from hitting context limits.
- –Built-in strategies trade fidelity, cost, and simplicity: eviction is free, summarization preserves meaning, and tool-result clearing targets the biggest token sink.
- –Custom and composable strategies let teams tune compaction for coding agents, support bots, or domain-specific workflows.
- –Persistence checkpoints and DevTools events make compaction observable and repeatable across requests.
- –The repository describes a functional 0.1.0 package, while npm currently serves 0.0.0 as setup-only; developers should verify the published version before installing.
DISCOVERED
16d ago
2026-08-28
PUBLISHED
16d ago
2026-08-28
RELEVANCE
AUTHOR
tan_stack