Chapter 63
Module 5: Monitoring
Module 5: Monitoring
Offline evaluation can't tell you how your RAG system performs once real people use it. This module covers online monitoring: collecting metrics from real traffic and visualizing them on a dashboard.
We build a Streamlit chat app, capture metrics, store conversations in PostgreSQL, and create Grafana dashboards for real-time monitoring.
Lessons
Work through them in order:
- Intro - Why monitoring matters, what we'll build
- Assistant Setup - Setting up the RAG assistant
- Chat App - Basic Streamlit app with RAG
- Capturing Metrics - LLMCallRecord, cost tracking
- Database - PostgreSQL with Docker, saving conversations
- Querying Data - Fetching stored conversations
- Streamlit Dashboard - Visualizing metrics in Streamlit
- User Feedback - Thumbs up/down buttons
- Built-in Judge - LLM-as-a-judge for automatic relevance evaluation
- Feedback Dashboard - Adding feedback panels to the Streamlit dashboard
- Synthetic Data - Generating test data for dashboards
- Grafana Dashboards - SQL queries and dashboard panels
- Docker Compose - Running everything together
- Next Steps - OpenTelemetry, alerting, frameworks to learn more
Homework
Original workshop recording
This module was taught as a live workshop, which we chopped into the per-lesson videos above. To watch the full uncut recording:
Older content
Earlier cohorts ran this module with a different stack:
