KatInterview

Building a Metrics Platform for a Conversational AI Service

System DesignModel answer
MediumModel answerSystem Designdata-pipelinemetricsreal-time

Last updated

Design a scalable analytics backend that ingests events from production systems, computes real-time and historical metrics, and serves aggregated data to dashboards.

You're tasked with architecting a metrics and analytics platform for a large-scale conversational AI service. This platform will power internal dashboards used by product teams and engineers to monitor service health and understand user behavior.

The LLM inference infrastructure and dashboard frontend are already built. Your job is to design the middle layer: the data infrastructure that pulls information from production systems, transforms it into useful metrics, and exposes those metrics through an API.

Your design should cover:

  • Data collection strategy – how to extract data from live services and databases without impacting performance
  • Schema design – what event structures and data models you'll use to represent activity
  • Dual-path processing – supporting both quick approximate insights (1-2 minutes) and precise historical analysis
  • Metric computation – calculating indicators like daily active users, conversation counts, throughput, latency distributions, token consumption, failure rates, and feature usage
  • Dimensional analysis – enabling breakdowns by time period, model variant, geographic region, client platform, and user cohort
  • Data quality – ensuring accuracy through deduplication, handling late-arriving data, and supporting historical corrections
  • Security and governance – access controls, privacy protections, and system observability
  • Query interface – what APIs or query patterns the dashboard will use to retrieve metrics

Assume you're operating at significant scale with requirements for multi-month data retention.

Hints

Hint 1

Consider how to extract operational data without adding load to transaction-processing systems

Hint 2

Think about which metric types can be combined across time windows and which cannot

Hint 3

Separate the path for immediate operational visibility from the path for accurate historical reporting