DEV Community

Cover image for I Built a Local AI Study Assistant Using Ollama, ChromaDB, FastAPI and React
Apoorva Chittapur
Apoorva Chittapur

Posted on

I Built a Local AI Study Assistant Using Ollama, ChromaDB, FastAPI and React

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
Enter fullscreen mode Exit fullscreen mode

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 .bat scripts

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 (1)

Collapse
 
mk023 profile image
Marco

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. ๐Ÿš€