The AI Driver Safety Platform is a real-time intelligent monitoring system designed to detect potential driving risks and prevent accidents. It leverages Machine Learning, Semantic Search (Endee Vector DB), and Explainable AI (RAG) to analyze driving conditions and generate meaningful insights.
This project is built on top of a forked Endee repository, fulfilling the requirement of using Endee as a vector database.
Road accidents often occur due to:
- Overspeeding
- Poor weather conditions
- Lack of situational awareness
This system aims to predict and explain driving risks in real time, enabling safer driving decisions.
-
🚗 Real-Time Monitoring (2s refresh)
-
📱 Mobile GPS Tracking (via browser)
-
🌦️ Weather-aware Risk Detection
-
🧠 Hybrid Risk Engine
- ML-based prediction
- Semantic similarity search (Endee)
-
📊 Explainable AI (RAG)
-
📄 Smart Event Logging
- Logs only MEDIUM & HIGH risks
-
📸 Evidence Capture for High Risk
-
📈 Interactive Dashboard (Charts + Map)
User Input / Sensors (GPS, Speed, Weather)
↓
Data Processing Layer
↓
--------------------------
| ML Model Prediction |
| Endee Semantic Search |
--------------------------
↓
Hybrid Risk Engine
↓
Explainability (RAG)
↓
Dashboard + Alerts + Logging
This project integrates Endee Vector Database for semantic search:
- Retrieves similar accident scenarios
- Compares real-time driving conditions
- Enhances prediction accuracy
from endee_client import similarity_search👉 Endee enables fast and scalable similarity matching, making the system context-aware.
| Condition | Status |
|---|---|
| Speed ≤ 3 km/h | IDLE |
| Low Risk | SAFE |
| Medium Risk | |
| High Risk | 🚨 ALERT |
👉 Only MEDIUM and HIGH risks are stored in risk_logs.csv
- 🎯 Risk Gauge (Real-time)
- 📈 Speed vs Risk Graph
- 🧠 AI Explanation Panel (RAG)
- 🌍 Live Map (Mobile GPS)
- 📄 Recent Risk Logs
- Frontend: Streamlit
- Backend: Python
- AI/ML: Custom Risk Model
- Vector Database: Endee
- Explainability: RAG
- Visualization: Plotly
- Data: Pandas
git clone https://github.com/madha1502/endee.git
cd endee/ai-driver-safety
pip install -r requirements.txt
streamlit run app.py- Connect mobile & laptop to same WiFi
- Run app on laptop
- Open in mobile browser:
http://<your-ip>:8501
- Allow location access
endee/
├── ai-driver-safety/
│ ├── app.py
│ ├── agent.py
│ ├── semantic_search.py
│ ├── rag.py
│ ├── auth.py
│ ├── gps_speed.py
│ ├── logger.py
│ ├── requirements.txt
│ └── README.md
- 📡 Real sensor integration (IoT)
- 🤖 Deep Learning models
- ☁️ Cloud deployment (Endee Cloud)
- 🚔 Traffic authority alerts
- 📱 Mobile app version
- Real-world AI application
- Uses Vector DB (Endee) effectively
- Combines ML + RAG + Semantic Search
- Clean modular architecture
This project demonstrates a complete AI pipeline for real-time decision making, combining:
- Machine Learning
- Vector Databases
- Explainable AI
👉 A scalable solution for smart transportation systems
- Endee (Vector Database)
- Streamlit
- Python Ecosystem