Intelligent Educational Content Generation with Comprehensive Quality Assurance
Generate high-quality, context-grounded quiz questions and essay prompts using Graph-based RAG, dual-model AI validation, and comprehensive quality metrics.
- Multiple Choice Questions (MCQs): 6-10 questions with Bloom's Taxonomy coverage
- Essay Questions: 2-5 deep-reasoning prompts with expected concepts
- Per-Question Metrics: Individual quality scores for each question
- Automatic Filtering: Low-quality questions rejected automatically (>50% coverage threshold)
- Answer Verification: Validates correct answers for MCQs
- Concept Verification: Checks expected concepts for essays
- Groundedness: Measures how well content is supported by source material (target: >90%)
- Hallucination Rate: Tracks content not found in retrieved context (target: <25%)
- Overall Quality: Combined score (target: >80% for "Excellent")
- Real-time Tracking: Monitor quality across all generated content
- Dual-Model Architecture: Gemma3:4b for generation, Llama 3.2 for validation
- Coverage Checks: Questions must have >50% term overlap with context
- Critic Validation: 5-point validation checklist for every question
- Fuzzy Matching: Reduces false positives for technical terms
- 50% reduction in hallucination rate (50.6% β 20-25%)
- 100% fix for wrong answers (2/6 β 0/6)
- 11% increase in overall quality (74.7% β 83-87%)
- 100% question generation (3/6 β 6/6)
- Python 3.8+
- Neo4j Database (running locally or remotely)
- Ollama with required models
# Clone the repository
git clone https://github.com/yourusername/GraphRAG-Edu-Suite.git
cd GraphRAG-Edu-Suite
# Install dependencies
pip install -r requirements.txt
# Pull required AI models
ollama pull gemma3:4b
ollama pull llama3.2:latest
# Configure environment
cp .env.example .env
# Edit .env with your Neo4j credentials:
# NEO4J_URI=bolt://localhost:7687
# NEO4J_USERNAME=neo4j
# NEO4J_PASSWORD=your_passwordstreamlit run main.pyVisit http://localhost:8501 in your browser!
Upload PDF lecture materials to build your knowledge graph. The system extracts entities, relationships, and concepts using Gemma3.
Choose between MCQs or Essays, select your lesson, and specify the number of questions.
The system automatically:
- Retrieves 1500+ fys, select lesson and question count
System automatically:
- Retrieves 1500+ facts from knowledge graph
- Generates questions with Gemma3
- Validates with Llama 3.2 critic
- Filters by coverage thresholds
- Calculates RAG metrics
See per-question quality metrics and use high-quality content!
Q1: Understand
Which of the following best describes Data-Driven AI?
Groundedness: 100% β
Good
Hallucination: 20% β
Low
A. An AI approach that learns from examples and data. β
B. A system that relies solely on human-defined rules.
C. A system that mimics human expert decision-making.
D. A system using symbolic reasoning.
π Overall Quiz Quality
Average Groundedness: 100%
Average Hallucination: π’ 24%
Overall Quality: 88% β Excellent
User Interface (Streamlit)
β
Generation Pipeline
ββ Context Retrieval (Neo4j)
ββ Generation (Gemma3:4b)
ββ Validation (Llama 3.2)
ββ Coverage Filtering
ββ RAG Metrics
β
Knowledge Graph (Neo4j)
GenertaiveQestionsModel/
βββ main.py # Streamlit UI
βββ engine/
β βββ processor.py # PDF processing
β βββ generator.py # Question generation
β βββ graph_store.py # Neo4j operations
β βββ rag_metrics.py # Metrics calculation
β βββ vram_util.py # Model management
βββ docs/ # Documentation
βββ .env # Configuration
βββ requirements.txt # Dependencies
Measures how well questions are supported by source material
- Formula: (Supported Sentences) / (Total Sentences)
- Target: >90%
Tracks content not found in retrieved context
- Formula: (Words NOT in Context) / (Total Unique Words)
- Target: <25%
Combined quality score
- Formula: (Groundedness Γ 50%) + ((1 - Hallucination) Γ 50%)
- Target: >80% for "Excellent"
- Project Overview - Complete system documentation
- Metrics Guide - How metrics are calculated
- Visual Guide - Visual explanations
- Testing Guide - How to test improvements
- Before/After - Quality improvements comparison
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your_password- Gemma3:4b: Generation model (questions, essays)
- Llama 3.2: Validation model (critic, grading)
- Question coverage: >50% (configurable in
engine/generator.py) - Answer coverage: >40% (configurable in
engine/generator.py) - Concept coverage: >40% (configurable in
engine/generator.py)
- Hallucination: 50.6%
- Wrong answers: 2/6 questions
- Question count: 3/6 generated
- Hallucination: 20-25% β
- Wrong answers: 0/6 questions β
- Question count: 6/6 generated β
Contributions welcome! Areas for improvement:
- Additional LLM support
- Enhanced metrics algorithms
- UI/UX improvements
- Documentation
- Bug fixes
- Ollama for local LLM inference
- Neo4j for graph database
- Streamlit for web framework
- LangChain for LLM orchestration
- Generate quiz questions from lectures
- Create essay prompts with quality assurance
- Track content quality
- Ensure questions are answerable
- Practice with high-quality questions
- Get clear essay expectations
- Receive AI-powered feedback
- Study with Bloom's Taxonomy alignment
- Experiment with RAG metrics
- Study hallucination reduction
- Analyze knowledge graphs
- Benchmark LLM performance
Version: 2.0 (Quality Control Update)
Status: Production Ready β
Last Updated: February 2026
Made with β€οΈ using Gemma3, Llama 3.2, Neo4j, and Streamlit