# Voice Session Analytics Dashboard

## PURPOSE
Visualise what happened during a full-duplex voice session. The video is packed with countable events — how often the assistant is interrupted, how many speakers were active at once, which languages it translated into (Polish here), how many live research lookups it ran, and how the trip constraints on distance and nightly budget were met. This Streamlit dashboard turns a session log into charts so a product or research team can reason about the voice model's behaviour.

## WHY THIS MATTERS
Full-duplex voice produces messy, overlapping data that is easy to argue about and hard to see. The clip's "three women, one hair dryer, everyone talking at once" is a concurrency problem, and concurrency problems are understood through distributions, not anecdotes. Plotly gives you those distributions interactively, so students learn to justify a claim like "it handles interruptions well" with a number.

## HOW TO BUILD
1. Load a session log (CSV or JSONL) with `pandas`: timestamp, speaker, event type, language, latency.
2. Build a sidebar of filters — date range, speaker, event type.
3. Render four panels with `plotly.express`: interrupts per minute, speaker overlap timeline, translation-language counts, and budget-vs-distance for the tour stages.
4. Put it all behind `st.cache_data` so reruns stay fast.
Key snippet:

```python
import streamlit as st, plotly.express as px
@st.cache_data
def load(path: str):
    return pd.read_csv(path, parse_dates=["ts"])

df = load("session_log.csv")
fig = px.histogram(df[df.event == "barge_in"], x="ts", nbins=30,
                   title="Interruptions over time")
st.plotly_chart(fig, use_container_width=True)
```

## WHEN TO USE IN PRODUCTION
Use it for voice-QA dashboards, A/B comparisons of turn-taking policies, and weekly reviews of live translation usage. Do NOT use it as a realtime monitor — a batch dashboard lags a live call; for that you need streaming metrics and alerting, not a Streamlit app.

## HOW IT HELPS STUDENTS
They practise DataFrame preparation, caching, interactive chart design and choosing the right plot for a distribution question. They also learn to derive metrics from raw event logs.

## STARTER CODE
`starter/main.py` generates a deterministic synthetic session log, then renders the four panels described above. Loaders are marked `# TODO` to be pointed at a real backend.
