learn-langchain-with-phoebe / Builder session 10 of 10
Learn LangChain with Phoebe · Builder track · Session 10 of 10

LangSmith: trace, eval, ship

The graduation session. For nine sessions you judged DataDesk by vibes - tonight you turn on x-ray vision with two environment variables, replace vibes with an eval suite, and look honestly at the shipping options. Then you re-read the sentence you wrote in b1 about whether the framework is worth it - this time with numbers.

🔴 Builder track Practitioners: DA · DE · DS · engineers Python 3.10+ · free LangSmith account + API key 45 min
0-3 · Where we are 3-18 · Trace · eval · ship 18-43 · Build-along: DataDesk graduates 43-45 · Q&A
Part 0

Where DataDesk stands

DataDesk is a team now: analyst, checker and writer under a supervisor, on a persistent graph with approval gates and cited retrieval. What it does not have is proof. You cannot see inside a run without print statements, and "it seems better" is your entire quality methodology. Tonight fixes both - and closes the loop this track opened in b1.

Live - presented in session Self-study - read after class ★ Try it now prompt Official docs + Academy covered
★ What you walk out with today Full traces of every DataDesk run (zero code changes), a 15-question golden dataset, an eval suite with an exact-match evaluator and an LLM-as-judge, a clear map of OSS self-run vs LangSmith Deployment, and your b1 framework verdict rewritten with evidence.
Part 1 · covers the LangSmith observability quickstart

See everything 5 min live

Debugging an agent with print statements is archaeology. Tracing is the live feed: every model call, every tool call, every token and millisecond, nested exactly as they happened - and for LangChain/LangGraph apps it costs two environment variables.

LiveTracing in two env vars - zero code changes3 min

Because DataDesk is built on LangChain and LangGraph, the framework already emits structured run data. LangSmith just needs to know where to send it:

★ The entire integrationexport LANGSMITH_TRACING=true export LANGSMITH_API_KEY="lsv2_..." # from smith.langchain.com settings # then run DataDesk exactly as before - not one line of code changes. python datadesk.py

Open the project at smith.langchain.com and every run is a collapsible tree:

  • Every model call - full prompt in, full response out, per-call token counts and cost.
  • Every tool call - arguments and returns, so "why did it retrieve THAT chunk?" is a click, not a guess.
  • Latency per step - the waterfall shows exactly where a slow run spent its time.
  • The multi-agent tree - supervisor → analyst → checker → writer as nested spans; b9's cascade experiment becomes literally visible.
Privacy note, said plainly Tracing sends prompts and outputs to LangSmith's cloud. For the fully-local Ollama path with sensitive data, decide deliberately: trace a synthetic-data project, self-host LangSmith (Enterprise), or leave tracing off for that workload. Seeing everything cuts both ways.
LiveFree-tier reality check2 min

The Developer tier is genuinely free: $0, 5,000 traces per month, 14-day retention, one seat. For a team pilot of DataDesk - tens of runs a day - that is comfortable headroom. Paid tiers add seats, longer retention, higher volumes and the deployment features in Part 3.

WhatDeveloper (free)When you outgrow it
Price$0Per-seat + usage pricing above
Traces5k / monthA busy production app in days
Retention14 daysAudit or compliance needs longer
Seats1The moment a teammate asks "can I see?"

Numbers as of 2026-07 - re-check the pricing page before you present this to anyone with a budget.

Self-study@traceable + the business model, seen clearly2 min read

Non-framework code: your plain Python functions (a pandas cleanup step, a custom API call) do not auto-trace. Decorate them with @traceable from the langsmith package and they appear in the same tree, nested where they ran. Your whole pipeline, not just the LLM parts, becomes one waterfall.

The business model, now visible: b1 told you "frameworks free, trust layer paid" - tonight you see the mechanics. LangChain and LangGraph are MIT and always will be; the moment you NEED to see inside a production agent - and you will - the tool that shows you is the product. That is not a criticism, it is the deal, and you should walk into it with open eyes: the free tier is real, and so is the gravity.

Part 2 · covers the LangSmith evaluation quickstart + openevals

From vibes to numbers 6 min live

"It seems better after my change" is how agent projects die. An eval suite is 15 real questions with known-good answers, scored automatically on every change. It is unit testing for behavior - and it is the single highest-leverage habit this track can leave you with.

Golden dataset 15 real Qs + answers Experiment evaluate(target, ...) Scores exact match + judge Fix + re-run compare experiments Regression gate habit: no merge without an eval run The dataset grows forever: every production miss becomes a test case.
🔍 Click to zoom - the eval loop: dataset → experiment → scores → fix → re-run
LiveDatasets + evaluate() - unit tests for behavior3 min

Three pieces: a dataset (inputs + reference outputs, curated from questions people actually asked DataDesk), a target function (your agent, wrapped), and evaluators (functions that score each output). client.evaluate(...) runs the whole grid and posts an experiment you can compare against every previous one.

  • Curate from reality: your best test questions are the ones DataDesk already got wrong - b8's "not in the docs" probes, b9's poisoned CSV. Every production miss becomes a dataset row.
  • 15 is enough to start. A small suite you run on every change beats a grand one you run never.
  • Experiments diff: change the model, a prompt, a chunk size - the experiment view shows exactly which questions improved and which regressed. That is the "regression gate" your team can actually enforce.
LiveLLM-as-judge via openevals - scoring at scale3 min

Exact match works for "how many rows?" but not for the writer's COO summary - correct answers phrased a thousand ways. An LLM-as-judge evaluator hands the question, the reference and the agent's answer to a model with a grading rubric. The openevals package ships prebuilt ones - CORRECTNESS_PROMPT is the workhorse.

  • Judge choice matters: use a strong model as judge even if the agent runs on the cheap one - a weak judge grades noise.
  • Spot-check the judge: read 5 of its verdicts yourself before trusting 500. Judges have biases (verbosity, agreeableness); calibrate once, then scale.
  • Two evaluators beat one: exact match for the factual rows, judge for the prose rows - Demo 2 wires both.
Self-studyOnline evals, pairwise, and the regression-gate habit2 min read

Online evals run evaluators on sampled LIVE traffic - catching drift your golden dataset has not learned yet (new question types, a changed upstream doc). Pairwise experiments show a judge two versions' answers side by side and ask which is better - often more reliable than absolute scores for prose.

The habit that outlives this course: treat the eval suite like CI. No prompt change, model swap, or chunk-size tweak merges without an eval run attached. Teams that adopt this bore their stakeholders with steady numbers; teams that skip it entertain everyone with incidents.

Part 3 · covers LangSmith Deployment (ex "LangGraph Platform")

Shipping options 4 min live

DataDesk runs on your laptop. Shipping it to the team means choosing a lane: run the open-source stack on your own infra for free, or pay for LangSmith Deployment to host it. Know both lanes AND both names - "LangGraph Platform" was renamed "LangSmith Deployment" in late 2025, and the old name still dominates search results.

Lane 1 · your infra (OSS) $0 in licenses - MIT all the way down you run: the graph, Postgres for checkpoints, an API wrapper (FastAPI), queues, retries, scaling, auth you own: everything - including 3am fits: platform teams with infra muscle, strict data-residency requirements Lane 2 · LangSmith Deployment managed - the renamed "LangGraph Platform" you get: agent server (API from your graph), assistants (configured agent versions), Studio (visual debugger on live runs) plus: queues, persistence, scaling handled fits: teams who want to ship the agent, not build an agent-hosting platform Enterprise tier adds hybrid + fully self-hosted deployment - regulated-industry lanes exist.
🔍 Click to zoom - shipping lanes: OSS self-run vs managed LangSmith Deployment
LiveChoosing a lane without religion2 min

The honest framing: everything you built in b1-b9 runs anywhere Python runs - the OSS lane is real, not a demo tier. What LangSmith Deployment sells is the platform work you would otherwise build around it: an agent server exposing your graph as an API, assistants (versioned configurations of one graph - prompts and models tuned per use case without redeploying), and Studio, the visual debugger for stepping through live graph runs.

  • Pilot for a five-person data team? OSS lane: your graph + Postgres checkpointer + FastAPI is an afternoon (you own patching it).
  • Org-wide with SLAs and no platform team? The managed lane earns its bill fast.
  • Regulated industry? Hybrid and fully self-hosted deployment exist at the Enterprise tier - data plane on your metal, control plane theirs, or everything yours.
  • Search-result decoder: anything titled "LangGraph Platform" or "LangGraph Studio" is the same product family pre-rename - read on, mentally substituting the new names.
Self-studyWhat production needs beyond deploy2 min read

Deployment is where this course stops, not where production ends. Still ahead of a real rollout: monitoring dashboards and alerting on live traffic, online evals as drift detection, cost budgets and rate limits per user, access control, and an incident playbook for when the agent is confidently wrong in public. The free Academy courses on observability and monitoring production agents are the natural next step - you now have every prerequisite they assume, and DataDesk is a better lab than their examples.

Demo 1 of 2

Turn the lights on ★ 10 min · everyone builds

Two env vars, three queries, and nine sessions of guessing what DataDesk does become a waterfall you can read.

Create the free account at smith.langchain.com, generate an API key, and export the two env vars from Part 1. Nothing else changes - pip install langsmith if it is not already present as a dependency.

Run three DataDesk queries you know well: a pure CSV question, a wiki question from b8, and the full b9 team request ("analyze march.csv and draft a COO summary").

Open the project and read the multi-agent trace as a tree: supervisor → analyst (watch its tool calls) → checker → writer. Every prompt, every return value, expandable.

Find the slowest step in the waterfall and the total token cost of the b9 run. Say the number out loud - this is the multi-agent price tag from the honest gate, now in dollars.

Find the checker catching the bad number (re-run the b9 cascade experiment if needed). The fix you built blind is now a visible span with the wrong value in its input and the bounce in its output.

Ollama path note Local runs trace too - LangSmith records whatever the framework saw, regardless of engine. ChatOllama reports no token-usage metadata, so cost columns stay empty on the local path; latency and structure still show in full.
Demo 2 of 2

DataDesk graduates ★ 12 min · build your own

Build the golden dataset, wire two evaluators, run the first experiment - and settle the b1 question with evidence.

Curate 15 questions from your real DataDesk usage this course: 8 factual (CSV stats, wiki definitions - exact expected answers), 4 grounding probes ("not in the docs" cases), 3 prose (summary requests with reference summaries).

Create the dataset and run the script below: one exact-match evaluator for the factual rows, one LLM-as-judge for correctness.

Read the experiment in the UI: score per question, judge reasoning attached, total cost. Find your worst question and read its full trace - score and diagnosis, one click apart.

Revisit your b1 sentence: "for DataDesk, the framework is/is not worth it because...". Rewrite it with tonight's numbers - accuracy on 15 real questions, cost per run, the checker's saves. That sentence is now a design-review answer.

Graduation checklist, out loud: persistence ✓ (b6) · approval gates ✓ (b7) · grounded RAG ✓ (b8) · team + checker ✓ (b9) · traces + evals ✓ (tonight). DataDesk is no longer a course exercise - it is a system you can defend.

★ evals.py - the graduation suitefrom langsmith import Client from openevals.llm import create_llm_as_judge from openevals.prompts import CORRECTNESS_PROMPT client = Client() # one-time: create the dataset (or build it in the UI) ds = client.create_dataset("datadesk-golden-15") client.create_examples(dataset_id=ds.id, examples=[ {"inputs": {"question": "How many rows does march.csv have?"}, "outputs": {"answer": "1,204 rows"}}, # ... your other 14, curated from real usage ]) def target(inputs: dict) -> dict: result = team.invoke({"messages": [{"role": "user", "content": inputs["question"]}]}) return {"answer": result["messages"][-1].content} def exact_match(outputs: dict, reference_outputs: dict) -> bool: return reference_outputs["answer"].strip().lower() in outputs["answer"].lower() correctness = create_llm_as_judge( prompt=CORRECTNESS_PROMPT, model="anthropic:claude-haiku-4-5-20251001", # strong judge, always feedback_key="correctness") client.evaluate(target, data="datadesk-golden-15", evaluators=[exact_match, correctness], experiment_prefix="datadesk-b10-baseline")
Real world

The experiment that ended a meeting. A data team argued for three weeks about whether the cheap model was "good enough" for their assistant. One golden dataset and two experiments later: 93% vs 89% on their real questions, at a quarter of the cost. The argument died in an afternoon - not because anyone won, but because the question finally had a unit.

Homework

Try it yourself - this week ◐ 45-60 min total

Source material

Official sources covered

This track teaches from the official docs and the free LangChain Academy curricula (login required for lesson content; certificates stay with the Academy - all free). This page covers:

LangSmith observability quickstartPart 1 + Demo 1 · env-var tracing, trace anatomy, @traceable for non-framework code
LangSmith evaluation quickstart + openevalsPart 2 + Demo 2 · datasets, evaluate(), custom evaluators, prebuilt LLM-as-judge (CORRECTNESS_PROMPT)
Academy: LangSmith EssentialsTracing + dataset + experiment workflow covered end to end on DataDesk instead of the course's demo app
Academy: Building Reliable AgentsThe eval-first mindset and regression gate · full course depth (agent-specific eval design) stays with the Academy
LangSmith pricing + Deployment docsParts 1 + 3 · free-tier numbers, agent server / assistants / Studio, hybrid + self-hosted at Enterprise, the rename
Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · Turning on full tracing for a LangChain/LangGraph app requires...

The framework already emits structured run data; the env vars just route it. @traceable exists for NON-framework code you want in the same tree. Deployment is a separate, optional product.

2 · The regression-gate habit means...

Evals as CI: a small suite of real questions, run on every change, compared against the last experiment. Online evals on live traffic exist too - but the gate is the habit that prevents regressions from shipping.

3 · A 2025 blog post raves about "LangGraph Platform". You know that...

Renamed late 2025, and the old name still owns the search results. Same product family: managed hosting for your graphs, alongside the always-available OSS self-run lane.

Builder session 10 cheat sheet · pin this

Tracing onLANGSMITH_TRACING=true + LANGSMITH_API_KEY. Zero code changes for framework apps; @traceable for the rest.
Free tier$0 · 5k traces/mo · 14-day retention · 1 seat. Real headroom for a pilot; re-check pricing before budget talks.
Eval loopGolden dataset (15 real Qs) → evaluate() experiment → scores → fix → re-run. Every production miss becomes a row.
evaluate() shapeclient.evaluate(target, data="dataset-name", evaluators=[...], experiment_prefix=...). Diff experiments in the UI.
LLM-as-judgeopenevals create_llm_as_judge + CORRECTNESS_PROMPT. Strong judge always; spot-check 5 verdicts before trusting 500.
Shipping lanesOSS self-run (free, you own ops) vs LangSmith Deployment - ex "LangGraph Platform" - (agent server, assistants, Studio). Enterprise adds hybrid/self-hosted.
Regression gateNo merge without an eval run. Evals are CI for behavior - the habit that outlives this course.
GraduationDataDesk: persistence ✓ gates ✓ RAG ✓ team+checker ✓ evals ✓. Your b1 sentence now has numbers behind it.