In progress·typescript · pi

pi-for-excel

Open-source, multi-model AI sidebar for Microsoft Excel. Bring your own key. Reads your spreadsheet properly.


Overview

An AI sidebar add-in for Excel, powered by Pi. It reads your spreadsheet, writes formulas, formats cells, searches data, and traces dependencies — all through conversation. Bring your own API key, use any model. Free and open source.

The problem

AI agents in Excel today are fine for true greenfield work, but fall apart on real workbooks. They don't read enough of the spreadsheet. They create dead rows of code. They write overly verbose formulae. They don't keep logic and style consistent with workbook conventions.

It turns out this is a harness issue:

  • No AGENTS.md equivalent — spreadsheets are supposed to be self-documenting, but as work gets more advanced they become opaque to others. There's no natural place to put docs for the agent to read.
  • Unintuitive information exposure — the way context is pushed to the agent doesn't match how you'd brief a human.
  • Too many tools — existing add-ins give the agent 14+ tools including multiple redundant read tools. The model picks the wrong one constantly.

Pi for Excel fixes this with a tight tool surface (one read_range with a mode parameter instead of three separate tools), rich automatic context (workbook blueprint + selection tracking + change detection), and persistent sessions so the agent doesn't lose its memory every time you close the sidebar.

What it does differently

Proprietary add-insPi for Excel
ContextThin metadata push. Agent makes tool calls just to see what you're looking at.Rich workbook blueprint + auto-read of your selection — the agent already knows what you're looking at.
Formula tracingCell-by-cell. Deep trees take dozens of calls.Full formula tree in a single trace_dependencies call.
SessionsTotal amnesia. Close the sidebar, lose everything.Persistent sessions saved to IndexedDB. Resume any conversation.
Change trackingNo awareness of your edits between messages.Automatic — the agent sees what you changed and adapts.
ModelsLocked to one provider.Any model — Opus, Sonnet, GPT, Gemini, Codex, local via Ollama. Swap mid-conversation.
Cost$20+/month per seat.Free. Bring your own API key.
WritesOverwrite protection, no verification.Auto-verification — reads back written cells to check for #REF!, #VALUE!, etc.

Tools

13 purpose-built Excel tools: get_workbook_overview, read_range, get_range_as_csv, read_selection, get_all_objects, write_cells, fill_formula, search_workbook, modify_structure, format_cells, conditional_format, trace_dependencies, get_recent_changes.

Motivation

I quit VBA cold turkey when I switched to a MacBook — both my shortcuts and my macros got nerfed in one go. Existing AI add-ins didn't cut it, so I started building this for myself.

System compatibility

Runs on macOS and Windows via the Office Add-in platform. Best of luck to anyone trying this on a Windows machine. It might work!