Teaching Coding Agents to do Spreadsheets - Nuno Campos, Witan Labs

· Source: AI Engineer · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering, Robotics & Autonomous Systems · Depth: Advanced, long

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

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

Topics

Best for: Research Scientist, AI Engineer, Machine Learning Engineer, AI Scientist

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by AI Engineer.