Turn messy customer orders (emails, POs, spreadsheets, even photos) into clean, catalog-matched line items ready for an ERP.
The interactive demo I ran on customer calls as a co-founder of Ventura (YC W26), where we built AI quoting and order entry for industrial distributors.
Next.js 14 · TypeScript · Tailwind CSS · optional AI mode
The Edge Case demo: forwarded iMessage chaos becomes 20 structured line items, one gets flagged for review, and the order goes to the ERP.
Industrial distributors run on inside sales teams whose day is re-typing orders into an ERP. The orders arrive as informal emails, faxed POs, exported spreadsheets full of typos, and photos of handwritten counter slips. Every line is a chance for a wrong SKU, a wrong quantity, or a lost hour.
This demo shows the AI-native version of that workflow end to end: paste anything, get back structured line items matched against a live product catalog with per-line confidence, and review everything before it touches the ERP.
- Parses anything: free-form emails, formal purchase orders, messy CSVs, forwarded text messages, and (with an API key) photos of handwritten orders
- Fuzzy-matches every line to a product catalog: resolves abbreviations (
blk iron niples 3/4becomes Pipe Nipple 3/4" x 6", Sch 40, Black Iron), fixes typos, and honors exact SKUs - Scores its own confidence: every match gets a 63-99% confidence band derived from word coverage and edit distance, shown as a per-row meter
- Keeps a human in the loop: unmatched items are flagged, and the "Send to ERP" button stays locked until a person accepts or rejects each one, with totals recomputing live
- Shows the receipts: hover any row to see the exact original text it was extracted from
- Works with zero setup: no API key needed, since a rules-based mock parser powers the whole demo offline
git clone https://github.com/Ben-K-Jordan/Clean-Data.git
cd Clean-Data
npm install
npm run devOpen http://localhost:3000, click Run Demo, and try the 💣 Edge Case. It types out a forwarded text-message order and parses it live.
Optional AI mode: add an API key to enable real LLM parsing and image scanning.
cp .env.example .env.local # then set ANTHROPIC_API_KEYOne API route, two interchangeable engines:
| Mode | When | Engine |
|---|---|---|
| Mock (default) | No API key | Rules-based pipeline: junk-line filtering → multi-item splitting → 7 regex extraction patterns → fuzzy catalog matching → Levenshtein-based confidence model |
| AI | ANTHROPIC_API_KEY set |
Hosted LLM with the catalog in-prompt; handles text and images (handwritten orders) |
The mock mode isn't a stub. It's a real parsing pipeline that survives the same messy inputs, so the demo is fully interactive offline and the AI path is a drop-in upgrade.
| File | What's in it |
|---|---|
lib/mock-clean.ts |
The deterministic pipeline: junk-line detection (greetings, PO metadata, section headers), multi-item line splitting, seven ordered extraction patterns, and an insights pass that counts typos fixed and abbreviations resolved |
lib/catalog.ts |
23-SKU industrial catalog (fasteners, pipe & fittings, valves, gaskets, bearings, safety, electrical, MRO) with alias-based fuzzy matching and word-overlap scoring |
lib/samples.ts |
Four handcrafted worst-case inputs, every line verified end-to-end against the parser (the PO's line items sum exactly to its stated total) |
lib/ai-clean.ts |
The LLM integration: structured-JSON extraction with the catalog in-prompt, vision support, and defensive response validation |
components/CleanedOutput.tsx |
The review surface: animated stats, confidence meters, original-text tooltips, accept/reject flow with recomputed totals, CSV export |
| Sample | What it stresses |
|---|---|
| Customer Email | Informal contractor restock: bullet lists, "need about 300 of those", multiple items per sentence |
| Purchase Order | Formal plant PO: pipe-delimited rows, exact SKUs, prices, verified totals |
| Messy CSV | Exported spreadsheet: typos (cuplings, safty), abbreviations (znc, blk), missing $ signs |
| 💣 Edge Case | Forwarded iMessages: slang, section headers, mixed formats, and one item that isn't in the catalog at all (flagged for human review) |
Next.js 14 (App Router) · TypeScript · Tailwind CSS · optional LLM integration. No database, no state library, no component framework. The point is the data pipeline and the review UX, so the footprint stays small enough to read in one sitting.
This is a standalone demo build, not Ventura's production system. The catalog, prices, and companies in the sample data are illustrative.
