Lesson deck
LangSmith: tracing, datasets and evaluation flashcards
Reviewing needs JavaScript. You can read every card in the list below.
Loading your cards...
Back to the lesson16 cards in this deck
Read all 16 cards as a list
- Front
- Run, trace, thread, project?
- Back
- Run: one unit of work (a model call, a retrieval, a tool), like an OpenTelemetry span. Trace: the runs for one operation. Thread: traces of one conversation, grouped by a thread_id metadata key. Project: the container for one application's traces.
- Front
- How is tracing enabled for LangChain and LangGraph code?
- Back
- Environment variables: LANGSMITH_TRACING=true and LANGSMITH_API_KEY, with an optional LANGSMITH_PROJECT (default project name is default). Plain code uses a decorator or context manager.
- Front
- What do you add to every trace from day one?
- Back
- Tags and metadata: app version, model, prompt version, tenant, environment, and a thread id for conversations. Without them you cannot filter by version when a release goes wrong.
- Front
- Why do traces go missing in a serverless function?
- Back
- Tracing sends from a background thread and the process can exit first. Wait for tracers in a finally block, or make callbacks synchronous.
- Front
- How do you keep personal data out of traces?
- Back
- Redact before sending: flags that hide inputs or outputs, an anonymizer with regex rules or a function, or per-function processing. Decide region and retention too.
- Front
- The five-step method for debugging from a trace?
- Back
- Find the trace; read top down for the slow, costly or wrong run; check that run's exact inputs; classify the cause; reproduce, fix, and add the case to a dataset.
- Front
- How does a one-off failure become a permanent test?
- Back
- Add the failing trace to a dataset with the correct answer as a reference, so every later experiment runs it.
- Front
- Dataset, example, split, experiment?
- Back
- Dataset: a collection of examples. Example: inputs plus an optional reference output and metadata. Split: a named subset (an example can be in several). Experiment: one application version evaluated on a dataset.
- Front
- Who sees a reference output?
- Back
- Only evaluators. It is never passed to the application under test.
- Front
- Which evaluator type for what?
- Back
- Code: format, schema, exact match, thresholds. LLM judge: helpfulness, groundedness, tone (calibrate it). Human: ground truth and judge calibration. Pairwise: compare two versions when absolute scores are noisy.
- Front
- What extra should you score for an agent?
- Back
- The trajectory: right tools, right order, no redundant calls, within the step budget. A correct answer reached wastefully still has a problem.
- Front
- Offline versus online evaluation?
- Back
- Offline: curated datasets before release, with reference outputs. Online: sampled live runs and threads, with no reference outputs, so only reference-free checks such as format or groundedness.
- Front
- How do you make an evaluation score trustworthy?
- Back
- Calibrate the judge on human labels; compare versions on the same examples and look at slices; repeat runs for non-determinism; keep a hold-out set; watch for metric gaming; track cost and latency too.
- Front
- The judge says v2 is +6 points but users complain. What do you check?
- Back
- Judge bias (longer answers), the dataset not matching real questions, a slice that got worse, judge calibration, format versus usefulness. Compare length-controlled, sample recent production questions, read failures.
- Front
- What is an automation rule?
- Back
- An item type (runs or threads), a filter, a sampling rate and an action: annotation queue, dataset, webhook, online evaluator, code evaluator or extended retention. It can be backfilled to older runs.
- Front
- What does a good release gate require?
- Back
- An experiment on a pinned dataset version that beats the baseline with no slice worse, then a gradual release watched by online evaluators.