PrepPal is an intelligent chatbot designed to help students prepare for Computer Science interviews. It uses semantic search and Retrieval Augmented Generation (RAG) techniques to retrieve relevant theory answers from a curated database of CS subjects.
- 📚 Answers questions from core CS subjects using document embeddings.
- 🔍 Semantic search to find conceptually similar matches instead of keyword matching.
- ⚡ Reduces latency by ~30% by querying only the most relevant document chunks.
- ✅ Avoids hallucinations with fallback logic when no relevant context is retrieved.
- 🧠 Uses local LLMs via Ollama for secure and offline inference.
- 🖥️ Simple terminal-based interface for distraction-free interaction.
- 🔄 Easily extensible to new subjects - just add new notes and regenerate embeddings.
- 💬 Automatically formats JSON-based context to produce natural English answers.
git clone https://github.com/Anjali-Mittal/PrepPal.git
cd PrepPalIt's recommended to use a virtual environment:
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txtDownload and install Ollama (if not already installed) from https://ollama.com Make sure it's running in the background.
For example, to use phi3 locally:
ollama pull phi3You can change this in the code by setting a different model name in PrepPal.py.
On Windows, just double-click:
start_PrepPal.bat
Or manually run:
python PrepPal.pyPrepPal/
├── embeddings/ # Stores generated embeddings (auto-created)
├── prepare_db.py # Add embeddings to DB
├── PrepPal.py # Main entry point
├── utils.py # Config for model, DB, and context source
├── start_PrepPal.bat # Windows launcher
├── requirements.txt
└── README.md
- No internet required after setup - everything runs locally.
- You can add more
.txtfiles to 'prepare_db.py'and rerun embedding generation to update the knowledge base. - Currently supports only English text.
- Designed for factual Q&A, not opinion-based or coding problems.