Datalumina

Getting started

Document Copilot

Build a production RAG document Q&A assistant for an equity research firm with FastAPI, React, Supabase, and Pydantic AI, from ingestion to deployment.

Document Copilot is an internal AI research assistant for a fictional client, Driftwood Capital, an equity research firm where analysts spend half their week reading SEC filings. The app lets any analyst ask plain-English questions about a corpus of 10-K filings and get sourced, citable answers they can verify in one click.

This handbook is the written companion to the video. The video walks through the entire build in real time. The handbook contains everything from the video plus the code, commands, and deeper explanations, so you can keep it open next to the video and copy from here instead of pausing.

Build a Full-Stack GenAI Project in 4 Hours (FastAPI, React, Supabase)
Watch on YouTube · 4 hoursBuild a Full-Stack GenAI Project in 4 Hours (FastAPI, React, Supabase)

What you'll build

By the end you have a complete, production-shaped GenAI application:

  • A FastAPI backend with a typed Pydantic AI agent that searches filings through tools instead of naive context stuffing
  • Hybrid retrieval over Supabase Postgres that fuses pgvector semantic search and full-text search with reciprocal rank fusion
  • A fail-closed grounding validator that rejects any answer it cannot verify against retrieved passages
  • A React chat interface with streaming responses, live pipeline status, citation chips, and a source passage panel
  • A local ingestion pipeline that converts SEC filings to Markdown, chunks them table-aware, and embeds them
  • A real deployment on Railway with Docker

Not a beginner course

This build moves at a natural working pace and uses AI coding agents throughout. You should be comfortable with Python, some TypeScript, and the command line. If you are new to Python, start with the free Python course first.

The repository

GitHubdaveebbelaar/document-copilot

79109

The repo has two branches:

  • main is the near-empty starting point, with the client brief, architecture doc, data download script, and agent instructions. Clone this to follow along.
  • development is the finished result, in case you want to compare or explore.

If you go straight to the final result you end up with a cool project, but you will not really learn anything. The value is in building it up stage by stage.

How to follow along

Each stage in the sidebar matches a phase of the build and links to the exact timestamp in the video. Every page starts with the outcome, explains why the stage exists, walks through the important code, and ends with a checkpoint you can verify before moving on.

You do not need to understand every line immediately. The goal is to see how the frontend, backend, database, AI pipeline, and deployment fit together as one system. Keep asking how things work until you understand them from first principles.

Start here

On this page