
Researchers at the Massachusetts Institute of Technology’s Computer Science and Artificial Intelligence Laboratory and collaborators at Asari AI have developed a new framework called EnCompass to improve how artificial intelligence agents interact with large language models. AI agents are software programs that can call on large language models (LLMs) to solve problems, complete multi-step tasks, or assist with complex workflows. But when LLMs make mistakes, traditional agent programs must be rewritten or extended in complex ways to handle errors and explore alternative reasoning paths. EnCompass aims to simplify that process while improving the quality of the final outcomes, tells MIT News.
At its core, EnCompass separates an agent’s workflow logic from its search strategy. Instead of hard-coding error recovery and alternative search logic into the core program, developers annotate “branchpoints” where the agent may want to backtrack or explore multiple paths. EnCompass then automatically backtracks or launches parallel executions when LLM output deviates from an optimal path. This search-based approach explores different combinations of intermediate LLM responses and selects the best overall outcome.
By making search strategies modular, the framework lets programmers experiment with different search methods, such as beam search or Monte Carlo tree search, without altering the agent’s main workflow. In practical terms, this means far less custom code is needed to introduce search behaviors. In tests, agents enhanced by EnCompass required significantly fewer lines of code and demonstrated higher accuracy on tasks such as translating large code repositories.
EnCompass also enables parallel evaluation of multiple execution threads, increasing the likelihood that agents converge on high-quality solutions. This is particularly valuable for agents tackling large, multi-step problems where early LLM errors may otherwise cascade into flawed results. Looking ahead, the researchers believe EnCompass could help AI agents operate on larger codebases, support scientific research workflows, and even assist in hardware design. Overall, the framework makes AI agents more flexible and reliable, offering a structured way to harness search within complex LLM-driven systems.