Tutorials
Building things,
explained slowly.
Long-form, code-heavy deep dives on AI agents, voice systems, and observability — the kind of writing I wish existed when I was figuring this out.

Mastra, Part 1: Agents
The first part of a hands-on series on Mastra. I start where everything else builds from — defining a typed agent, giving it tools with createTool, and wiring memory so it remembers across turns.
mastraagentstypescript
Mastra, Part 2: Workflows
Part two of the Mastra series. Agents are great at deciding; workflows are great at guaranteeing. I build typed, multi-step workflows with sequencing, parallelism, branching, loops, and human-in-the-loop suspend & resume.
mastraworkflowstypescript
Mastra, Part 3: The Harness
Part three of the Mastra series. An agent and some tools aren't an application yet. Mastra's harness — the AgentController runtime — adds the session, modes, subagents, and tool approvals that turn an agent into something users can actually depend on.
mastraagentsharness
Mastra, Part 4: Streaming to a Real UI
A blocking generate() call is fine for a script. An interactive agent needs to stream — tokens, tool calls, and your own custom progress events. I wire agent.stream() into a UI and learn where the interesting data actually lives.
mastrastreamingtypescript
Mastra, Part 5: RAG — Giving the Agent Something Real to Say
A streaming agent that answers from the model's memory is still guessing. In this part I build a retrieval pipeline — chunk, embed, store, query — and wire it under the agent so it answers from your actual documents, with citations.
mastraragembeddings
Mastra, Part 6: Long-Running & Durable Agents
Some agent work doesn't fit in one request. It scrapes forty pages, waits on a human, or runs on a schedule. This part covers the machinery for work that outlives the HTTP request: background tasks, durable agents that survive a crash, and heartbeats that run on a cron.
mastradurablebackground-tasks
Mastra, Part 7: Evals & Scorers — Proving the Agent Is Good
The finale. An agent that ships without evals is a vibe with a deploy button. This part puts numbers on agent quality — deterministic checks, model-graded scorers, pass/fail gates in CI, and live sampling in production — so 'it seems better' becomes 'it scored 0.86, up from 0.71'.
mastraevalstesting