End-to-End Agent Deployment
End-to-End Agent Deployment
Watch the recording
Recording available with Main+.
Main+Follow the tutorial
11 pages of step-by-step instructions you can work through at your own pace.
Basic+Starting from a Jupyter notebook that runs an agentic-RAG bot, we turn it into a FastAPI service with a vanilla-JS frontend, containerize it, deploy it to Railway, and add a GitHub Actions CI/CD pipeline. Most of the code-writing work is delegated to a coding agent (Claude Code), and the exact prompts I used are quoted verbatim.
Links
The app you will build
The final app looks like this:
The final app is a minimal teaching-assistant chatbot for the
DataTalks.Club Data Engineering Zoomcamp FAQ.
One tool is exposed to the model: search(query). Everything else is the
web layer, the container, and the deploy pipeline.
Walkthrough
Follow the numbered files in order. Each file is one self-contained step.
- Overview and setup - what you will build, prerequisites, and project
setup with
uvand.env. - Part 1: The starting notebook - the agentic RAG notebook. FAQ
loading,
minsearchindex,AsyncOpenAI, one-by-hand tool-call round, then the fullrun_agentloop with a renderer. - Part 2: Notebook to FastAPI backend - split the notebook into
app.py,agent.py,search.py,renderer.py,schemas.py. Two endpoints (/ask,/ask/stream) plus/health. - Part 3: Vanilla-JS frontend with Vite - scaffold a tiny
frontend/with Vite and plain JavaScript, proxied to the backend in dev. - Part 4: Streaming with Server-Sent Events - replace the wait-for-the-whole-answer UI with one that streams tokens live and shows tool calls as collapsible blocks.
- Part 5: Dockerize as one container - one-container, two-stage Dockerfile that builds
the frontend with Node and serves it from the FastAPI Python image. Includes the
.envquoting gotcha. - Part 6: Deploy to Railway via CLI - deploy the Docker image to Railway using the Railway CLI.
- Part 7: GitHub Actions CI/CD - a GitHub Actions workflow
that calls
railway upon every push, plus a note on never pasting tokens into the agent chat. - Deferred items - what was intentionally skipped and earmarked for a follow-up: vector DB, multi-turn chat, structured output, tests, dev/prod separation.
- Q&A: side discussions - side discussions from the live session: Hetzner vs cloud, tmux, SSH port forwarding, coding-agent pricing, framework choice, free models, FastAPI folder conventions.
Appendix
A file inventory of the final repo is in Appendix: file inventory.
Tutorial pages
- 1 Overview and setup
- 2 Part 1: The starting notebook
- 3 Part 2: Notebook to FastAPI backend
- 4 Part 3: Vanilla-JS frontend with Vite
- 5 Part 4: Streaming with Server-Sent Events
- 6 Part 5: Dockerize as one container
- 7 Part 6: Deploy to Railway via CLI
- 8 Part 7: GitHub Actions CI/CD
- 9 Deferred items
- 10 Q&A: side discussions
- 11 Appendix: file inventory
Upgrade to Basic to access this workshop
The workshop overview and page list are visible now; membership unlocks the step-by-step tutorial.
Basic+ required
View Pricing