EnCompass: Enhancing Agent Programming with Search Over Program Execution Paths
Zhening Li, Armando Solar-Lezama, Yisong Yue, Stephan Zheng
Abstract
We introduce a new approach to agent programming, the development of LLMbased agents. Current approaches to agent programming often entangle two aspects of agent design: the core workflow logic and the inference-time strategy (e.g., tree search). We introduce probabilistic angelic nondeterminism (PAN), a programming model that disentangles these two concerns, allowing the programmer to describe the agent workflow and independently experiment with different inference-time strategies by simply changing a few inputs. We provide an implementation of PAN in Python as the ENCOMPASS framework, which uses a Python decorator to compile agent workflow programs into a search space. We present three case studies that demonstrate how the framework lets the programmer quickly improve the reliability of an agent and easily switch between different inference-time strategies, all with little additional coding.
branchpoint(**branchpoint_params)
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
1 top-tier paper has cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Self-Refine: Iterative Refinement with Self-Feedback
- WebArena: A Realistic Web Environment for Building Autonomous Agents cites Tree of Thoughts: Deliberate Problem Solving with Large Language Models
- SWE-bench: Can Language Models Resolve Real-world Github Issues? cites WebArena: A Realistic Web Environment for Building Autonomous Agents
- Reflexion: language agents with verbal reinforcement learning cites Self-Refine: Iterative Refinement with Self-Feedback
- PPDL: LLM-Based Flows as Probabilistic Programs cites Tree of Thoughts: Deliberate Problem Solving with Large Language Models
- PPDL: LLM-Based Flows as Probabilistic Programs cites Self-Refine: Iterative Refinement with Self-Feedback
- PPDL: LLM-Based Flows as Probabilistic Programs cites SWE-bench: Can Language Models Resolve Real-world Github Issues?
Cited by top-tier papers1
Builds on20
- Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan et al.NeurIPS 2023 · 5,828 citations
- Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations
- Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
- SWE-bench: Can Language Models Resolve Real-world Github Issues?Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao et al.ICLR 2024 · 2,082 citations
- WebArena: A Realistic Web Environment for Building Autonomous AgentsShuyan Zhou, Frank F. Xu, Hao Zhu, Xuhui Zhou et al.ICLR 2024 · 1,197 citations
Related papers
- Probabilistic Programming Bots in Intuitive Physics Game PlayFahad Alhasoun, Sarah AlnegheimishAAAI 2021 · 1 citation
- Online and Interactive Bayesian Inference DebuggingNathanael Nussbaumer, Markus Böck, Jürgen CitoICSE 2026
- A Programmatic and Semantic Approach to Explaining and Debugging Neural Network Based Object DetectorsEdward Kim, Divya Gopinath, Corina S. Pasareanu, Sanjit A. SeshiaCVPR 2020
- Orpheus: Engineering Multiagent Systems via Communicating AgentsMatteo Baldoni, Samuel H. Christie V., Munindar P. Singh, Amit K. ChopraAAAI 2025 · 9 citations
- LogicHunter: Testing LLM Agent Frameworks with an Agentic OracleMinghui Long, Yanjie Zhao, Haoyu WangISSTA 2026
