Inspiration

It was 11 PM the night before my Endsem examination. I had 47 lecture slides, a 200-page PDF textbook, and three hours of recorded video I hadn’t touched. I opened the slides, read the same paragraph four times, understood nothing, and closed my laptop. That moment broke me a little. Not because the content was hard, because there was no intelligent way to interact with it. I couldn’t ask my slides a question. I couldn’t get quizzed on what actually mattered. I was just a student staring at static files, hoping something would stick.

We built AdaptFlow so that never happens to anyone again.

What it does

AdaptFlow turns your dead study materials into an active learning session.

📄 Upload anything — drop in a PDF textbook, a lecture slide deck, or a video with subtitles and AdaptFlow parses, chunks, and indexes it automatically. 💬 Source Chat — ask any question about your material and get an AI answer cited to the exact slide number or page — not a vague summary, the actual source. 🧠 Adaptive Quiz — generates unique questions at Easy, Medium, or Hard difficulty and adjusts mid-quiz based on your answers — get one wrong and it eases up, ace it and it pushes harder. 📊 Performance Breakdown — after every quiz, see exactly which topic and which source slide you’re weak on.

The core idea: your study materials should study back.

How we built it

The frontend is Next.js- chosen specifically because API routes let us proxy all LLM calls server-side, keeping the Groq API key completely out of the browser. The UI is Tailwind CSS, deployed on Vercel.

The backend is FastAPI on Railway, with PostgreSQL for structured data and Redis for caching and session state. We chose Groq with Llama 3 over OpenAI purely for speed — streaming responses arrive in under a second, which makes the chat feel alive instead of frozen.

The technical heart is the RAG pipeline: uploaded files are split into chunks, each chunk is embedded and stored as a knowledge unit with its source metadata (slide number, page, timestamp). When a user asks a question, we retrieve the top-k relevant chunks via vector similarity, inject them into the LLM prompt with strict instructions to cite the source, and stream the grounded answer back. Source Chat doesn’t guess — it reads your material and tells you exactly where the answer came from.

For the quiz, questions are generated from retrieved chunks at the requested difficulty level, shuffled with Fisher-Yates, and tracked by ID in a Set — so the same question never appears twice. Mermaid.js renders inline diagrams in Source Chat responses whenever the concept involves a process or structure.

Challenges we ran into

Every single one of these was real and painful:

Railway $PORT binding — FastAPI was hardcoded to port 8000. Railway injects $PORT dynamically, so every deployment silently failed with a 502. Fixed by reading os.environ.get("PORT", 8000) and binding to 0.0.0.0 Quiz repeating questions — the question selector was pulling index [0] every iteration instead of iterating the array. Rewrote with Fisher-Yates shuffle and a Set of shown IDs RAG citing wrong sources — early versions cited topic names instead of slide numbers. Fixed by embedding source metadata directly into each chunk and making it a hard requirement in the LLM system prompt CORS between Vercel and Railway — frontend requests were blocked until we configured CORSMiddleware with the exact Vercel production domain Mermaid in streaming responses — diagrams were rendering mid-stream on incomplete syntax. Fixed by buffering the full ```mermaid block before handing it to the renderer

Accomplishments that we're proud of

Source Chat cites the exact slide number on every single response — not approximate, exact A 10-question quiz session has zero repeated questions, guaranteed by the ID Set guard Sub-second LLM responses via Groq streaming — it feels fast enough to actually use The full stack — Next.js, FastAPI, Postgres, Redis, RAG pipeline — deployed and publicly live at adaptflow-ai.vercel.app

The moment my friend scored 10/10 on a Glycolysis quiz generated entirely from a slide deck she uploaded 3 minutes earlier — that’s when I knew this was real.

What we learned

Technically: RAG in production is nothing like RAG in a tutorial. Source attribution, chunk quality, and retrieval precision are entirely separate problems that all need solving at once. Also — Next.js API routes as secure LLM proxies are underrated, and Railway’s dynamic PORT behavior will silently break your deployment if you don’t read the docs.

Humanly: I learned that shipping something broken and fixing it is infinitely better than waiting until it’s perfect. I debugged the quiz repeat bug at 1AM with cold coffee and no Stack Overflow answer that matched. I fixed it anyway.

What surprised me most: how much the citations changed the experience. Without them, it’s just another chatbot. With them, it feels like a tutor who actually read your notes.

What's next for AdaptFlow

🎙️ Voice tutoring — ask questions out loud, get spoken answers 🔁 Spaced repetition engine — resurface your weakest topics automatically based on quiz history 👥 Collaborative study rooms — upload shared materials and quiz each other in real time 🏫 Institutional version — let professors upload entire course content for their students 📱 Mobile app with offline quiz mode for studying without WiFi

In two years, I want AdaptFlow to be the reason a student says “I actually understood that” instead of “I just memorized it.” Most study tools make you read more. AdaptFlow makes you know more.

Built With

Share this project:

Updates

Submission history