A full-stack application to help students study by understanding lecture slides, handwritten notes, and textbook pages.
- Upload and process PDF documents and images (JPG, PNG)
- Extract text using OCR for images and PDF text extraction
- Use RAG (Retrieval-Augmented Generation) to answer study questions
- Generate flashcards based on document content
- Create summaries of study materials
- Simple, clean user interface
- FastAPI (Python)
- Gemini API (Google Generative AI) for LLM generation
- Tesseract OCR for image text extraction
- PyMuPDF for PDF text extraction
- ChromaDB for vector storage
- SentenceTransformers for embeddings
- HTML/CSS/JavaScript
- Bootstrap for UI components
- Python 3.9+
- Tesseract OCR installed on your system
- Gemini API key (Google Generative AI)
- Clone the repository:
git clone <repository-url>
cd multimodal-study-assistant- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate- Install the Python dependencies:
pip install -r requirements.txt- Create a
.envfile in the project root with your configuration:
GEMINI_API_KEY=your_gemini_api_key_here- Start the backend server:
python run.py- Start the frontend server:
cd frontend
python serve.pyThe frontend will be available at http://localhost:8080
- Upload PDFs or images using the web interface
- Ask questions, generate flashcards, or create summaries from your documents
- Remove all files in
uploads/for a fresh start (except for an empty.gitkeepif you want to keep the folder structure) - Remove
chroma_db/chroma.sqlite3to reset the vector database - Do not commit
venv/to version control; add it to your.gitignore
multimodal-study-assistant/
├── app/ # Backend application
│ ├── api/ # API endpoints
│ ├── core/ # Core processing logic
│ ├── db/ # Database and storage interfaces
│ ├── models/ # Data models
│ ├── utils/ # Utility functions
│ └── main.py # FastAPI application
├── frontend/ # Frontend application
│ ├── src/ # Source JS/CSS
│ └── index.html # Main HTML page
├── uploads/ # Uploaded documents (clean regularly)
├── chroma_db/ # Vector DB (clean regularly)
├── requirements.txt # Python dependencies
├── run.py # Application runner
├── .env # Environment variables (not committed)
└── README.md # This file
- Make sure Tesseract OCR is installed and available in your PATH.
- If you do not provide a Gemini API key, LLM-based features (flashcards, summaries, advanced Q&A) will not work.
- For a clean repo, do not commit user uploads, database files, or your virtual environment.
This project is designed for a Master's-level software engineering class to demonstrate:
- RAG (Retrieval-Augmented Generation) architecture
- Autonomous agent behavior (flashcard generation, summarization)
- Multimodal input handling (text, images, PDFs)
- Clean, modular code structure
To enhance the quality of flashcards and summaries generated from your PDFs, you must configure the application to use Gemini (Google Generative AI):
- Create a
.envfile in the root directory if it doesn't exist - Add your Gemini API key to the file:
GEMINI_API_KEY=your_gemini_api_key_here - Restart the application
The application will automatically detect the API key and use Gemini for generating accurate and useful flashcards and summaries from your documents.
Note: If you don't provide an API key, the application will not be able to use LLM-based features (flashcards, summaries, advanced Q&A).
- If you encounter errors related to PDF processing, ensure you have the required system dependencies for PyMuPDF and pdf2image.
- For OCR functionality, make sure Tesseract OCR is installed on your system.
- When running without a Gemini API key, the application will not be able to use LLM-based features.