After this lesson, you will be able to: Design, build, evaluate, and deploy a production-grade AI agent, with observability, error handling, cost tracking, and a public interface.
Code-first capstone. Production-grade is the bar. This is the lesson where everything you've learned across this track lands in one shipped artifact. By the end you have a deployed agent, an evaluation harness, observability, and a Loom demo.
1. Same rule: real, yours.
2. Bar is highest yet. Production = it can be used by someone other than you, and it survives a week without your intervention.
3. Stack hint: LangGraph for orchestration, raw SDK for hot paths, MCP for tools, FastAPI for the surface.
1. Sketch the graph: nodes, state, conditional edges, end conditions.
2. Identify external tools. Wrap as MCP server (one) or LangChain tools (each).
3. Decide retrieval: do you need RAG? If so, pick a vector store and chunking strategy.
4. Decide deployment: FastAPI + Docker → Railway/Fly. Add a /chat endpoint and a static page client.
5. Decide observability: LangSmith or your own logging to Postgres.
Wrap a LangGraph app behind an HTTP endpoint.
from fastapi import FastAPIfrom pydantic import BaseModel# from your_graph import app as agent_appapp = FastAPI()class ChatRequest(BaseModel):session_id: strmessage: str@app.post('/chat')async def chat(req: ChatRequest):# config = {'configurable': {'thread_id': req.session_id}}# result = await agent_app.ainvoke({'message': req.message}, config=config)# return {'response': result['response']}return {'response': 'TODO: wire up your graph here'}
Cost, log token counts per call to a Sheet or DB. Sum daily. Set a kill-switch if a session exceeds $X. Observability, every conversation logged with input, output, tool calls, errors, and latency. LangSmith ($39/mo) is the easy button; a Postgres table works for free.
1. Dockerize. Test locally with `docker build && docker run -p 8000:8000`.
2. Deploy to Railway or Fly.io. Point a domain or use the auto-domain.
3. Build a tiny static frontend (one HTML file with a chat box) that hits /chat.
4. Run the eval suite against the deployed instance.
5. Record a 5-min Loom: problem → architecture → live demo → eval results → cost numbers. Submit.
Sign in and purchase access to unlock this lesson.