Practical AI engineering · TypeScript
Build reliable AI workflows and agents.
A hands-on TypeScript course for building dependable AI features, multi-step workflows, tool-using agents, and production automation.
Progress is saved in this browser. No account or API key required.
Your next moves
Start small. Your queue adapts as you learn.Up next
What you will build
11 units · 53 short lessonsGo from one reliable AI call to production automation.
No Ax experience needed. Each unit adds one practical capability, from structured outputs and workflows to agents, external tools, long-running tasks, and production operations.
Unit 1 · DSPyBuild AI features you can measureTurn a one-off prompt into a program with clear inputs, outputs, examples, and a definition of success.0 of 3
Turn a prompt into a reliable programMeasure whether your AI feature improvedGive every AI call a clear contract
Knowledge checkAvailable after all 3 lessons · 5 questions
Finish lessons to unlockUnit 2 · SignaturesMake AI outputs predictableChoose a model and define validated data contracts so the rest of your application can trust the result.0 of 4
Connect Ax to the right modelDescribe inputs and outputs in one lineAdd richer validation to your fieldsReuse the same contract everywhere
Knowledge checkAvailable after all 4 lessons · 5 questions
Finish lessons to unlockUnit 3 · AxGenBuild a reliable AI-powered featureGenerate structured results, stream updates, recover from bad responses, and call your own typed tools.0 of 5
Run your first typed AI callRecover from invalid model outputShow typed results as they arriveChoose better results and keep contextLet the model call your code safely
Knowledge checkAvailable after all 5 lessons · 5 questions
Finish lessons to unlockUnit 4 · AxFlowConnect AI steps into a workflowCompose repeatable steps with branches, loops, parallel work, and application-owned state.0 of 4
Build a workflow with explicit stepsPass useful state from step to stepBranch, loop, and run work in parallelTurn a workflow into a reusable tool
Knowledge checkAvailable after all 4 lessons · 5 questions
Finish lessons to unlockUnit 5 · AxAgentBuild an agent that can use toolsLet AI discover capabilities, ask for missing information, delegate work, and return a dependable result.0 of 5
Let an agent investigate and actGive an agent many tools without overloadDelegate a job to a specialist agentPause and ask instead of guessingSee what your agent did and why
Knowledge checkAvailable after all 5 lessons · 5 questions
Finish lessons to unlockUnit 6 · RLMSolve long and complex tasksInvestigate large logs or datasets over many steps without stuffing everything into the prompt.0 of 5
Work through large tasks one step at a timeKeep useful values across agent turnsKeep bulky evidence out of the promptControl how much history the model seesAsk small questions mid-investigation
Knowledge checkAvailable after all 5 lessons · 5 questions
Finish lessons to unlockUnit 7 · PEEKGive agents memory and orientationHelp an agent navigate the same codebase or document set repeatedly and recall only what it needs.0 of 5
Stop re-exploring the same codebaseKeep an orientation map up to dateReuse orientation across many questionsRecall the right facts when neededLoad the right procedure for the job
Knowledge checkAvailable after all 5 lessons · 5 questions
Finish lessons to unlockUnit 8 · OptimizationMeasure and improve AI qualityEvaluate real tasks, optimize prompts and tool use, and retain lessons from verified failures.0 of 6
Test AI behavior on real examplesImprove a generator or workflow with dataImprove how an agent chooses and actsCompare better prompts without one fake winnerTurn verified runs into reusable guidanceTrade extra model work for a better answer
Knowledge checkAvailable after all 6 lessons · 5 questions
Finish lessons to unlockUnit 9 · Native MCPConnect to external tools and dataUse MCP to discover and safely connect servers, tools, resources, and long-running tasks.0 of 5
Connect to an MCP serverDiscover what an MCP server offersGive Ax programs native MCP toolsConnect to remote MCP safelyHandle long-running MCP work
Knowledge checkAvailable after all 5 lessons · 5 questions
Finish lessons to unlockUnit 10 · MCP notificationsReact safely to live eventsTurn updates and remote task events into durable, authorized agent wake-ups and resumptions.0 of 6
Separate incoming updates from agent workSubscribe only to the resources you needRestore subscriptions safely after reconnectingGive events one safe front doorChoose whether an event observes or actsResume only the task that owns the event
Knowledge checkAvailable after all 6 lessons · 5 questions
Finish lessons to unlockUnit 11 · ProductionShip AI systems you can operateControl cost, latency, fallbacks, security, media, telemetry, and failure handling in production.0 of 5
See failures, cost, and latency in productionAdd images, audio, and model thinkingFall back without changing your app contractRoute webhooks through the same event runtimeKeep every language surface safe and consistent
Knowledge checkAvailable after all 5 lessons · 5 questions
Finish lessons to unlock→ Start here○ Comes later✓ Learned↻ Review due
Local progress
Goals and portability
Pages
- Add images, audio, and model thinking You declare images, files, audio, and other media in the program contract. Provider support determines which media and thinking controls are available.
- Add richer validation to your fields You use the fluent builder for limits, nested objects, arrays, optional fields, and richer descriptions. Validation becomes part of the program instead of cleanup after it.
- Ask small questions mid-investigation You use llmQuery() for a focused semantic question over narrowed context and child agents for tool-using subtasks. The runtime can also upgrade exploration, answer directly, or repair failed code.
- Branch, loop, and run work in parallel You keep important branches, loops, and parallel work under application control. The model handles typed steps instead of improvising the orchestration plan.
- Build a production incident-response agent Combine everything into an agent that investigates a large incident, uses external tools, waits safely for live updates, and proves its recommendations improved. AxFlow owns the fixed phases, AxAgent handles the investigation, and the runtime keeps long context and resumptions under control.
- Build a reliable AI-powered feature Knowledge Check Five-question review of Build a reliable AI-powered feature.
- Build a workflow with explicit steps You define application-owned state and a visible sequence of typed nodes. Input mappings feed each node, and the return mapping selects the final result.
- Build AI features you can measure Knowledge Check Five-question review of Build AI features you can measure.
- Build an agent that can use tools Knowledge Check Five-question review of Build an agent that can use tools.
- Choose better results and keep context You can keep chat context, sample several candidates, select one result, cache responses, and observe steps. Add each option only when your feature needs that control.
- Choose whether an event observes or acts You choose an explicit action for every route: observe, invalidate, wake, or resume. Only wake and resume may invoke a model.
- Compare better prompts without one fake winner You let GEPA reflect on failures and change optimizable components. A Pareto frontier keeps honest tradeoffs between quality, cost, latency, and brevity visible.
- Connect AI steps into a workflow Knowledge Check Five-question review of Connect AI steps into a workflow.
- Connect Ax to the right model You configure the provider, current model, credentials, and runtime options in one place. Your program contract stays separate from that choice.
- Connect to an MCP server You initialize one negotiated MCP session over the transport that fits your deployment. Streamable HTTP is the normal current choice for a remote server.
- Connect to external tools and data Knowledge Check Five-question review of Connect to external tools and data.
- Connect to remote MCP safely You authorize remote MCP with OAuth, client credentials, or enterprise policy while keeping application identity separate. URL validation and SSRF protections stay enabled.
- Control how much history the model sees You choose how aggressively earlier actions are summarized without deleting live runtime values. Checkpointed with a balanced budget is the practical starting point.
- Daily Review Strengthen due Ax lessons in one interleaved review session.
- Delegate a job to a specialist agent You expose a child agent as a typed specialist with its own tools, runtime, and context. Use one when the delegated job needs an independent agent loop.
- Describe inputs and outputs in one line You can describe an ordinary typed contract in one readable line. Inputs go before the arrow and outputs go after it.
- Discover what an MCP server offers You inspect the negotiated catalog for tools, prompts, resources, templates, and capabilities. Your app uses server-owned identifiers instead of guessing them.
- Fall back without changing your app contract You route across models by capability, health, latency, price, or application policy. A fallback preserves the typed contract and remains observable.
- Find Your Starting Point Skip what you already know and begin with the right practical AI engineering lesson.
- Give agents memory and orientation Knowledge Check Five-question review of Give agents memory and orientation.
- Give an agent many tools without overload You group large tool catalogs and load their details only when relevant. The agent begins with a compact index instead of carrying every tool description.
- Give Ax programs native MCP tools You attach native MCP context to generators, agents, and flows without rewriting every capability as a host tool. Protocol progress remains separate from generated output.
- Give events one safe front door You publish normalized events into an inbox where policies authenticate, authorize, retry, dead-letter, and route them. Source callbacks never call a model directly.
- Give every AI call a clear contract You use one signature vocabulary across generation, tools, agents, flows, and optimization. That shared meaning makes later Ax features easier to combine.
- Handle long-running MCP work You can monitor progress, provide requested input, cancel, or resume work that finishes later. Recording and deterministic replay make the protocol lifecycle testable.
- Improve a generator or workflow with data You tune a generator or workflow from examples and a metric. Bound the budget, keep validation data separate, and apply the returned artifact through the program API.
- Improve how an agent chooses and acts You evaluate the whole agent pipeline and tune its actor or responder. Good task records exercise tool choice, clarification, delegation, and final quality.
- Keep an orientation map up to date You update and snapshot the map after successful runs, either indefinitely or during a warmup. Failed, aborted, and clarification runs leave it unchanged.
- Keep bulky evidence out of the prompt You place large inputs in the runtime and expose only a preview and shape to the model. Declared contextFields keep the full value available by reference.
- Keep every language surface safe and consistent You treat model output, tool results, resources, notifications, and catalog text as untrusted. Generated language packages preserve the shared Ax contract through native APIs.
- Keep useful values across agent turns You can reuse successful variables and functions across actor turns. Prompt history may be summarized while live runtime values remain available.
- Let an agent investigate and act You give a typed task an iterative runtime where the model can inspect evidence, call tools, and delegate. It still finishes through your declared output contract.
- Let the model call your code safely You wrap a host capability with a name, purpose, typed arguments, result, and handler. The model sees when and how to call it while your app keeps control of execution.
- Load the right procedure for the job You load procedural guides with discover() from a local catalog or external retrieval. Relevance hints guide selection without replacing authorization or evidence.
- Make AI outputs predictable Knowledge Check Five-question review of Make AI outputs predictable.
- Measure and improve AI quality Knowledge Check Five-question review of Measure and improve AI quality.
- Measure whether your AI feature improved You pair realistic examples with a metric, then compare versions on the same evidence. This turns prompt tweaking into a repeatable improvement loop.
- Pass useful state from step to step You make dependencies visible by passing state between sequential nodes. Use map() for ordinary transformations that do not need another model call.
- Pause and ask instead of guessing You make the agent ask when a missing fact would change an action or result. Your host persists that pause, resumes safely, and keeps failures distinct from final output.
- React safely to live events Knowledge Check Five-question review of React safely to live events.
- Recall the right facts when needed You load task-relevant facts from a local catalog or external search only when needed. recall() makes the selected memories available on the next actor turn.
- Recover from invalid model output You let Ax validate fields and retry with specific correction feedback. Your app can still distinguish generation errors, provider failures, and cancellation.
- Restore subscriptions safely after reconnecting You reconcile catalog changes and restore known subscription intent exactly once after reconnecting. Partial failure keeps the prior known-good ownership state.
- Resume only the task that owns the event You let input-required and terminal events resume only their identity-scoped owning continuation. Recorded envelopes make that boundary testable without a live server.
- Reuse orientation across many questions You reuse one map across many questions about a repository, document set, or system. The agent still inspects current evidence, but it knows where to begin.
- Reuse the same contract everywhere You keep a field’s meaning stable as it moves through generators, tools, flows, agents, and events. That makes composed systems easier to validate and evaluate.
- Route webhooks through the same event runtime You route authenticated webhooks, timers, queues, and application events through AxEventRuntime. UCP commerce events use the same explicit wake and resume policy.
- Run your first typed AI call You run a declared program with a provider and typed input. The returned object follows the output side of your signature.
- See failures, cost, and latency in production You add traces, usage and cost accounting, cache policy, cancellation, bounded retries, and safe logs. Debug output becomes evidence for tests and operations.
- See what your agent did and why You keep task input, context, orientation, memories, and skills in the right lifecycle. Runtime hooks then show the turns, tool calls, traces, status, and usage behind the answer.
- Separate incoming updates from agent work You treat delivery and model execution as separate decisions. A resource subscription receives updates but never grants an agent permission to run.
- Ship AI systems you can operate Knowledge Check Five-question review of Ship AI systems you can operate.
- Show typed results as they arrive You can render typed deltas while the answer is still arriving. The final result remains governed by the same signature and assertions.
- Solve long and complex tasks Knowledge Check Five-question review of Solve long and complex tasks.
- Stop re-exploring the same codebase You give an agent a compact, persistent map of a recurring corpus. It begins oriented while still checking current evidence for each task.
- Subscribe only to the resources you need You start with no resource subscriptions and opt into a selector or explicit URI list. Templates are never expanded or authorized automatically.
- Test AI behavior on real examples You record realistic inputs, criteria, expected or forbidden actions, predictions, and traces. Use deterministic metrics when possible and judges when quality needs holistic review.
- Trade extra model work for a better answer You use refine() when one request should generate, critique, and improve candidates at runtime. It is separate from offline optimization and long-lived playbook learning.
- Turn a prompt into a reliable program You describe what goes in and what must come out, so your app stops parsing model prose. Ax turns that contract into the prompt and validation loop.
- Turn a workflow into a reusable tool You can expose a flow as a tool, trace it, wait on an owned continuation, and optimize its components. The shared optimizer tunes the flow without a separate flow-only API.
- Turn verified runs into reusable guidance You accumulate situational guidance from live feedback or a verified task set. Evolution keeps grounded advice that improves performance without unacceptable held-out regression.
- Work through large tasks one step at a time You let the actor run one observable step, inspect compact evidence, and continue from live state. This avoids stuffing a large task into one prompt or generated script.