An intelligent learning assistant that helps students study by uploading PDF materials, asking questions, and tracking their learning progress using AI-powered analysis.
- 📚 PDF Upload & Processing: Upload study materials and automatically extract text chunks
- 🤖 AI-Powered Q&A: Ask questions about your uploaded materials with difficulty-based responses
- 📊 Progress Tracking: Monitor your learning progress across different topics
- 🧠 Forgetting Curve: Get intelligent revision suggestions based on spaced repetition
- 📈 Mastery Assessment: Track your mastery levels for different subjects
- 🎯 Misconception Detection: Identify and correct misunderstandings in your explanations
- Data Structures & Algorithms (DSA)
- Operating Systems (OS)
- Database Management Systems (DBMS)
- Computer Networks (CN)
- Object-Oriented Programming (OOP)
- FastAPI: Modern, fast web framework for building APIs
- Google Gemini AI: Advanced language model for intelligent responses
- Sentence Transformers: Semantic similarity for relevant content retrieval
- PDFPlumber: PDF text extraction
- Scikit-learn: Machine learning for mastery prediction
- HTML5/CSS3/JavaScript: Modern web technologies
- Tailwind CSS: Utility-first CSS framework
- Font Awesome: Beautiful icons
- Python 3.8+
- Google Gemini API Key
-
Clone the repository
git clone <repository-url> cd SDP/Backend
-
Create virtual environment
python -m venv venv # Windows venv\Scripts\activate # Unix/MacOS source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
# Create a .env file in the Backend directory echo "GEMINI_API_KEY=your_actual_api_key_here" > .env
Or get a free API key from Google AI Studio
-
Create necessary directories
mkdir -p data/uploads data/extracted_text
-
Run the backend server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
-
Navigate to frontend directory
cd ../Frontend -
Serve the frontend
# Using Python's built-in server python -m http.server 3000 # Or using Node.js if you have it installed npx serve . -p 3000
-
Start both servers:
- Backend:
http://localhost:8000 - Frontend:
http://localhost:3000
- Backend:
-
Upload Study Materials:
- Navigate to the Upload section
- Select a PDF file containing your study materials
- Upload and wait for processing
-
Ask Questions:
- Go to the Chat section
- Select the subject and difficulty level
- Type your question and get AI-powered answers
-
Track Progress:
- Visit the Progress section to see your learning statistics
- Get revision suggestions based on the forgetting curve
POST /upload- Upload and process PDF files
POST /ask- Ask questions about uploaded materialsPOST /explain- Get feedback on your explanations
GET /progress- Get learning progress and forgetting curve statusGET /session-report- Generate session summary
SDP/
├── Backend/
│ ├── api/
│ │ └── routes.py # API endpoints
│ ├── services/
│ │ ├── llm_service.py # AI interactions
│ │ ├── pdf_service.py # PDF processing
│ │ ├── progress_service.py # Progress tracking
│ │ ├── memory_service.py # Session history
│ │ ├── semantic_service.py # Text similarity
│ │ ├── web_service.py # Web fallback
│ │ └── ml/
│ │ ├── mastery_model.py # Mastery prediction
│ │ └── forgetting_model.py # Forgetting curve
│ ├── utils/
│ │ └── text_utils.py # Text processing utilities
│ ├── data/ # Storage directory
│ ├── config.py # Configuration
│ ├── main.py # FastAPI application
│ └── requirements.txt # Dependencies
└── Frontend/
├── index.html # Main web interface
└── script.js # Frontend logic
The application can be configured through environment variables and the config.py file:
GEMINI_API_KEY: Your Google Gemini API key (required)CHUNK_SIZE: Text chunk size for processing (default: 500)MAX_CHUNKS_PER_QUERY: Maximum chunks to consider per query (default: 3)
- API Key Error: Make sure your Gemini API key is valid and set in the
.envfile - PDF Processing Error: Ensure the PDF is text-based (not scanned images)
- CORS Issues: The backend is configured to allow all origins for development
- Memory Issues: For large PDFs, consider reducing the chunk size
- Check the browser console for frontend errors
- Check the backend terminal for API errors
- Ensure all dependencies are properly installed
- Verify your API key has sufficient quota
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
- Multi-language support
- More subject areas
- Advanced analytics dashboard
- Collaborative study features
- Mobile app
- Integration with learning management systems