Advertisements

RAG with FastAPI, Scrapy, pgvector, Docker & OpenAI

Advertisements
FastAPI, Scrapy, and Postgres with pgvector. No LangChain. Code on the real lines. Docker on Mac, Windows, and Linux.
1
1/5
(17) Ratings
23 students
Created by Mohammad Mahdi Mohajer
Advertisements

What you'll learn

  • Run a complete RAG stack with Docker Compose: a FastAPI API, Postgres with pgvector, and a Scrapy crawler, on Mac, Windows, or Linux.
  • Explain the eight stages of retrieval-augmented generation, including chunking, embeddings, vector storage, cosine similarity, and top-k.
  • Read a FastAPI, SQLAlchemy, Alembic, and pgvector backend file by file, from the Dockerfile and migrations to the /rag routes.
  • Crawl pages you choose with Scrapy, respect robots.txt, store them as embedded chunks in Postgres, and get answers drawn from those chunks.
  • Grade an answer with a four-check scorecard and name the pipeline stage that failed when a check does not pass.
  • Plan the production layer still missing: a chat UI, Redis memory, better chunking, evaluation, and nginx. Mapped in the course, not built.
This course includes:
5 total hours on-demand video
0 articles
0 downloadable resources
48 lessons
Full lifetime access
Access on mobile and TV
Certificate of completion
Advertisements

Course content

Requirements

  • You know what a database is and what an API is. The course does not teach those terms from zero.
  • Basic comfort with a terminal. Some Python helps, and the code is explained line by line. No programming experience at all is the wrong start.
  • A Mac, Windows, or Linux computer that can run Docker. Chapter 3 walks you through installing Git, Docker, and Compose.
  • An OpenAI account with billing enabled. From chapter 5, each stored chunk and each question is a paid API call, so set a spend limit.

Description

This course contains the use of artificial intelligence.

The chatbot quoted a price the live page never had

A visitor books mentorship on a number the chat window invented. The invoice is different. You open the pricing page. That number was never there. Someone wired a general model to a box and shipped it. The model is fluent. It is not informed.

That gap is why this course exists. A general chat model can answer a lot of public questions. It does not know the pages on your site. You need an assistant that answers from pages you chose, that you can open and inspect, and that you can grade before a real customer uses it.

By the end you can say this: I crawled pages I chose, stored them, and got an answer drawn from those pages, and I can name what is still missing before a real customer uses it.

What you leave with

You leave with a running system and written proof, not a notebook of definitions. You can show a teammate the stack you started, the pages you listed, and the scorecard you filled.

  • Compose stack. The API, Postgres with pgvector, and an idle scraper, started by you on Mac, Windows, or Linux.

  • Two tables. Pages and chunks, including a 3,072-dimension embedding column, walked on the real files of the clone.

  • Your crawl. Paths you listed on a site you chose, skipped where robots.txt disallows them.

  • One ask. Pages and chunks you can list, and one question that answers from those chunks.

  • Sample answers. Saved replies from the sample site as a second proof. Your crawl does not write them, and they are not a second knowledge base.

  • Scorecard. One question from the first section: was the page stored, is the expected fact in a chunk, did the answer stay inside your stored pages, and which stage failed if a check did not pass.

  • Next-layer map. A chat UI, Redis memory, better chunks, a two-check eval, a richer answer with citations, and nginx. Mapped so you know what to build next. Not built in this repo.

How the course is taught

Six sections. Forty-eight short lectures, about five hours. One system, and one companion repo named rag_tutorial. It ships finished. You clone it in section 3 and run it. You do not type the backend from an empty folder.

  • Sections 1 and 2. Fit, then the eight RAG stages as one picture. Nothing is installed, and nothing is built.

  • Section 3. Git, Docker, and Compose on Mac, Windows, or Linux, and then the stack is up.

  • Section 4. The API folder in the order it grew: FastAPI, SQLAlchemy, Alembic, and pgvector, on the real lines.

  • Section 5. Scrapy on the pages you list, honouring robots.txt. Crawl, store, ask.

  • Section 6. Grade your evidence, then map what a real visitor still needs. A map, not a second lab.

There is no LangChain lab. The chat model in the repo is gpt-6-astra. The embedding model is text-embedding-3-large.

Who it fits

Take it if you already know what a database is and what an API is, and you want to read a small RAG system line by line instead of calling a framework you cannot explain. The usual job is a support, company-site, or docs assistant that must answer from pages you chose.

Skip it if you want ChatGPT productivity tips, a LangChain or LlamaIndex tour, a no-code chat-with-PDFs path, or a course that assumes no programming. Someone who has never used a terminal will struggle.

You need a computer that can run Docker. Section 3 installs Git, Docker, and Compose. You also need an OpenAI account with billing on and a spend limit, because from section 5 each stored chunk and each question is a paid call.

Why this course

A lot of RAG courses go wide, through a framework or a hosted store. This one stays on one readable path: FastAPI, Scrapy, Postgres, and pgvector, run with Docker Compose on your machine, on pages you choose. No orchestration framework sits between you and the code.

You will see chunking, embeddings, and metadata in Postgres, and section 6 maps reranking, hybrid retrieval, and a formal eval. Those later layers are named so you know they exist. They are not the lab. The course does not make you job-ready on its own. Take it when you want every file in a small RAG system to make sense before you add a framework.

Who this course is for:

  • Developers who know databases and APIs and want to understand RAG line by line instead of relying on a framework call they cannot explain.
  • Developers building a support, company-site, or docs assistant that must answer from pages they chose, with stored sources they can inspect.
  • Aspiring AI engineers who want to run and understand an assistant end to end, from crawl to answer, not only call a chat model.
Advertisements
15FBA42FD63CD9B62E21
Advertisements
Advertisements
Free Online Courses with Certificates
Logo
Register New Account