End-to-End Agent Deployment
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
- [Workshop recording](https://www.youtube.com/watch?v=h84rcRezNM4)
- [Starting notebook (gist)](https://gist.github.com/alexeygrigorev/8c92913c23ec23e77ce8b355053ac531)
- [Final code](https://github.com/AI-Shipping-Labs/workshops/tree/main/2026/2026-04-21-end-to-end-agent-deployment)
## The app you will build
The final app looks like this:
```mermaid
flowchart LR
UI["Frontend UI<br/>vanilla JS, SSE"]
API["FastAPI app"]
AGENT["Agent loop"]
SEARCH["FAQ search tool<br/>minsearch"]
OPENAI["OpenAI Responses API"]
UI -->|POST /ask or /ask/stream| API
API --> AGENT
AGENT -->|tool call| SEARCH
AGENT -->|model call| OPENAI
API -->|JSON or SSE| UI
```
The final app is a minimal teaching-assistant chatbot for the
[DataTalks.Club Data Engineering Zoomcamp FAQ](https://datatalks.club/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.
1. [Overview and setup](/workshops/end-to-end-agent-deployment/tutorial/overview) - what you will build, prerequisites, and project
setup with `uv` and `.env`.
2. [Part 1: The starting notebook](/workshops/end-to-end-agent-deployment/tutorial/starting-notebook) - the agentic RAG notebook. FAQ
loading, `minsearch` index, `AsyncOpenAI`, one-by-hand tool-call round, then the full
`run_agent` loop with a renderer.
3. [Part 2: Notebook to FastAPI backend](/workshops/end-to-end-agent-deployment/tutorial/fastapi-backend) - split the notebook into `app.py`,
`agent.py`, `search.py`, `renderer.py`, `schemas.py`. Two endpoints (`/ask`,
`/ask/stream`) plus `/health`.
4. [Part 3: Vanilla-JS frontend with Vite](/workshops/end-to-end-agent-deployment/tutorial/vanilla-js-frontend) - scaffold a tiny `frontend/`
with Vite and plain JavaScript, proxied to the backend in dev.
5. [Part 4: Streaming with Server-Sent Events](/workshops/end-to-end-agent-deployment/tutorial/streaming-sse) - replace the wait-for-the-whole-answer UI
with one that streams tokens live and shows tool calls as collapsible blocks.
6. [Part 5: Dockerize as one container](/workshops/end-to-end-agent-deployment/tutorial/dockerize) - one-container, two-stage Dockerfile that builds
the frontend with Node and serves it from the FastAPI Python image. Includes the
`.env` quoting gotcha.
7. [Part 6: Deploy to Railway via CLI](/workshops/end-to-end-agent-deployment/tutorial/deploy-railway) - deploy the Docker image to Railway
using the Railway CLI.
8. [Part 7: GitHub Actions CI/CD](/workshops/end-to-end-agent-deployment/tutorial/cicd-github-actions) - a GitHub Actions workflow
that calls `railway up` on every push, plus a note on never pasting tokens into the
agent chat.
9. [Deferred items](/workshops/end-to-end-agent-deployment/tutorial/deferred-items) - what was intentionally skipped and
earmarked for a follow-up: vector DB, multi-turn chat, structured output, tests,
dev/prod separation.
10. [Q&A: side discussions](/workshops/end-to-end-agent-deployment/tutorial/qa) - 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](/workshops/end-to-end-agent-deployment/tutorial/appendix).
Apr 21, 2026