I built StudyMind AI, a FastAPI RAG app for studying from PDFs, with a single-page frontend deployed on Vercel. It offers chat, quiz, summary, and explain-like-I'm-five modes.
- I parse PDFs with PyMuPDF and split the extracted text using a recursive splitter with 500-character chunks and 50-character overlap.
The current public README describes retrieval evaluation and offline tests. This is a newer project description than the earlier note that I had not added retrieval evaluation; the page-aware RAG implementation and other details are documented here.
My current README describes pdf-summarizer-Ai as StudyMind AI, a PDF study assistant built with retrieval-augmented generation. I can upload a PDF and use four modes: Chat (Q&A), Quiz (5 MCQs), Summary, and ELI5. Answers cite pages as [p.N] and list their source pages. This README documents a persistent ChromaDB index, hybrid retrieval, evaluation, and offline tests; it supersedes earlier notes on this page that described in-memory indexing and no retrieval evaluation.
My retrieval flow is PDF → page-aware chunks → all-MiniLM-L6-v2 embeddings stored persistently in ChromaDB → vector and BM25 keyword retrieval fused with Reciprocal Rank Fusion → Llama 3.3 70B through Groq. I use hybrid retrieval so semantic matching does not miss exact terms, and page labels let answers cite their sources. The model is restricted to the retrieved context. Documents survive restarts, and re-uploading the same PDF is instant.
- My stack includes FastAPI, PyMuPDF, LangChain text splitters, ChromaDB, sentence-transformers, Groq, pytest, GitHub Actions, and a vanilla HTML/JavaScript frontend.
My README reports 12 offline tests that need neither an API key nor a model download; they run in CI in approximately 1 s. Retrieval evaluation uses real embeddings, downloads MiniLM once, and reports recall@k and MRR by retrieval method and chunk size. The README gives no numerical evaluation scores and redacts the chunk-size argument.
git clone https://github.com/yaadhuu/pdf-summarizer-Ai.git
cd pdf-summarizer-Ai
pip install -r requirements-dev.txt
echo "GROQ_API_KEY=your_key_here" > .env
uvicorn backend.main:app --reload
# Run the offline tests
pytest -v
# Evaluate retrieval with real embeddings; the README redacts the chunk sizes
python -m eval.run_eval --chunk-sizes <redacted>
I keep GROQ_API_KEY out of git and set it in the hosting provider’s dashboard. The app needs about 2 GB of RAM for MiniLM and PyTorch, so a 512 MB instance and Vercel’s serverless limit do not fit. My render.yaml describes a Render web service on a 2 GB plan with a disk for the persistent index; the captured README does not establish the actual deployed hostname. I can also run the container with a persistent Docker volume mounted at /data.
backend/main.pyvalidates requests and serves the API and frontend;backend/pipeline.pycontainsindex_pdf()andask().pdf_parser.pypreserves page numbers,chunker.pycreates overlapping page-aware chunks,embedder.pystores MiniLM embeddings persistently, andbm25.pyandretriever.pyimplement keyword, vector, and hybrid search.backend/chat.pyprovides one prompt per mode and calls Groq;backend/config.pyholds tunable settings.tests/contains offline tests,eval/contains retrieval evaluation questions with known answer pages, anddocs/ARCHITECTURE.mdhas the full design walkthrough.learning/contains early FastAPI practice and is not part of StudyMind. The repository also includes a tiny manual-test PDF, a Dockerfile, and a Render blueprint.
I plan to rework StudyMind AI first, followed by TrueFlood, to make both projects cleaner and easier to explain. I have not specified the architecture changes or how I will add retrieval evaluation.
- I embed chunks with all-MiniLM-L6-v2 and store them in an in-memory ChromaDB.
- Retrieval returns the top 3 chunks, and Groq's Llama-3.3-70B generates answers.