How shreyaasdeworld/smartalertexplainerusingai works
This MVP monitors PostgreSQL for long-running transactions, converts detected sessions into standardized alerts, asks GPT-4o-mini for structured DBA guidance, and displays database status, alert details, and analysis in Streamlit. The graph follows the documented principal workflow; README-described future capabilities are omitted because they are planned, not implemented. Source excerpts establish the main calls, while some database and AI behavior is documented only in the README.
Main entry points: ai_analyzer.py Alert analysis · app.py Monitoring dashboard · alerts.py Alert detection · db.py Session monitoring
Components 11
Monitoring
- Session monitoring
db.py - Connection utility
conn_db.py - Alert detection
alerts.py - Alert JSON
alerts.py
AI analysis
- Alert analysis
ai_analyzer.py - Analysis prompt
ai_analyzer.py
Dashboard
- Monitoring dashboard
app.py - Displayed results
app.py
Other components
- Developer / DBA
- PostgreSQL
- GPT-4o-mini
Connections 12
- Developer / DBA → Monitoring dashboard: checks database
README.md - Monitoring dashboard → Alert detection: requests alerts
app.py - Alert detection → Session monitoring: queries sessions
alerts.py - Session monitoring → PostgreSQL: reads activity
README.md - Connection utility → PostgreSQL: connects to
conn_db.py - Alert detection → Alert JSON: generates
alerts.py - Monitoring dashboard → Alert analysis: submits alerts
app.py - Alert analysis → GPT-4o-mini: requests analysis
README.md - Alert analysis → Analysis prompt: uses prompt
ai_analyzer.py - Alert analysis → Alert JSON: analyzes alerts
ai_analyzer.py - Monitoring dashboard → Displayed results: renders status and analysis
app.py - Displayed results → Developer / DBA: shows results
README.md