EduMind Agent is an AI-powered autonomous learning and assessment platform that revolutionizes educational content creation and adaptive learning. Built with LangGraph, FastAPI, and Google's Gemini AI, it provides two powerful modes: Teacher Mode for generating comprehensive worksheets and Student Mode for adaptive quizzing and interactive learning.
- Automated Worksheet Generation: Upload PDF study materials (NCERT chapters, reference materials) and automatically generate structured worksheets
- Multi-Format Questions: Creates both Multiple Choice Questions (MCQs) and subjective questions
- Intelligent Topic Segmentation: Automatically identifies and segments topics from uploaded content
- Customizable Output: Configure number of questions, difficulty levels, and question types
- PDF Export: Generates professional PDF worksheets with answer keys
- Smart Question Distribution: Mixed difficulty levels (Easy, Medium, Hard) for comprehensive assessment
- Adaptive Quiz System: AI-generated quizzes tailored to uploaded study materials
- Configurable Sessions: Customize number of questions, difficulty level, and time limits
- Real-time Feedback: Instant answer validation with explanations
- Performance Analytics: Track accuracy, weak areas, and learning progress
- AI Tutor Chat: Interactive Q&A with context-aware responses from uploaded PDFs
- Enhanced Learning Tools:
- Mathematical equation solver
- Function plotting and visualization
- Automatic follow-up question generation
- Math Solver: Symbolic equation solving using SymPy
- Plot Generator: Dynamic function visualization with matplotlib
- Table Formatter: Clean data presentation
- Diagram Generator: Flowchart creation for process visualization
- Vector Store: Qdrant-based document retrieval for contextual responses
- Framework: FastAPI (Python)
- AI/ML:
langgraph- Agentic workflow orchestrationlangchain&langchain-openai- LLM integrationgoogle-generativeai- Gemini 2.0 Flash modelsentence-transformers- Text embeddings (all-MiniLM-L6-v2)torch- Deep learning framework
- Vector Database: Qdrant Cloud for document storage and retrieval
- Document Processing:
pypdf- PDF text extractionpython-docx- Word document supportopenpyxl- Excel file handlingpandas- Data manipulation
- HTML5 with Jinja2 templating
- CSS3 with modern aesthetics
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend β
β (HTML/CSS/JS - Templates/Static Files) β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β HTTP/REST API
βββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββ
β FastAPI Server β
β (main.py) β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββ¬ββββββββββββββββ€
β Teacher Endpoints β Student Endpoints β Chat Endpoint β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββ΄ββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββ
β Teacher Agent β β Student Agent β β Chat System β
β (LangGraph) β β (LangGraph) β β (RAG-based) β
ββββββββββ¬ββββββββ βββββββββββ¬βββββββββββ ββββββββ¬ββββββββ
β β β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββ€
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Gemini 2.0 β β Qdrant Vector β
β Flash Model β β Store (Cloud) β
β (LLM) β β (Embeddings) β
βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Advanced Tools Layer β
β β’ Math Solver β’ Plot Generator β’ PDF Exporter β
β β’ Table Formatter β’ Diagram Generator β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PDF Upload β Extract Text β Segment Topics β Generate MCQs β
Generate Subjective Questions β Format Worksheet β Export PDF
PDF Upload β Extract & Embed β Generate Quiz Questions β
Present Questions β Validate Answers β Analyze Performance
Demos/
βββ backend/
β βββ __init__.py
β βββ config.py # Configuration & API keys
β βββ llm.py # Gemini LLM interface
β βββ state.py # LangGraph state definitions
β βββ teacher_agent.py # Teacher mode workflow
β βββ student_agent.py # Student mode workflow
β βββ tools.py # Advanced tools (math, plots, etc.)
β βββ vector_store.py # Qdrant vector database interface
β
βββ static/
β βββ css/
β β βββ style.css # Main application styles
β β βββ chat.css # Chat interface styles
β βββ js/
β β βββ main.js # Frontend JavaScript
β βββ generated/ # Generated worksheets & outputs
β
βββ templates/
β βββ index.html # Main application template
β
βββ temp/ # Uploaded PDF storage
β
βββ main.py # FastAPI application entry point
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (API keys)
βββ README.md # This file
- Python 3.8+
- pip (Python package manager)
- Git (for cloning)
-
Clone the repository
git clone <your-repository-url> cd Demos
-
Create a virtual environment (recommended)
# Windows python -m venv venv venv\Scripts\activate # macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
Create a
.envfile in the project root:GEMINI_API_KEY=your_gemini_api_key_here QDRANT_URL=your_qdrant_url QDRANT_API_KEY=your_qdrant_api_key
How to get API keys:
- Gemini API Key: Visit Google AI Studio
- Qdrant: Sign up at Qdrant Cloud for free tier
-
Run the application
python main.py
The server will start at
http://127.0.0.1:8000 -
Access the application
Open your browser and navigate to
http://127.0.0.1:8000
-
Upload Study Material
- Click on "Teacher Mode" in the sidebar
- Drag & drop a PDF file or click to browse
- Supported: NCERT chapters, textbooks, reference materials
-
Configure Worksheet Settings
- MCQ Count: Choose 10, 20, or 50 questions
- Difficulty: Select Mixed, Easy, or Hard
- Options:
- β Include Subjective Questions
- β Generate Answer Key
-
Generate Worksheet
- Click "Generate Worksheet"
- Wait for the AI to process (may take 1-2 minutes)
- Download the generated PDF worksheet and answer key
-
Output Files
- Worksheet PDF with all questions
- Answer key with explanations
- Markdown version in
static/generated/
-
Upload Study Material
- Click on "Student Mode" in the sidebar
- Upload your chapter PDF
-
Configure Quiz Settings
- Number of Questions: 5, 10, 15, or 20
- Difficulty Level: Easy, Medium, or Hard
- Time Limit: 5-30 minutes
-
Take the Quiz
- Click "Start Adaptive Quiz"
- Answer questions one by one
- Get instant feedback on each answer
- View explanations for correct answers
-
Review Performance
- See your accuracy score
- Identify weak areas
- Review missed questions
-
Use AI Tutor Chat
- After uploading a PDF, the chat interface becomes available
- Ask questions about the content
- Get contextual answers with follow-up suggestions
- Request math solutions, plots, or explanations
Example Queries:
- "Explain the concept of photosynthesis"
- "Solve the equation: x^2 - 5x + 6 = 0"
- "Plot the function: sin(x) + cos(x)"
- "Compare mitochondria and chloroplasts in a table"
- "Show me the steps for cellular respiration"
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Main application interface |
/api/upload |
POST | Upload PDF file |
/api/generate-worksheet |
POST | Generate worksheet (Teacher Mode) |
/api/student/start |
POST | Start quiz session (Student Mode) |
/api/student/submit-answer |
POST | Submit answer and get validation |
/api/student/finish-quiz |
POST | Complete quiz and get results |
/api/chat |
POST | Chat with AI tutor |
Upload File:
curl -X POST "http://127.0.0.1:8000/api/upload" \
-F "file=@chapter.pdf"Generate Worksheet:
curl -X POST "http://127.0.0.1:8000/api/generate-worksheet" \
-H "Content-Type: application/json" \
-d '{
"filename": "chapter.pdf",
"mcq_count": 10
}'Chat Query:
curl -X POST "http://127.0.0.1:8000/api/chat" \
-H "Content-Type: application/json" \
-d '{
"query": "Explain Newton's laws",
"filename": "physics.pdf"
}'The system can solve equations and evaluate expressions:
# Automatically triggered when queries contain math keywords
Query: "Solve x^2 - 4 = 0"
Response: Solutions: [2, -2]Visualize mathematical functions:
Query: "Plot x^2 + 2*x + 1"
# Generates a graph with proper axes and gridAfter each answer, the AI generates 3 follow-up questions to deepen understanding:
Answer: [Your Answer]
Follow-up Questions:
1. How does this concept relate to...?
2. Can you explain the practical application of...?
3. What would happen if...?
| Variable | Description | Required |
|---|---|---|
GEMINI_API_KEY |
Google Gemini API key | β Yes |
QDRANT_URL |
Qdrant cloud instance URL | β Yes |
QDRANT_API_KEY |
Qdrant authentication key | β Yes |
- Never commit
.envfile to version control - Use environment-specific configurations for development/production
- Rotate API keys regularly
- Implement rate limiting for production deployments
- Sanitize file uploads to prevent malicious files
Edit backend/config.py:
GEMINI_MODEL_NAME = "gemini-2.0-flash" # Change to desired modelModify prompts in:
backend/teacher_agent.py- Worksheet generationbackend/student_agent.py- Quiz generation
Edit static/css/style.css to change:
- Color scheme
- Typography
- Layout and spacing
- Animations
Issue: "Error reading PDF content"
- Solution: Ensure the PDF is not password-protected and contains extractable text
Issue: "Connection to Qdrant failed"
- Solution: Verify
QDRANT_URLandQDRANT_API_KEYin.envfile
Issue: "Gemini API rate limit exceeded"
- Solution: Wait a few minutes or upgrade your API quota
Issue: "Torch/CUDA errors"
- Solution: CPU-only mode is sufficient. Install with:
pip install torch --index-url https://download.pytorch.org/whl/cpu
Issue: "Module not found"
- Solution: Reinstall dependencies:
pip install -r requirements.txt
- PDFs are chunked into smaller segments for better processing
- Vector embeddings are cached in Qdrant
- Consider splitting very large documents (>100 pages)
- Use a local Qdrant instance instead of cloud
- Enable GPU acceleration for torch if available
- Increase API rate limits
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 style guide for Python code
- Add docstrings to all functions
- Test thoroughly before submitting
- Update documentation for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for powerful language model capabilities
- LangChain & LangGraph for agentic workflow framework
- Qdrant for vector database infrastructure
- FastAPI for modern web framework
- Open source community for various tools and libraries