End-to-End Agent Deployment
Full workshop writeup
Pages, code repo, and split-level access for Main and above.
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.