
Every finance team faces the same monthly headache: downloading raw data, filtering rows, unpivoting columns, and rebuilding reports from scratch. You spend hours performing the exact same steps every month, just on different datasets.
SheetAgent changes this cycle by turning manual Excel workflows into automated, reusable code. Instead of prompting an AI every single time you need a report, you use an LLM to train once and then run the resulting logic forever without any further AI intervention.
The Problem: The ‘Prompting’ Trap
Most current AI solutions for data tasks require constant prompting. This means every time you process a new month of data, you are paying for API calls, dealing with latency, and risking inconsistent results. It is not true automation; it is just faster manual work.
| Feature | Standard LLM Prompting | SheetAgent Workflow |
|---|---|---|
| Runtime Cost | Ongoing API fees per run | Zero (Pure Code) |
| Latency | High (Waiting for LLM response) | Instant (Local execution) |
| Reliability | Stochastic/Variable | Deterministic (Code-based) |
The Solution: Training an AI Recipe

SheetAgent works by observing a single example of your work. You provide the input file, a description of the task, and optionally the finished output file. The agent then performs a deep comparison to understand exactly how you transformed that data.
How it Works: Learn, Verify, Run
The process is designed to be self-correcting and highly accurate through three distinct phases:
- Learn: The LLM analyzes your files and generates both Power Query M code and equivalent pandas code.
- Verify: A self-healing executor runs the pandas code against your training data. If it doesn’t match your output exactly, the LLM auto-fixes the code until it does.
- Run: You save this as a ‘Recipe.’ Next month, you simply feed new data into the recipe. It runs instantly with no API key required.
Key Features for Data Professionals

SheetAgent isn’t just a wrapper; it is built to handle the messy realities of real-world spreadsheets:
- Multi-row header detection: Handles complex hierarchies like Region/Product/Metric.
- Temporal awareness: Automatically understands that Q2 2024 comes before Q1 2025 during sorting.
- AST-based sandbox: Ensures all LLM-generated code is safety-checked before execution.
- Model Agnostic: Works seamlessly with Gemini, Anthropic, or OpenAI via Mastering Multi-Model Orchestration with LiteLLM.
Getting Started
You can explore the full implementation on SheetAgent’s GitHub repository. To get up and running locally, follow the instructions in the official setup guide.
For those looking to build more complex agentic systems, you might also be interested in how we approach orchestrating local LLM clusters to handle heavy workloads.
# Installation and Execution
pip install -e "[all]"
cp .env.example .env # Add your API key here
py -m streamlit run ui.py
Conclusion
Stop prompting and start programming. SheetAgent allows you to capture the intelligence of an LLM once and deploy it as high-performance, zero-cost code that works every month without fail.

