An intelligent SAT preparation system that combines knowledge graphs, semantic augmentation, and Large Language Models (LLMs) to provide personalized SAT tutoring with GPU acceleration support.
- Knowledge Graph Integration: Builds and queries semantic knowledge graphs from educational content
- Semantic Augmentation: Enhances questions and explanations using AI models
- GPU Acceleration: Optimized for AMD GPUs using DirectML on Windows
- Multi-Model Support: Works with both local models and cloud APIs (Groq)
- Interactive Learning: Provides detailed explanations and concept extraction
- Cross-Platform: Supports Windows, macOS, and Linux
The system consists of several key components:
- Knowledge Graph Module (
knowledge_graph.py): Manages semantic relationships and entity extraction - Semantic Augmenter (
semantic_augmenter.py): Enhances content using LLMs with GPU acceleration - Graph RAG (
graph_rag.py): Retrieval-Augmented Generation using knowledge graphs - Main Application (
sat_tutor.py): Orchestrates all components for SAT tutoring
- Python 3.10 or higher
- AMD GPU (for DirectML acceleration) or NVIDIA GPU (for CUDA)
- Windows 10/11 (for DirectML support)
-
Clone the repository:
git clone https://github.com/yourusername/sat-tutor.git cd sat-tutor -
Create a virtual environment:
python -m venv sat-tutor-env
-
Activate the virtual environment:
- Windows:
sat-tutor-env\Scripts\activate
- macOS/Linux:
source sat-tutor-env/bin/activate
- Windows:
-
Install dependencies:
pip install -r requirements.txt
-
Install DirectML:
pip install torch-directml
-
Verify installation:
python -c "import torch_directml; print('DirectML available:', torch_directml.is_available())"
-
Install PyTorch with CUDA:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
-
Verify installation:
python -c "import torch; print('CUDA available:', torch.cuda.is_available())"
from sat_tutor import SATTutor
# Initialize the tutor
tutor = SATTutor()
# Ask a question
question = "What is the quadratic formula?"
answer = tutor.ask_question(question)
print(answer)from semantic_augmenter import SemanticAugmenter
from knowledge_graph import KnowledgeGraph
# Initialize components
augmenter = SemanticAugmenter(use_groq=False, model_name="gpt2")
knowledge_graph = KnowledgeGraph()
# Extract concepts from text
text = "The American Revolution was a political and military conflict..."
concepts = augmenter.extract_concepts(text)
# Build knowledge graph
knowledge_graph.add_concepts(concepts)
# Generate explanations
explanation = augmenter.generate_explanation(
question="What caused the American Revolution?",
correct_answer="Taxation without representation",
wrong_answers=["British military weakness", "French intervention"]
)sat-tutor/
βββ sat_tutor.py # Main application
βββ knowledge_graph.py # Knowledge graph management
βββ semantic_augmenter.py # AI model integration
βββ graph_rag.py # Graph-based RAG system
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ .gitignore # Git ignore rules
Create a .env file in the project root:
# Groq API (optional)
GROQ_API_KEY=your_groq_api_key_here
# Model Configuration
DEFAULT_MODEL=gpt2
USE_GPU=trueThe system supports various models:
- Local Models: GPT-2, OPT, Llama-2 (requires sufficient RAM/VRAM)
- Cloud APIs: Groq (requires API key)
Run the GPU acceleration test:
python test_gpu.pyTest DirectML functionality:
python test_directml.py- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Hugging Face for transformer models
- Microsoft DirectML for AMD GPU support
- Groq for cloud inference API
- The SAT community for educational content
If you encounter any issues:
- Check the Issues page
- Create a new issue with detailed information
- Include your system specifications and error messages
Stay updated with the latest features and improvements:
git pull origin main
pip install -r requirements.txt --upgrade