A comprehensive AI-powered chatbot for pilot training, built with OpenAI GPT-4 and a comprehensive FAA knowledge base.
-
Comprehensive Knowledge Base: 1,931 documents from official FAA sources including:
- FAA Regulations (FARs)
- Airplane Flying Handbook
- Instrument Flying Handbook
- Aviation Instructor's Handbook
- Aeronautical Information Manual (AIM)
- Private Pilot ACS
- Instrument Rating ACS
- Commercial Pilot ACS
- Flight Instructor ACS
- Advisory Circulars
-
AI-Powered Responses: Uses OpenAI GPT-4 to provide accurate, contextual answers
-
Source Citations: All responses include references to official FAA materials
-
Professional Interface: Clean, pilot-focused chat interface
-
Feedback System: Rate responses to improve the system
- Backend: Flask API with OpenAI integration and SQLite vector database
- Frontend: React.js with modern UI components
- Knowledge Processing: Advanced text chunking with tiktoken for optimal retrieval
- Python 3.8+
- Node.js 14+
- OpenAI API Key
-
Navigate to the backend directory:
cd backend -
Create and activate virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install flask flask-cors openai numpy requests beautifulsoup4 PyPDF2 tiktoken python-dotenv
-
Set your OpenAI API key:
# Edit .env file and add your API key: OPENAI_API_KEY=sk-your-actual-key-here -
Build the knowledge base (optional - pre-built version included):
python pilot_training_scraper.py
-
Start the backend server:
python pilot_backend.py
-
Load the knowledge base:
curl -X POST http://localhost:5001/api/ingest \ -H 'Content-Type: application/json' \ -d '{"file_path": "pilot_training_knowledge_base.json"}'
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm start
-
Open your browser to: http://localhost:3000
Once both servers are running, you can:
- Ask questions about pilot training topics
- Get detailed explanations with FAA source citations
- Explore regulations, procedures, and ACS requirements
- Receive accurate, up-to-date aviation information
- "What are the weather minimums for VFR flight?"
- "How do I log cross-country time?"
- "What are the private pilot certificate requirements?"
- "Explain the four forces of flight"
- "What's required for a biennial flight review?"
GET /health- Health checkPOST /api/chat- Main chat endpointPOST /api/ingest- Load knowledge basePOST /api/feedback- Submit feedbackGET /api/stats- System statistics
- Estimated monthly cost: $5-15 for moderate use
- Embedding model: text-embedding-3-small ($0.02 per 1M tokens)
- LLM model: gpt-4o-mini ($0.15 per 1M input, $0.60 per 1M output)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
This chatbot is for educational purposes only. Always consult official FAA publications and your CFI for authoritative guidance on aviation matters.