I Built a Local AI Study Assistant Using Ollama, ChromaDB, FastAPI and React
I built ExamAI, a local AI study assistant that lets students upload their study PDFs and ask questions about them.
The main goal was simple:
Upload your notes โ ask a question โ get an answer based on your documents.
I wanted to build something that could actually be useful for studying while also learning how AI applications work behind the scenes.
๐What ExamAI Does
ExamAI allows you to:
- Upload PDF study material
- Extract text from the documents
- Split the content into searchable chunks
- Generate embeddings
- Store the chunks in ChromaDB
- Search for relevant information when a question is asked
- Send the relevant context to a local LLM
- Get an answer through a React interface
- Continue a conversation with follow-up questions
The important part is that the AI runs locally using Ollama, rather than requiring a paid cloud AI API.
๐ง Tech Stack
Frontend
- React
- Vite
- Axios
- CSS
Backend
- Python
- FastAPI
- Uvicorn
AI / RAG
- Ollama
- ChromaDB
- Sentence Transformers
- PyMuPDF
The application follows a basic RAG (Retrieval-Augmented Generation) architecture.
๐ How It Works
The flow is roughly:
PDF
โ
Text Extraction
โ
Chunking
โ
Embeddings
โ
ChromaDB
โ
User Question
โ
Similarity Search
โ
Relevant Context
โ
Ollama
โ
AI Answer
Instead of sending the entire PDF to the model every time, ExamAI retrieves the most relevant parts of the document and uses those as context.
๐ป Running It Locally
The project includes Windows setup and startup scripts to make running it easier.
After setting up the required dependencies, the application can start the FastAPI backend and React frontend together.
The project is available on GitHub:
https://github.com/apoorvaapoorva0160-droid/ExamAI
๐ ๏ธ What I Learned
Building this project taught me much more than just connecting an LLM to a frontend.
I learned about:
- RAG architecture
- Vector databases
- Embeddings
- PDF processing
- FastAPI APIs
- React frontend/backend communication
- Local LLMs with Ollama
- Conversation context
- Git and GitHub
- Windows automation with
.batscripts
I also ran into plenty of bugs along the way.
Some of the biggest lessons came from fixing those bugs rather than writing the initial code.
๐ Why Local AI?
One of the things I like about this project is that the AI processing can happen locally.
That means students can experiment with the application without needing an API key for a cloud LLM.
It also made the project a good way for me to understand what actually happens inside a local AI application.
๐ What's Next?
ExamAI is still a work in progress.
Some things I want to improve include:
- Better document management
- Improved retrieval quality
- More accurate answers
- Better multi-document support
- Cleaner UI
- Better error handling
- More robust conversation/session management
- Easier installation
I'd also like to eventually make the project easier for other students to install and use.
๐ Feedback Welcome
This is one of my first serious AI projects, and I'm sharing it because I'd genuinely like feedback from other developers.
If you have suggestions about the RAG architecture, code structure, retrieval approach, UI, or anything else, I'd love to hear them.
GitHub:
https://github.com/apoorvaapoorva0160-droid/ExamAI
Thanks for reading!
Top comments (2)
Really nice work, especially for a first serious AI project. The end-to-end architecture is clear, and I like that you kept the whole RAG pipeline local rather than treating the LLM as a black box.
One security aspect Iโd be particularly interested in exploring as the project grows is the document trust boundary. Once users can upload arbitrary PDFs, the retrieved content becomes model input, so prompt injection inside documents, malicious content, and cross-document context leakage become interesting attack surfaces.
Iโd also consider testing retrieval isolation explicitly if multi-document or multi-user support is added: a document should never be able to influence retrieval or context outside the scope intended for that session/user.
Great foundation, and the roadmap makes sense. Looking forward to seeing how ExamAI evolves. ๐
Thanks Marco! Really appreciate the detailed feedback.
The document trust boundary is something Iโve been thinking about as I move ExamAI beyond the initial version. Youโre right that once arbitrary PDFs become retrieval context, the documents themselves have to be treated as untrusted input.
The retrieval isolation point is especially important for the next stage. Iโm working toward making document/session boundaries explicit so that chunks from one document canโt accidentally influence retrieval or conversation context for another.
Prompt injection inside documents is also something I want to test more deliberately rather than assuming the RAG pipeline is safe just because everything runs locally.
Thanks again for pointing these out โ this gives me some very concrete security areas to work on for the next version.