Skip to content

Rust + AI · Project-First

First Principles · Build it, run it, break it, understand it

You will not study Rust for months and hope to use it later. You will not read AI theory and hope a prompt eventually becomes a product. You will build seven real systems, and every language or AI concept will arrive when the next feature forces you to understand it.

Make something useful first. Then let the artifact, compiler, tests, and evals teach you. Every project starts with a visible result, grows in small runnable slices, includes deliberate failures, and ends with evidence that the behavior works.

34 build daysOne focused product slice per chapter, with exact commands and expected evidence.
Offline firstRequired tests use fixtures, scripted models, and local mechanics; paid APIs remain optional.
Production finishOwnership to async services, RAG to agents, local models to eval-gated deployment.
01 · Brandforge

Turn website evidence into a typed business profile, claim audit, image prompt, and visual ad preview.

02 · AskDocs

Ingest local documents, retrieve relevant chunks, stream an answer, and verify exact citations.

03 · Signal Room

Align logs, screenshots, traces, and voice notes into a cited incident hypothesis graph.

04 · Cutroom

Decode and sample video, extract specialist signals, align a timeline, and produce a cited critique.

05 · Forge

Build a safe coding/research agent with typed tools, authorization, progress, receipts, replay, and evals.

06 · Model Lab

Inspect transformer mechanics, run local inference, route small models, and make tuning decisions.

07 · Mosaic

Ship the complete platform with an API, durable jobs, streaming, tenancy, observability, and rollback.

The first project is inspired by the kind of small AI experiment that makes learning stick: provide business information, generate something visible, inspect what the model got wrong, and improve the system in code.

Terminal window
cd rust/rust-ai-engineering
cargo run -p brandforge -- build \
--source fixtures/brandforge/site.md \
--profile fixtures/brandforge/business-profile.json \
--output target/brandforge

Open target/brandforge/ad-preview.svg, then inspect the prompt, profile, claim audit, and run report. Next run the unsupported profile and watch Brandforge reject a plausible but invented 98% metric.

see the product → predict → type the slice → run → break → inspect → test → explain

Each day contains:

  1. the product behavior you are adding;
  2. the files and types involved;
  3. runnable code and exact commands;
  4. expected evidence;
  5. a deliberate failure;
  6. tests or evals;
  7. what Rust protected and what the AI system still cannot guarantee.

The companion crate is the reference answer. Type the slice yourself first when possible, then compare.

Product needRust concept that becomes necessaryAI concept that becomes necessary
preserve a website snapshotownership, borrowing, paths, errorsfrozen evidence and provenance
consume model outputstructs, enums, Serde, validationstructured output and refusals
search documentsslices, lifetimes, iterators, floatsembeddings, ranking, citations
process mediabytes, checked math, async workersOCR, transcription, alignment
let a model acttraits, state machines, capabilitiestools, policy, progress, stopping
run local modelstensors, native boundaries, resource budgetstokenization, sampling, quantization
operate a serviceAxum, SQLx, channels, tracingevals, routing, rollout, rollback

The exhaustive topic chapters remain available in the Deep Reference Library, linked from the build day where each topic first matters.

The maintained OpenAI Codex CLI is implemented in Rust. Project 5 uses its public source as a real-world architecture study before you extend Forge with tools, approvals, sandbox-shaped policy, traces, and replay. Rust + AI is not a hypothetical pairing; it already powers a widely used native coding agent.

Ready? Build Brandforge →