Teaching Coding Agents to do Spreadsheets - Nuno Campos, Witan Labs
Summary
Nuno Campos from Witan Labs details their four-month effort to improve coding agents' proficiency in spreadsheets, boosting accuracy on a financial analysis benchmark from 50% to 92%. Initial attempts with multi-agent architectures and various spreadsheet representations (SQL, XML) proved rigid or ineffective. The breakthrough involved replacing numerous individual tools with a single Node.js REPL, leveraging JavaScript for agent interaction and C# for core spreadsheet logic. This REPL provided persistent state, enabling agents to build on prior work and interleave reasoning, leading to shorter, more effective scripts and eliminating timeouts. Key to success were high-fidelity formula and rendering engines, which provided crucial feedback loops for verification, alongside incorporating domain knowledge into prompts and employing deterministic evaluation strategies.
Key takeaway
For AI Engineers developing agents for complex, multi-step tasks like spreadsheet automation, you should prioritize implementing a REPL-based architecture with persistent state. This approach significantly boosts efficiency and accuracy by enabling agents to interleave reasoning and combine actions, reducing timeouts. Invest in building high-fidelity domain-specific feedback loops, such as calculation or rendering engines, to provide robust verification. Continuously refine your agent's interface and prompt-based domain knowledge for optimal performance.
Key insights
Persistent state REPLs and high-fidelity feedback loops significantly enhance coding agents' spreadsheet mastery.
Principles
- Replace sequential tool calls with a real scripting language.
- High-fidelity feedback loops are critical for agent verification.
- Domain knowledge in prompts guides agent focus.
Method
Implement a Node.js REPL with persistent state for agent interaction, backed by high-fidelity domain-specific engines for verification and feedback, and inject targeted domain knowledge into prompts.
In practice
- Adopt REPLs for complex multi-step agent tasks.
- Develop high-fidelity domain engines for agent verification.
- Utilize deterministic evaluation over LLM-as-a-judge when possible.
Topics
- Coding Agents
- Spreadsheet Automation
- REPL Architecture
- LLM Feedback Loops
- Financial Modeling
- Deterministic Evaluation
Best for: Research Scientist, AI Engineer, Machine Learning Engineer, AI Scientist
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by AI Engineer.