AI study assistant

Study Helper Pro

A RAG document Q&A platform. Upload PDFs, search them by meaning with ChromaDB embeddings, and get answers from Google Gemini based on your own documents. PDFs are processed in the background with Celery and Redis.

Stack
  • FastAPI
  • Next.js
  • ChromaDB
  • Celery
  • Redis
  • Supabase
  • Google Gemini

Fig. 1 · Retrieval-augmented answers

Conceptual

Select a component, or trace a scenario.

Each box is a part of the system; arrows show how a request or event moves between them.

Conceptual. A conceptual map of the retrieval-augmented pipeline, not a live connection to the application.
Component reference and scenarios as text
PDF upload
A user uploads a PDF from the Next.js front end.
API
FastAPI endpoints, authenticated with Supabase JWTs.
Worker
Celery workers, fed through Redis, process documents in the background.
Extract & chunk
The document’s text is extracted and split into passages.
Embeddings
Each passage becomes a vector, so it can be found by meaning rather than exact words.
ChromaDB
Vectors are stored in ChromaDB, in a collection that belongs to one user only.
Question
The user asks something about their documents.
Semantic search
The question is matched against the user’s own passages by meaning.
Context
The best-matching passages are assembled into the context for the model.
Google Gemini
Gemini is asked to answer using the retrieved context.
Answer
A context-aware answer returns to the user.

Ingest a PDF

  1. A PDF is uploaded; the API checks the user’s Supabase JWT.
  2. Processing is handed to a Celery worker through Redis, so it runs in the background.
  3. The worker extracts the text and splits it into passages.
  4. Each passage is embedded as a vector.
  5. Vectors are stored in this user’s own ChromaDB collection.

Ask a question

  1. A question arrives and is turned into a search.
  2. Semantic search looks only in the asking user’s collection.
  3. The most relevant passages become the context.
  4. Gemini is asked to answer from that context.
  5. A context-aware answer comes back.

What I built

  • PDF upload with background processing on Celery workers backed by Redis.
  • Semantic search over ChromaDB embeddings.
  • Answers from Google Gemini that use the passages retrieved from your documents.
  • Supabase authentication with JWT.
  • A separate document collection for each user, so one person’s files never show up in another person’s answers.

How retrieval-augmented generation works here

If you ask a language model a question directly, it answers from memory and sounds confident either way. Retrieval-augmented generation first finds the passages in your own documents that best match the question, then asks the model to answer using those passages. The figure above walks through each step. It’s a diagram, not a live connection to the app.

Site index