Production Monitoring Genai

LLMs interview question · Hard difficulty

What do you monitor for an LLM, RAG, or agent application in production?hard

Status
✓
Type
conceptual
Topic
production-monitoring-genai
Frequency
common
Tags
production-monitoring, observability, RAG, agents, drift
Answer

Six layers, because LLM systems are probabilistic and fail in subtle ways: quality (correctness, hallucination rate, groundedness, user feedback), safety (prompt injection attempts, unsafe outputs, data leakage, policy violations), RAG-specific (retrieval precision/recall, chunk relevance, stale documents, permission issues), agent-specific (tool calls, repeated actions, failed tools, loop detection, human approval and rollback events), operational (latency, cost, token usage, error/timeout rate, throughput), and drift (model version changes, data changes, user behavior shifts, retrieval index changes, prompt changes).

Explanation

A service can stay available while the quality of what it produces quietly degrades — that's why generic uptime monitoring isn't enough for GenAI systems. Quality monitoring tracks whether answers are still correct and grounded, not just whether the endpoint responds. Safety monitoring catches prompt injection attempts, toxic or biased outputs, and policy violations before they compound. RAG monitoring is its own layer because retrieval failures are invisible at the generation layer — you need visibility into what was actually retrieved, whether it was relevant, and whether the index has gone stale. Agent monitoring exists because agents can fail in ways a single LLM call can't: looping on a tool, repeating a failed action, or taking a high-risk action that should have required human approval. Drift monitoring matters because behavior can shift even with no code change — a model version update from the provider, a retrieval index update, or a small prompt tweak can all silently change output quality. Good production systems log prompts, responses, retrieved context, tool calls, and evaluation signals across all six layers, while still respecting privacy and security in what gets logged.

Follow-upWhy is retrieval-layer monitoring necessary in addition to monitoring the final generated answer?
Follow-upHow would you detect drift caused by a silent model version update from your LLM provider?
Follow-upWhat's the risk of only monitoring operational metrics like latency and cost for a GenAI system?