Skip to content

Build it: end-to-end AI tutorials

Twenty complete AI builds — architecture, the code that runs, the failure you will actually hit, and what the thing costs to keep running.

Most AI tutorials stop at the demo. They read a file, call a model, print the answer, and end before anything difficult happens — before the document is four hundred pages, before two requests arrive at once, before the model returns something that is not JSON, before somebody asks what it costs. The interesting part of every one of these builds is the part that starts after the demo works.

So these pages are organised around the same four things: the architecture, in enough detail to draw; code that runs, in the standard library wherever the standard library can do it; the failure the reader will actually hit first, and how to tell it apart from the one that looks like it; and the arithmetic of what the thing costs per unit of work.

The code is deliberately unfashionable. Where a framework would hide a step, the step is written out — because the point of building a thing from parts is to know which part broke. Once you have run it once, swap in whatever library you like; you will know what it is doing for you.

Build a Chatbot With Memory in an Afternoon

A complete streaming chatbot in four files: SQLite history, server-sent events, conversation compaction and a spend cap that actually stops it.

12 min read

Build a RAG Pipeline From Scratch Without a Framework

Parse, chunk, embed, retrieve and answer in about 200 lines of Python standard library — no vector database, no orchestration framework.

13 min read

Build a Document Q&A App Over Your Own PDFs

A PDF question-answering pipeline that survives scanned pages, multi-column layouts, tables and 400-page documents — not just the demo file.

13 min read

Build a Semantic Search Engine for a Website

Crawl, chunk, embed and serve semantic search over a site — with a re-index job that only re-embeds the pages that actually changed.

12 min read

Build an Email Triage Assistant

Classify and extract from an IMAP inbox with a confidence gate, so the model handles the clear cases and a human queue takes the rest.

12 min read

Build a Meeting Notes Tool People Trust

Turn a transcript into decisions and actions where every item carries the verbatim quote it came from, and unquotable items are dropped.

11 min read

Build a Slack Bot That Answers From Your Docs

Events API handshake, request signing, the three-second rule, threading — and the permission model that makes a docs bot leak.

12 min read

Build a Support Autoresponder With a Kill Switch

An autoresponder that answers only what it is sure about, escalates the rest, and can be stopped completely by one person in one click.

12 min read

Build a Voice Assistant You Can Interrupt

Barge-in, endpointing and a mouth-to-ear latency budget derived term by term, with the interruption state machine written out in full.

12 min read

Build an Alt-Text and Captioning Service

A batch pipeline that writes alt text a screen reader user can use, with a review lane and prompts built from what WCAG actually requires.

11 min read

Build a Research Agent That Cites Its Sources

Search, fetch, extract and cite under a hard tool-call budget — with citation verification that rejects claims the sources do not support.

13 min read

Build a Recommendation Feed With Embeddings

An embedding-based feed with a cold-start path, maximal marginal relevance for diversity, and a feedback loop that does not collapse into a bubble.

12 min read

Build a Content Moderation Queue

A two-stage moderation pipeline with an appeals path and a tamper-evident audit trail, sized so the expensive model sees a small fraction of traffic.

12 min read

Build an Internal Assistant Over Confluence and Drive

Permission-aware retrieval over company documents: index the access control list with each chunk, filter before the search, and handle revocation.

13 min read

Build an Invoice Extraction Service

Extract invoice fields into a strict schema, validate the arithmetic, and route to a human when the totals do not reconcile.

12 min read

Build a Translation Workflow With Quality Gates

Machine translation with enforced glossary terms, placeholder integrity checks, a back-translation gate and a human sign-off queue.

12 min read

Build a Newsletter Digest Agent That Runs on Cron

A cron-driven digest that clusters the same story across five sources into one entry, with the daily token cost derived from what it actually reads.

11 min read

Build a Spreadsheet Cleaner

Infer column types, repair the rows that do not fit, and produce a reviewable diff — because a cleaner that writes back in place is a data loss incident.

11 min read

Build a Study Tool That Writes and Grades Questions

Generate questions grounded in source material with a justified answer key, check the distractors mechanically, and grade free-text answers against a rubric.

12 min read

Build a Workflow That Survives a Crash Mid-Run

A resumable multi-step AI workflow in SQLite: an explicit state machine, idempotent steps, retries with jitter and an outbox for side effects.

13 min read

Other topics