Agentic AI Engineering with LangChain
Student lab guides

Build production agents with LangChain, step by step

17 hands-on labs, from your first tool-calling agent to evaluation, observability and deployment. Each guide starts from an empty folder and ends with working code running against Azure OpenAI.

1 · Set upCreate a folder and a Python virtual environment.
2 · ConfigureInstall libraries and add your Azure OpenAI key to .env.
3 · BuildCopy the code block by block and read what each block does.
4 · RunRun the lab and compare with the expected output.
LAB 00 · Orientation

Hello, agent

Build your first tool-calling agent: a Northwind support assistant that looks up order status and invoice totals.

30 minBeginner
LAB 01 · Models, messages and structured output

Ticket classifier

Turn raw support tickets into typed Pydantic records with with_structured_output, and classify a whole batch at once without flooding the API.

30 minBeginner
LAB 02 · Tools and create_agent

Northwind support agent v0

Build the support agent the rest of the course extends: four tools, custom state, a per-run context, a typed Resolution answer and a tool-error policy.

60 minIntermediate
LAB 03 · Middleware

The reliability kit

Make a support agent production-ready with a middleware list: PII redaction, your own audit trail, a tool budget, retries and a fallback model.

45 minIntermediate
LAB 04 · Memory

Remembering customers

Give the support agent two kinds of memory: SQLite-backed conversation threads and a shared customer profile in a store.

45 minIntermediate
LAB 05 · Streaming and UX

Live console

Build a live terminal view of an agent run: tool calls, progress from a slow tool and the answer token by token, all from one stream call.

45 minIntermediate
LAB 06 · Retrieval and RAG

Northwind knowledge agent

Index eight policy documents in a persistent Chroma store and build an agent that searches them and answers with checkable citations.

60 minIntermediateEmbeddings
LAB 07 · LangGraph fundamentals

Ticket triage pipeline

Build a LangGraph workflow that classifies a ticket in parallel, routes it to one of three desks, and drafts a reply in a grade-and-revise loop.

60 minIntermediate
LAB 08 · LangGraph advanced

Durable refund workflow

Build a refund workflow that pauses for a manager, survives a restart through a SQLite checkpoint, pays out exactly once, and can be re-decided with time travel.

45–60 minIntermediateOffline
LAB 09 · Human in the loop and guardrails

Guarded refunds

Let an agent issue refunds safely: an off-topic filter, PII redaction, human approval above $100 and a hard $500 cap that even a reviewer cannot override.

50 minIntermediate
LAB 10 · Multi-agent systems

The support org chart

Build one support organisation twice, as supervisor-plus-subagents and as agent handoffs, and count the model calls each pattern costs.

60–75 minAdvanced
LAB 11 · MCP and interoperability

Orders MCP server

Publish the Northwind order system as an MCP server with FastMCP, then use it from an agent that checks provenance, screens tool descriptions and asks a human before moving money.

60 minAdvanced
LAB 12 · Deep Agents

The Northwind research analyst

Build a deep agent that plans, delegates research to a subagent, follows a skill, obeys its AGENTS.md memory and writes a customer health report to a virtual filesystem.

45 minAdvanced
LAB 13 · Testing and evaluation

The Northwind evaluation harness

Build the harness that decides whether a change to the support agent is safe to ship: code evaluators, trajectory scoring, a regression gate that fails CI, and a live run against Azure OpenAI.

60 minAdvanced
LAB 14 · Observability and monitoring

Prod cockpit

Instrument the Northwind support agent with metadata, cost and feedback, and print an on-call cockpit: error rate, p50/p95 latency, tokens, cost, tool health and thumbs-up rate.

45-60 minIntermediate
LAB 15 · Deployment

Ship it

Turn the Northwind support agent into a service other people can call, twice: on the local Agent Server with langgraph dev, and on a licence-free FastAPI wrapper you own.

60-75 minAdvanced
LAB 16 · Production operations

Production readiness review

Build a static reviewer that scans an agent project for production gaps, such as in-memory state, hard-coded keys and unguarded refund tools, and writes a scored gap report. Then score the human checklist that no regex can answer.

45-60 minAdvancedOffline