← all demos

formula editor (erp.ai-style)

Click a cell below to select it. The formula bar shows the formula. Type a natural-language instruction in the ask AI box and the formula rewrites in place — entirely locally, entirely synchronously. Every transformation in this demo is done by a pattern-match layer in Transform.formula(), so there's no model call and no network hit at all.

Try: add a 10% discount for employees, apply 8% tax, round to 2 decimals, handle empty cells, wrap in iferror, multiply by 1.5, take absolute value.

A1
ABCDE
✦ ask AI
add a 10% discount apply 8% tax round to 2 decimals null-safe wrap in iferror multiply by 1.5 abs negate convert to EUR
before
after
source
whyselect a cell with a formula and ask the AI to change it

what's happening

  click cell → select → formula bar shows formula
       │
       ▼
  type instruction in ask-AI → Transform.formula(input, instruction)
       │
       ├─ fast path: 10 pattern rewrites
       │              (discount, tax, round, null-safe, iferror,
       │               multiply, divide, abs, negate, currency)
       │
       └─ slow path: LLM fallback (not needed for this demo)
       ▼
  structured result: { output, source, confidence, explanation }
  cell gets the new formula, before/after panel updates, flash animation
        

Every transformation you see here is pattern-rewritten structurally in microseconds. Open DevTools → Network: nothing goes out. Unplug your internet: it still works.

The same Transform.formula() call falls through to an on-device LLM for instructions the rules can't match. That path isn't exercised in this demo (the shipping v0.1 weights are a tiny random-init model, not real enough yet to write formulas) but when the real SmolLM2-360M weights arrive, the same code transparently handles the long tail.