Johns Hopkins and Apple Build SelfCompact, an Agentic Tool That Decides When to Compact Context
DeepLearningAI · x · 2026-09-17
Long-running agents lose crucial information when they blindly discard the oldest context. Tianjian Li and colleagues at Johns Hopkins University and Apple built SelfCompact, an agentic scaffold that lets the model decide when to compact its own context.
Key insight:
- The right time to compact depends on what the agent is doing, not just token count; bad timing discards partial results it still needs.
How it works:
- A probe is appended every 16,000 tokens, with a prompt specifying when compaction is allowed or blocked, asking the model to judge its own state
- If allowed, the same model invokes a summarization tool to compact the context
- No fine-tuning or external supervision; experiments used Alibaba's Qwen family
The Batch notes that efficient context management is a core production skill, helping optimize memory and cut API costs.
More from coding & agent
- Fed GPT-6 Astra 600K Websites: It Self-Critiqued 28 Changes and Rebuilt a Landing Page in 11 Minutes — PrajwalTomar_ · 2026-09-17
- LangChain's Paid Media Agent lives in Slack and audits 6 ad platforms weekly — LangChain · 2026-09-17
- Developer gets access to jev, a decision engine, to classify spam and match invoices — kevinkern · 2026-09-17
- Stale Enterprise Docs Are an Agent Risk: Gartner Sees 60% Agentic Projects Failing by 2030 — rseroter · 2026-09-17
- God's Eye View: open-source 'spy satellite simulator' with real live data hits 35.6k GitHub stars — tom_doerr · 2026-09-17
- Typing 'c' to approve: the inside jokes of AI coding agent prompts — burhop · 2026-09-17