Online evaluation and user feedback loops
Offline evals tell you how your system does on the examples you thought of. Production tells you how it does on everything else. Online evaluation is the practice of scoring real traffic as it happens, using a mix of automated graders running on sampled traces and signals from users themselves. Done well, it closes the loop: the worst production traces become tomorrow's offline test cases.
Why it matters
Your golden dataset is a snapshot. Users drift: new intents appear, a marketing campaign brings a different audience, a policy changes and old answers become wrong. Providers also update models behind stable names. None of that shows up in an offline suite until someone adds the cases. Online evals catch it in hours instead of weeks.
They also answer questions offline evals cannot: are users actually satisfied, do they retry, do they escalate to a human, did the conversation end in a purchase?
How it works
There are three families of online signals.
Automated graders on live traces. You run the same kinds of graders as offline (code checks, calibrated LLM judges) on a sample of production traces. Langfuse calls these LLM-as-a-judge evaluators that can run continuously on live traces; LangSmith and Phoenix have equivalent online evaluator features; W&B Weave added online evaluations for scoring incoming traces. Because there is usually no reference answer in production, these are mostly reference-free checks: faithfulness to retrieved context, policy compliance, format, refusal appropriateness.
Explicit user feedback. Thumbs up and down, star ratings, "report a problem" buttons, free-text comments. High signal, low volume: most users never click anything, and the ones who do skew negative.
Implicit feedback. Behaviour that implies satisfaction or frustration: copying the answer, regenerating, rephrasing the same question, abandoning the session, escalating to a human, completing the downstream action. High volume, noisier, and often the best proxy for business value.
Rendering diagram…
The key data-model idea, which Langfuse makes explicit, is that every signal (judge verdict, human annotation, user click, programmatic check) is stored as a score attached to a trace. That lets you filter "traces where the judge said fail and the user gave thumbs down" in one query.
Reference architecture
Rendering diagram…
Two implementation details matter: return the trace ID to the frontend so feedback can be attached to the right trace, and run judges asynchronously so they never add latency to the user's request.
Code
Recording explicit feedback and a judge verdict as scores with the Langfuse Python SDK. get_client(), get_current_trace_id() and create_score (with score_id as an idempotency key) are the documented Python SDK entry points; check the docs for your installed version since method names have changed between major versions.
from langfuse import get_client, observe
langfuse = get_client()
@observe()
def answer(question: str) -> dict:
text = generate(question) # your RAG or agent call
trace_id = langfuse.get_current_trace_id()
return {"text": text, "trace_id": trace_id}
def record_feedback(trace_id: str, message_id: str, thumbs_up: bool, comment: str = ""):
langfuse.create_score(
score_id=f"feedback-{message_id}", # idempotency key: a later click replaces it
trace_id=trace_id,
name="user-feedback",
value=1.0 if thumbs_up else 0.0,
data_type="BOOLEAN",
comment=comment or None,
)
def record_judge(trace_id: str, passed: bool, reasoning: str):
langfuse.create_score(
trace_id=trace_id,
name="faithfulness-judge",
value=1.0 if passed else 0.0,
data_type="BOOLEAN",
comment=reasoning,
)
def generate(question: str) -> str:
raise NotImplementedError
A nightly job then queries traces where user-feedback is 0 or faithfulness-judge is 0, a human reviews them, and confirmed failures go into the golden dataset.
Trade-offs and pitfalls
- Feedback bias. Explicit feedback is sparse and skewed towards angry users. Do not read a thumbs-down rate as a quality metric on its own; read it as a pointer to traces worth reviewing.
- Implicit signals are ambiguous. A regenerate click might mean the answer was bad, or that the user wanted options. Validate implicit signals against labelled samples before you trust them.
- Judge cost at scale. Judging every trace can cost more than serving it. Sample, and over-sample risky segments (new features, low-confidence retrievals, long conversations).
- Privacy and consent. Sending production content to a third-party judge or observability vendor is a data-processing decision. Check your agreements, redact PII, and respect regional data residency.
- Alert fatigue. Alert on sustained shifts in score distributions, not individual bad traces.
- No loop back. Online scores that nobody triages are just dashboards. The value comes from moving failures into the offline set.
Checklist
- Every response carries a trace ID that the frontend can send back with feedback.
- Explicit feedback, implicit signals and judge verdicts are stored as scores on the same trace.
- Online judges run asynchronously on a sampled, risk-weighted subset of traffic.
- Online judges are the same calibrated judges you use offline.
- Someone triages the worst-scoring traces on a fixed cadence.
- Confirmed failures are added to the offline golden dataset.
- PII handling and vendor data agreements are reviewed before enabling judging.