First-principles writeups on AI engineering, distributed systems, and building companies. Written from the work, not from theory.
Field-level F1 for Apple Vision, ML Kit, PaddleOCR, and tesseract.js against cloud vision models like Gemini 2.5 Flash, measured on phone photos through a real mobile pipeline. A primer on choosing between on-device OCR, cloud VLMs, and on-device LLMs for structured extraction.
Read the piece ↗A practitioner's primer on taking a vendor-hosted AI support agent to production and operating it: test it like a customer before launch, then measure what it solves once it is live, because the headline resolution rate overstates the win. Built around Zendesk AI Agents and Ultimate AI.
ComPilot (PACT 2025) lets an off-the-shelf LLM optimize loops by proposing transformations a compiler checks for legality and times for speedup. Alfred, my open-source coding-agent fleet, runs the same propose-verify-iterate shape against tests, review, and CI instead of a compiler. A first-principles comparison of the loop, the verifier, and the memory, with the paper's numbers cited.
A reward function is a specification of correctness, not a scalar loss. Strict final-state equality is fine for a leaderboard and wrong for RL in real domains. The verifier is about 215 lines; understanding the domain is the cost.
Coding agents burn tokens on naive grep-and-read loops and raw tool output. Three independent levers cut the bill. I ran a real internal benchmark on a code-graph stack over 17 repos and the lever I expected to win did not. Here is what I measured, per engine, behind a quality gate.
Why OCR is harder than it looks, why the public datasets are skewed Latin, and why production offline OCR still runs on classical and CNN/transformer engines like Tesseract, Apple Vision, ML Kit, and PaddleOCR rather than a full VLM on the phone.
What it takes to run coding agents unattended in production: the loop that fires and recovers, the harness that contains a fully-trusted model, and memory that stays reviewable. A practitioner's guide from building Alfred.
Every AI-native workflow eventually fails partway through. There are two coherent ways to survive it: resume the work with a durable-execution engine, or make every step idempotent and re-derivable. When to use which, from systems running both.
A realtime chat UI is easy with one server. The hard part starts when a message for user A arrives on a server that does not hold A's socket. This is a primer on why WebSockets are different to scale, the pub/sub backplane that fixes the fan-out, and the connection, presence, backpressure, and reconnect problems you inherit by keeping the connection open.
A primer on the real-time web protocols, derived from scratch: what problem each one solves, how it works on the wire, when to use which, and how HTTP/2 and HTTP/3 (QUIC) change the tradeoffs. With real-world analogies and connection-model diagrams.
A primer on token streaming for chat UIs, built from first principles: why streaming matters, SSE vs websockets on the wire, server and client message state, rendering partial tokens, cancellation, and streaming tool calls. With concrete examples from the open-source Alfred codebase.
Most 'AI trading' talk skips the part that matters: the system a model has to live inside. A strategy needs features, a label, an offline train step, a backtest that reuses the live code exactly, a serving path into the signal, and guardrails that can veto the model. Here is the whole loop built from scratch, grounded in a real quantitative engine.
A lot of practical AI infra work is impedance matching between API shapes that almost agree. Here is what I learned putting a small local proxy in the seam between static-bearer clients and Vertex AI's 60-minute OAuth tokens.
A trading engine has to answer 'how did we get here' for every position and never lose an order to a crash. Event sourcing stores the facts, not the state, and CQRS splits the write path from the read path. Here is how both work, built up from scratch, with sanitized Axon code from a real order book.
When you ingest data from external providers you control none of the delivery semantics. The fix is not cleaner delivery. It is making application correctness invariant to how data arrives, with idempotency as the one primitive everything else leans on.
Building a daily hotel-performance KPI pipeline with dbt and DuckDB: dedup before you aggregate, treat occupancy and revenue status asymmetrically, validate at two grains, build byte-reproducibly, and gate CI on an independent reconciliation.
Snowflake bills compute by the second but tells you the total, not who spent it. Here is the architecture I built to reconstruct per-query cost from ACCOUNT_USAGE, the apportionment math that makes it work, the auto-suspend lever that paid for most of the savings, and how it runs as a Snowflake Native App.
How I run AI adoption for a 200-person org: measuring against a baseline, keeping devs autonomous while checking outcomes, why token spend is the wrong number, governance as config, PII guardrails, and tooling you can swap as the ecosystem moves. Written three weeks into a live rollout.
An LLM that grades other outputs is an instrument, and an unmeasured instrument is not evidence. The discipline that makes an LLM-as-judge trustworthy in production: deterministic gates first, a cached and provenance-stamped verdict, calibration against human labels with Cohen's kappa, and grading against a written policy.
How to run internal AI enablement as a business unit with its own P&L: find the pains worth automating, gate projects on a number, tie every AI dollar to an initiative, and build standards instead of buying seats.
A marketing team drowning in 200+ ungoverned email templates, dreading a risky manual migration to a new tool. Modern martech has APIs and webhooks, so an AI-driven cleanup and migration can be 80 to 90% automated. A walkthrough of the pipeline, the human checkpoints, and how to de-risk it.
When the AI bill climbs, the instinct is to ration seats. That is the wrong lever. It caps your upside to save a fraction of your downside. Control cost through standards that live in the tooling and through engineering, so a small team moves like a large one.
A single AI bill assigned to 'IT' teaches you nothing. Give each initiative its own metered credential up front, and spend attributes itself. The mechanism, the topology decision, and why you cannot reconstruct it later.
The hard part of AI enablement is choosing what to build. A field guide to finding the expensive repetitive work, gating every project on a number, and proving value with a one-day experiment before you spend on a platform.
How I built Mainteny's MVP solo in three months by shipping one workflow and cutting everything else, including the routing detour that cost me two sprints. Core loop first, infrastructure last, boring stack, customers before the product worked.
Engineers have a real advantage in modern B2B sales: they understand the product deepest and can answer the question that decides the deal. A first-principles guide to founder-led selling: help instead of pitch, do discovery, handle objections with honesty, and know when to hire.
A first-principles guide to raising a first seed round in a tight market: how the raise is a funnel, cold outreach that gets replies, what investors actually underwrite, and the mistakes that cost us weeks. From co-founding Mainteny.
Events run 10-20% of a B2B marketing budget and most teams cannot prove the return. A first-principles framework: fully loaded cost, sourced vs influenced pipeline, an attribution window matched to your sales cycle, cost per opportunity, and why follow-up speed is the cheapest lever on the funnel.
What it takes to build a real software business inside a large consulting firm: distribution before product, the organizational immune system, and why I owned the data layer myself. Lessons from taking Aura at Bain from $0 to $3.6M ARR.
My first startup was Spendzer, a banking app for teenagers in Germany. The idea was right and the timing was wrong. Here is what building it taught me about unit economics, being early, and why two engineers have to learn to sell.
I use analytics to see which pages are useful. Nothing else. You can decline. Privacy