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.
- Work performed as a consultant for Asari AI Core primitives The two most important primitives that are available in the body of an ENCOM-PASS-decorated function are branchpoint() and record_score(). branchpoint(**branchpoint_params)
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext e3c38b9a-680d-45bf-94ea-1ae805d3efc1Cited by top-tier papers1
Ask how each one uses itBuilds 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
- LogicHunter: Testing LLM Agent Frameworks with an Agentic OracleMinghui Long, Yanjie Zhao, Haoyu WangISSTA 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
- stratum: A System Infrastructure for Massive Agent-Centric ML WorkloadsArnab Phani, Elias Strauss, Sebastian SchelterVLDB 2026
