Agentic AI assistant
CalcTree’s AI assistant, built end to end on AWS Bedrock: 13 tools over a 14-step agentic loop with a validation repair cycle, so it can author and fix calculations directly on the page.
A few things I’ve shipped end to end - from the AI that runs the product to the billing and infrastructure that keep it in the black.
CalcTree’s AI assistant, built end to end on AWS Bedrock: 13 tools over a 14-step agentic loop with a validation repair cycle, so it can author and fix calculations directly on the page.
A model abstraction over Bedrock with user-selectable models across three providers, a Haiku classifier front end and 1-hour prompt caching that trims 3-4k tokens per request.
Drove down AI unit economics - a prompt-cache cutover and free-tier re-tuning measured against a pre-change baseline to keep assistant cost per user under control.
Per-step token metering wired into billing - every model call priced and reported in real time, with 402s enforcing quota the moment a workspace runs out.
The heart of the product - a directed acyclic graph over MathJS that runs dependency analysis to recompute only the statements downstream of a change, never top to bottom.
Concurrent multi-user editing on Yjs CRDTs over a Hocuspocus server, with document changes webhooking back to the page service to stay durable.
A cursor-based GraphQL subscription that streams workspace data into IndexedDB, so the UI reads locally first and keeps working offline while the server catches up.
An event-driven ingestion path - files land in S3, convert to Parquet and materialise as queryable dataset statements the calculation engine and AI can read.
Sandboxed Python execution on AWS Lambda as a first-class calculation engine, letting engineers drop scripts alongside formulas on the same reactive page.
Stripe-backed subscriptions, entitlements, trials and org budgets on top of per-model per-token pricing - the monetisation layer for the whole platform.
A GraphQL Mesh gateway federating every service behind one schema, resolving auth per request and injecting workspace-scoped roles downstream.
A Plate.js rich-text editor where prose, math, spreadsheets and reactive calculation blocks live in one MDX document - Notion for engineers.
External connectors bridging CalcTree with Excel and ETABS, moving live values in and out of the tools structural engineers already use every day.
The React 19 + Vite front end - Zustand state and a React Compiler build with no hand-rolled memoisation - that hosts the whole editing and calculation experience.
A fire-and-forget mutation model where calculation writes return immediately and results stream back over a sync subscription, keeping the UI responsive under heavy recompute.
Packaged the web app as a native desktop build with Tauri, giving the local-first, offline-friendly workflows a first-class app shell.
Authored the team’s Claude Code skills and knowledge base - codified review, sync and implementation workflows that speed up every engineer on the platform.
A Lambda that metered the EC2 fleet every 15 minutes - instance count, type and run-hours - and pushed the totals to Stripe so customer billing stayed continuously in sync.
A self-healing crawler over hundreds of Jenkins pipelines at a top US financial institution - reporting test counts, coverage, pass/fail state and red-to-green recovery times for executive oversight. Built a circuit breaker with a work queue and an adaptive rate manager that throttled on latency and error rates, crawling as fast as Jenkins could bear without ever DOSing it.
Front end for an internal insurance calculator at AXA Germany - translating complex policy maths into a usable interface for insurance staff.
A large OSGi-based Java backend for a retail bank’s credit-card division, powering the internal system field staff used to manage card products day to day.
A vulnerability-scanning platform for GSM hardware: Apache Storm analysing third-party scanner output, Drools deciding remediation actions, and an Angular front end I migrated from 1.x through 1.5 to 2.