Building an AI data analyst: how to handle conflicting per-user KPI definitions

Lopsided_Feedback_81 · reddit · 2026-11-11

A developer of an AI data analyst product for Shopify stores describes a real engineering pain: users within the same company define KPIs differently (e.g., is revenue net of refunds?), rarely state their definition, and blame the model when results mismatch.

Current approach: run a cheap model daily over conversation traces in MLflow, extract explicitly stated definitions, store them in a Postgres jsonb keyed by userid, and inject them into the system prompt at session start. Three problems: it's slow, misses implicit definitions, and may mistake one-off statements for durable definitions. The post asks the community for better designs.

Original post →

More from coding & agent

coding & agent channel →