| name | agent-ocr-history-compression |
| title | AgentOCR: Reimagining Agent History via Optical Self-Compression |
| version | 0.0.2 |
| engine | skillxiv-v0.0.2-claude-opus-4.6 |
| license | MIT |
| url | https://arxiv.org/abs/2601.04786 |
| keywords | ["agent-efficiency","history-compression","token-optimization","visual-encoding","long-context"] |
| description | Compress agent interaction history by converting observation-action sequences into compact visual representations (images), leveraging visual tokens' superior information density. Implements segment optical caching with 20x rendering speedup and enables dynamic compression rates. Preserves over 95% of agent performance while reducing token consumption by 50%+, enabling agents to maintain longer interaction histories within fixed budgets. |
Problem
Agent interaction histories grow rapidly, creating bottlenecks:
- Token Explosion: Long sequences of observations and actions consume enormous token counts
- Memory Pressure: Multi-turn agent executions accumulate context that exceeds token limits
- Computational Cost: Each token in history requires reprocessing in forward passes
- Limited Horizon: Token constraints force agents to forget recent history or truncate interactions
- Inefficient Encoding: Text-based history is redundant (JSON records, timestamped logs)
Agents need ways to compress histories without losing critical information for decision-making.
Solution
AgentOCR introduces Optical Self-Compression for agent histories:
- Visual Representation: Convert observation-action sequences into rendered images that capture state visually
- Renders agent state, actions taken, and outcomes as structured visual layouts
- Leverages fact that vision models process visual information with higher information density than text
- Segment Optical Caching: Decomposes history into hashable segments with visual cache
- Segments: [state → action → outcome] → render to image
- Cache: map segment hash → cached image rendering
- 20x speedup through cache hits and vectorized rendering
- Agentic Self-Compression: Agent learns to dynamically emit compression rates
- Trade-off: compress aggressively to preserve computation budget, or maintain detail for critical decisions
- Agent optimizes compression rate given current task demands
When to Use
- Long-Horizon Agents: Tasks spanning 100+ interaction steps
- Token-Constrained Deployment: Systems with fixed token budgets (mobile, inference servers)
- Multi-Turn Applications: Dialogue agents, interactive tools with extended conversations
- Expensive Computation: GPU-limited systems where per-token cost matters
- History-Heavy Reasoning: Agents whose future decisions depend on cumulative history
When NOT to Use
- For short-horizon tasks (compression overhead exceeds savings)
- When exact textual history is required for auditing
- In systems with unlimited token budgets