An AI tutor that uses the Feynman Technique to help users learn complex topics through simple explanations and interactive quizzing.
- Two-Phase Learning Process:
- Topic Gathering: Identifies what the user wants to learn
- Feynman Tutoring: Explains concepts simply and quizzes understanding
- Interactive Chat Interface: Both CLI and API endpoints
- Real-time Communication: WebSocket support for frontend integration
- Session Management: Maintains conversation context across phases
# Clone the repository
git clone <your-repo-url>
cd feynomenon-ai
# Make the setup script executable (if not already)
chmod +x start.sh
# Run the setup script
./start.sh setupThe setup script will:
- Check Python version (requires 3.8+)
- Create a virtual environment
- Install all dependencies
- Create a
.envfile from template
- Visit Google AI Studio
- Create a new API key
- Edit the
.envfile and add your API key:GEMINI_API_KEY=your_actual_api_key_here
./start.sh cli./start.sh startThe API will be available at http://localhost:8000
./start.sh test # Run tests
./start.sh help # Show all available commandsPOST /chat- Send a message and get AI responseGET /session/{session_id}/state- Get session stateDELETE /session/{session_id}- Delete a sessionGET /health- Health check
WS /ws/{session_id}- Real-time chat communication
import requests
# Start a new chat session
response = requests.post("http://localhost:8000/chat", json={
"message": "I want to learn about quantum physics"
})
print(response.json())
# {
# "response": "Hello! I'm here to help you learn...",
# "session_id": "uuid-here",
# "topic_identified": false,
# "phase": "topic_gathering"
# }const ws = new WebSocket('ws://localhost:8000/ws/session-id');
ws.onmessage = function(event) {
const data = JSON.parse(event.data);
console.log('AI:', data.response);
};
ws.send(JSON.stringify({
message: "I want to learn about machine learning"
}));feynomenon-ai/
├── api.py # FastAPI application
├── chat.py # Chat session management
├── cli.py # Command-line interface
├── config.py # Configuration settings
├── start.sh # Setup and management script
├── requirements.txt # Python dependencies
├── env_example.txt # Environment variables template
├── README.md # This file
└── training_scripts/ # Fine-tuning scripts
├── train_gemini.py
└── train_mistral.py
./start.sh testWhen the API server is running, visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
If you prefer not to use the setup script:
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Setup environment
cp env_example.txt .env
# Edit .env and add your GEMINI_API_KEY
# Run application
python api.py # For API server
python cli.py # For CLI interface-
"Virtual environment not found"
- Run
./start.sh setupfirst
- Run
-
"API key not configured"
- Edit
.envfile and add yourGEMINI_API_KEY
- Edit
-
"Python 3 not found"
- Install Python 3.8 or higher
-
Permission denied on start.sh
- Run
chmod +x start.sh
- Run
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
[Your License Here]