SheetBrain-AI

01/2025 — 02/2025
Enterprise automationReal-time auditing

The Problem

Enterprise teams needed automated spreadsheet error detection and formula auditing with policy compliance checks.

The Solution

Engineered an AI-powered formula auditing tool using TypeScript and Google Apps Script. Designed real-time recommendation engines with policy compliance checks and intelligent formula insights. Created seamless integration between cloud spreadsheets and LLM APIs.

Impact

Automated error detection and formula auditing for enterprise spreadsheets with real-time recommendations.

Architecture

Google Apps Script acts as the execution layer inside Google Sheets, intercepting formula changes and sending cell ranges to a TypeScript middleware. The middleware batches requests and calls the LLM API with structured prompts that include the spreadsheet schema and policy rules. Responses are parsed into typed recommendation objects and written back to the sheet as comments and suggested corrections.

Key Challenges

  • Google Apps Script has a 6-minute execution limit and no native async support. Solved this by chunking large spreadsheets into row batches and using Apps Script triggers to chain executions across the time boundary without losing state.
  • LLM responses for formula auditing were inconsistent in format, making them hard to parse reliably. Enforced structured JSON output using schema-constrained prompting and added a validation layer that retries with stricter constraints when parsing fails.
  • Policy compliance rules varied by enterprise client. Built a rule-engine layer that loads policy configs from a JSON file per workspace, so the auditing logic stays generic while the compliance checks are fully customizable.

Key Learnings

LLMs are surprisingly good at spreadsheet auditing when given the right schema context — but they hallucinate formula corrections confidently. The real engineering work was building the validation layer that catches wrong suggestions before they reach the user, not the prompting itself.

Technologies

TypeScriptGoogle Apps ScriptLLM APIsGSuite Integration