The harness as the context manager

This post details four key changes in Glean's agent harness design to improve long-running agent performance and context management: 1. Programmatic Tool Calling (PTC) in sandboxes moves workflow logic into sandboxed code, keeping intermediate state in variables and files, enabling batching, parallelization, and more robust error recovery. 2. Sub-agents decompose agent loops into isolated execution contexts, each with its own context window, allowing for parallel analysis of large collections of items. 3. Compaction strategies preserve load-bearing conversation state while moving raw intermediate outputs to file systems, addressing context window limits over time. 4. Search-first discovery of skills decouples tool and skill discovery from schema hydration, fetching full definitions only at execution time by indexing skills and ranking them using enterprise graph signals. These changes collectively enhance context management, scalability, reliability, and efficiency for agents performing complex, multi-step tasks.
More from the Agent Orchestration Platform trail
- AI Agents for Financial Compliance: How Enterprise AI Is Solving the Regulatory Reporting Challenge
- From enterprise search to enterprise context: what AI agents actually need
- Scale AI usage without runaway spend with Glean’s AI usage controls
- Glean Agents can now work independently, build faster, and stay governed at scale
- Glean expands horizontal, agent platform with open agent interoperability, dozens of personal and business agents, and comprehensive AI security