People can quickly see a spreadsheet’s layout, but an LLM has to work out which revenue figure matters, which period it covers, and whether it is an input or a formula. Campos said their early three-agent workflow helped move errors from model building into planning, where they were easier to correct, but its one-time discovery step and weak context sharing made it too rigid.
Teaching Coding Agents to do Spreadsheets
Speaker
Nuno Campos of Witan Labs explains how his team improved coding agents’ spreadsheet performance at an AI Engineer talk.
The team tried SQL, XML, CSV or TSV, and HTML as ways to represent spreadsheets. CSV or TSV views and rendered images proved useful as parts of a broader approach. The biggest breakthrough was replacing about 15 tools with a persistent Node.js REPL, where agents could combine spreadsheet functions in one call and build on variables across calls.
The team’s internal benchmark rose from 50% accuracy before the REPL to 74% and eventually 92%, with later gains from better fuzzy search, formula tracing, prompt improvements, and bug fixes. The approach also eliminated tasks that exceeded the five-minute timeout. Campos described a formula engine and a rendering engine as essential checks, while warning that incomplete engines can mislead agents.
Domain knowledge in prompts consistently improved results by steering models toward the task’s relevant concepts, such as revenue or ARR. The team moved from LLM-only judging toward deterministic comparisons where possible, including testing a model-produced spreadsheet against a golden spreadsheet using the same inputs. Campos also urged teams to inspect traces because apparent reasoning failures can come from bugs in tools, code, or prompts.
Campos recommended giving agents a real scripting interface when work requires many sequential or parallel tool calls. He said feedback loops, suitable interfaces, planning, and task-specific domain knowledge all matter, and interfaces may need to change as models improve. He also advised using deterministic evaluation where possible and checking traces and infrastructure for bugs.
Takeaways
- If agents need many tool calls, offer a scripting interface such as a REPL so they can combine actions and reuse state.
- Build high-fidelity calculation and rendering checks so agents can verify spreadsheet formulas and layout.
- Track benchmark results and use deterministic comparisons where possible to distinguish agent changes from evaluator variation.
- Inspect agent traces and tool behavior before treating a failure as a reasoning problem.
- Put task-specific domain reminders in prompts, and revisit the interface as model capabilities change.
Mentioned in this talk
Search inside this talk
What was claimed 4
- metric
Witan Labs: Financial analysis benchmark accuracy improved from around 50% to 92%“started at around 50% accuracy ... and got to 92%.”
YouTube Unverified1 source· Talk
- uses
Witan Labs uses JavaScript“We just went with JavaScript.”
YouTube Unverified1 source· Talk
- featurePython REPL: Persistent state lets agents build on variables and work from earlier calls
“with persistent state ... those variables are still there. So it can build on its work.”
YouTube Unverified1 source· Talk
- metric
Witan Labs: Zero timeouts with a five-minute task timeout“This approach essentially resulted in zero timeouts”
YouTube Unverified1 source· Talk










