Back to Workshops
Workshop Basic+

End-to-End Agent Deployment

Alexey Grigorev Apr 21, 2026
Workshop Basic+

End-to-End Agent Deployment

April 21, 2026 Alexey Grigorev

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:

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. 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 - what you will build, prerequisites, and project setup with uv and .env.
  2. Part 1: The 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 - 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 - scaffold a tiny frontend/ with Vite and plain JavaScript, proxied to the backend in dev.
  5. 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.
  6. 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 .env quoting gotcha.
  7. Part 6: Deploy to Railway via CLI - deploy the Docker image to Railway using the Railway CLI.
  8. Part 7: GitHub Actions CI/CD - 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 - 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 - 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.

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