Summary
Nuno Campos of Witan Labs presents a detailed account of four months spent engineering AI coding agents to work reliably with spreadsheets — a task that proves considerably harder than it first appears. Starting at 50% accuracy on an internal financial analysis benchmark, the team reached 92%, and the talk is an unusually honest account of what actually moved the needle versus what turned out to be dead ends.
The fundamental challenge is representational: humans navigate spreadsheets visually and intuitively, but LLMs need a text serialization that captures structure, formulas, and layout. The team tested SQL, XML, CSV, HTML, and several custom formats — none worked well as a standalone approach. The breakthrough came from consolidating roughly 15 discrete tools into a single Node.js REPL, allowing the agent to compose JavaScript function calls freely rather than making sequential, rigid tool calls. This change alone eliminated timeout failures (which had been chronic on a 5-minute task limit) and pushed accuracy from 74% to 92% through subsequent refinements including fuzzy search, formula dependency tracing, and system prompt improvements.
Two supporting engines proved essential: a formula execution engine that calculates cell values and a high-fidelity rendering engine that converts spreadsheet ranges to images, giving the agent a visual verification loop analogous to a compiler or linter. The architecture cleanly separates the agent-facing scripting layer (JavaScript/TypeScript, chosen for LLM familiarity and sandboxability) from the underlying spreadsheet implementation (C#), making it straightforward to expose new capabilities to the agent without restructuring the tool schema.
📺 Source: AI Engineer · Published July 08, 2026
🏷️ Format: Deep Dive







