A production-grade, role-based educational platform that uses RAG (Retrieval-Augmented Generation) and LLMs to help students learn from their own study materials β with AI tutoring, adaptive quizzes, exam simulations, flashcards, and progress tracking.
| Feature | Description |
|---|---|
| AI Chat Tutor | Ask questions from your uploaded PDFs β answers grounded in your study material |
| Quiz Mode | AI-generated MCQs with adaptive difficulty based on your performance |
| Exam Simulation | Timed mock exams with countdown timer and instant scoring |
| Flashcards | Auto-generated flashcards from your notes for quick revision |
| Progress Tracker | Track quizzes, scores, topic mastery, and export PDF reports |
| Dashboard | Personalized overview with metrics, score trends, and quick actions |
| Feature | Description |
|---|---|
| Student Analytics | View all quiz attempts, filter by subject, monitor performance |
| Platform Metrics | Active students count, quiz completion rates |
| Feature | Description |
|---|---|
| User Management | View, search, promote/demote roles, delete accounts |
| Analytics Dashboard | Platform-wide usage metrics and performance data |
| Question Paper Upload | Ingest past papers into the RAG knowledge base |
| Paper Analysis | AI-powered topic extraction with frequency, subtopics, and question types |
- Students β Can only access learning tools (Chat, Quiz, Exam, Flashcards, Progress)
- Faculty β Access to student analytics and performance monitoring
- Admin β Full access including user management and paper uploads
- Unauthorized pages auto-redirect to login β no data leakage
| Layer | Technology |
|---|---|
| Frontend | Streamlit with custom glassmorphic CSS, SVG icon system |
| LLM | Groq API β LLaMA 3.3 70B Versatile |
| RAG Pipeline | LangChain + FAISS vector store + Sentence Transformers |
| Embeddings | all-MiniLM-L6-v2 (384-dim) |
| Database | SQLite (users, quiz attempts, documents, progress) |
| Auth | bcrypt password hashing + session-based authentication |
| PDF Processing | pdfplumber + PyPDF2 |
| Reports | ReportLab PDF generation |
- Python 3.10 or higher
- A free Groq API Key
git clone https://github.com/YOUR_USERNAME/edusathi.git
cd edusathipython -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activatepip install -r requirements.txt# Copy the example env file
cp .env.example .envEdit .env and add your Groq API key:
GROQ_API_KEY=gsk_your_actual_key_here
DB_PATH=./data/users.db
VECTOR_STORE_DIR=./data/vector_stores
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
LLM_MODEL=llama-3.3-70b-versatile
SECRET_KEY=change_this_to_a_random_secret
APP_ENV=productionstreamlit run app.pyThe app will open at http://localhost:8501
edusathi/
βββ app.py # Main entry point + login/register
βββ .env.example # Environment variable template
βββ .gitignore # Git ignore rules
βββ requirements.txt # Python dependencies
β
βββ .streamlit/
β βββ config.toml # Streamlit theme config
β
βββ data/
β βββ .gitkeep # Keeps data/ dir in git
β βββ users.db # SQLite database (auto-created)
β βββ vector_stores/ # FAISS indexes (auto-created)
β βββ question_papers/ # Uploaded papers (auto-created)
β
βββ modules/
β βββ __init__.py
β βββ auth.py # Authentication, user/quiz DB operations
β βββ llm_client.py # Groq LLM wrapper (chat, MCQ, analysis)
β βββ rag_pipeline.py # PDF ingestion + FAISS retrieval
β βββ quiz_engine.py # Quiz session state management
β βββ flashcard_generator.py # LLM-powered flashcard creation
β βββ progress_tracker.py # Score tracking + mastery calculation
β βββ report_generator.py # PDF report generation
β βββ ui_components.py # Global CSS + reusable UI components
β βββ icons.py # SVG icon registry (Lucide-style)
β βββ modern_ui.py # Input validation + toast notifications
β βββ validation.py # Security validators
β
βββ pages/
βββ 1_Dashboard.py # Student dashboard
βββ 2_Chat_Tutor.py # AI chat with uploaded PDFs
βββ 3_Quiz_Mode.py # Adaptive quiz generation
βββ 4_Exam_Simulation.py # Timed exam mode
βββ 5_Flashcards.py # Auto-generated flashcards
βββ 6_Progress_Tracker.py # Analytics + PDF report export
βββ 7_Admin_Panel.py # Admin: users, papers, analytics
βββ 8_Faculty_Panel.py # Faculty: student performance
After first run, register new accounts through the app. To test role-based access:
- Register a new account (defaults to
studentrole) - To create an admin account, register normally, then manually update the role in the database:
# Open SQLite shell
sqlite3 data/users.db
# Promote a user to admin
UPDATE users SET role = 'admin' WHERE email = 'your@email.com';
# Or create a faculty account
UPDATE users SET role = 'faculty' WHERE email = 'faculty@email.com';
.quit- Push this repo to GitHub
- Go to share.streamlit.io
- Connect your GitHub repo
- Set Main file path:
app.py - Add your secrets in Advanced Settings β Secrets:
GROQ_API_KEY = "gsk_your_key_here"
DB_PATH = "./data/users.db"
VECTOR_STORE_DIR = "./data/vector_stores"
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
LLM_MODEL = "llama-3.3-70b-versatile"
SECRET_KEY = "your_random_secret"
APP_ENV = "production"
β οΈ Note: Streamlit Cloud uses ephemeral storage. The SQLite database and vector stores will reset on redeployment. For persistent data, consider migrating to PostgreSQL + a cloud vector DB.
| Variable | Required | Description |
|---|---|---|
GROQ_API_KEY |
β | Your Groq API key for LLM access |
DB_PATH |
β | SQLite database path (default: ./data/users.db) |
VECTOR_STORE_DIR |
β | FAISS vector store directory (default: ./data/vector_stores) |
EMBEDDING_MODEL |
β | Sentence transformer model (default: all-MiniLM-L6-v2) |
LLM_MODEL |
β | Groq model name (default: llama-3.3-70b-versatile) |
SECRET_KEY |
β | App secret for session security |
APP_ENV |
β | development or production |
App shows "GROQ_API_KEY not configured"
Make sure your .env file exists and contains a valid key:
GROQ_API_KEY=gsk_xxxxxxxxxxxxx
Get a free key at console.groq.com/keys
ModuleNotFoundError on import
Ensure you activated your virtual environment and installed dependencies:
venv\Scripts\activate # Windows
pip install -r requirements.txtSidebar not showing after login
Hard-refresh the browser with Ctrl + Shift + R. The sidebar state may be cached from a previous session.
PDF upload fails or returns empty results
- Ensure the PDF has selectable text (not scanned images)
- Check file size is under 50MB
- Verify your Groq API key is valid and has remaining quota
This project is licensed under the MIT License β see the LICENSE file for details.
Built with β€οΈ for VSKUB Students