Dashboard metrics are scoped to the active assistant or organization context. When no context is selected, the signed-in user’s default context is used.

Live Dashboard Workflow

Use the analytics dashboard to answer operational questions during and after support coverage.

Dashboard areaWhat it showsOperator or manager use
Timeframe selectorLast month or All time in the current UI. API clients can also request day, week, month, previous month, all time, or custom ranges.Switch between recent operations review and long-term baseline checks.
Refresh actionRe-fetches analytics and sentiment payloads without changing the selected tab.Refresh during active queue reviews or after a campaign, incident, or handoff spike.
KPI cardsTotal conversations, total messages, average response time, and user rating.Spot volume changes, response-time regressions, or rating movement before opening detailed tabs.
TabsOverview, sources, performance, engagement, and sentiment.Move from broad activity to the operational surface that explains the change.
Charts and insight cardsTrends, source mix, response buckets, hourly engagement, topic lists, category lists, and sentiment distribution.Identify staffing needs, content gaps, handoff causes, and customer friction patterns.

Date Ranges

The analytics dashboard reads from /api/analytics and supports these ranges:

RangeCalculation
TodayFrom local midnight today through the request time.
Last 7 daysRolling seven-day window ending at the request time.
Last 30 daysRolling one-month window ending at the request time.
Previous monthPrevious calendar month, from day 1 at 00:00 through the final day at 23:59:59.999.
All timeEvery conversation created before the request time.
CustomInclusive startDate through endDate query parameters.

Primary Metrics

MetricDashboard labelDefinition
Active conversationsTotal conversationsCount of conversations documents for the selected context and date range. A conversation is included by its createdAt timestamp.
Total messagesTotal messagesSum of metadata.totalMessages when present; otherwise the count of items in the conversation messages array.
Average messages per conversationAvg. messages / conversationtotalMessages / totalConversations, rounded to one decimal. Empty ranges return 0.
Active usersActive usersCount of unique non-empty endUserId values across matching conversations.
Average response timeAvg. response timeAverage seconds between a user message and the immediately following assistant message. Only positive deltas below 600 seconds are included; dormant-session outliers are excluded. The result is rounded to one decimal.
SatisfactionSatisfaction / average ratingConversation-level metadata.analytics.rating average for new web-widget CSAT submissions. Backward-compatible aggregates may also read legacy metadata.rating, messages[].metadata.rating, and messages[].rating; count at most one rating per conversation. Ratings must be 1–5 integers and are rounded to one decimal. Sentiment satisfaction is documented separately on the Sentiment page.

Response Time Buckets

The performance tab groups the same response-time samples into:

BucketDefinition
FastLess than 7.5 seconds.
Medium7.5 through 15 seconds.
SlowMore than 15 seconds and less than the 600-second outlier cap.

Source Usage

Source usage is calculated per assistant message so the chart percentages add up cleanly:

SliceDefinition
FAQ SourcesAssistant messages with at least one RAG match whose source contains faq.
Document SourcesAssistant messages with matches, but no FAQ match.
Direct ResponsesAssistant messages with no RAG matches.

The dashboard also tracks raw FAQ and document match counts for source coverage KPIs. These raw counts can exceed the number of assistant messages because one answer may cite multiple matches.

Conversation trends group matching conversations by createdAt day and return daily conversation and message counts.

Popular topics are extracted from user messages with a lightweight RAKE-style pass:

  1. Lowercase and strip punctuation and accents.
  2. Split around sentence boundaries, stop words, short tokens, and numbers.
  3. Keep one-to-five-word content phrases.
  4. Stem simple English and Italian variants.
  5. Merge near-duplicates by token subset or strong overlap.

The API returns up to 50 topics ordered by count. Topic trend is currently reported as stable.

Known Limits

Hourly engagement returns all 24 hourly slots. messages is the true per-hour message count; users is a placeholder that is 1 when that hour has activity and 0 otherwise.

Analytics are conversation-derived. Older event-based fields in backend/lib/analytics.ts are not the source for the current dashboard.

Real-time counters are available through /api/analytics/real-time for live dashboard surfaces, but the primary dashboard trends are still computed from persisted conversations. Use real-time views for queue awareness and persisted dashboard metrics for reporting.