groundy
Agents & Frameworks

How to Wire Agent Evals in LangSmith: What evaluate() Requires

LangChain docs require runnables for evaluate() and exact key matching. Vendor pages detail GCP storage and residency options. Third-party pricing claims need verification.

Published Updated 5 references
A blocky translucent green resin dinosaur steps through a resin hoop, its three-lobed front foot fitting a matching recess in a yellow tile. Bubbles, seams and a long shadow mark the warm ivory scene.
On this page7 sections

LangChain’s official docs state two requirements for wiring a first eval harness in LangSmith, and only two: pass a LangChain runnable directly into evaluate() or aevaluate(), and make every example input’s keys exactly match the chain’s input variables. Those two rules decide more than syntax. Everything the docs name as an eval target is a runnable, so the rules also decide which layers of your agent stack you can evaluate at all. If you read a concept primer and stalled somewhere between “evals are good” and a running pipeline, the wiring gap is smaller than it looks; the harder question is choosing the object to hand over.

On November 16, Vercel published Agents are users, so your software needs evals, arguing that the software an agent calls, the API, CLI, or MCP server, needs evals of its own. It is a vendor argument: the post closes by pointing to Vercel’s own AI Gateway, Sandbox, and storage products as the place to build them. Read it as framing rather than a measured result, but it is a useful stress test for the wiring rules below, because most of what it asks to be evaluated has no runnable boundary in LangSmith.

What evaluate() actually requires

The core contract comes from LangChain’s docs page on evaluating a runnable:

langchain Runnable objects (such as chat models, retrievers, chains, etc.) can be passed directly into evaluate() / aevaluate().

That sentence does real work. Your eval target does not need to be wrapped in an adapter, converted to a custom function, or rebuilt for the harness. A chat model, a retriever, a chain: any of these is a runnable, and any runnable goes straight into the call. The async variant, aevaluate(), takes the same shape. For a team with an existing LangChain agent, the harness’s entry point is the object you already have.

The second requirement is the one that bites in practice, and the docs state it just as directly:

Note that the input variables of the chain must match the keys of the example inputs. In this case, the example inputs should have the form {“text”: ”…”}.

Every example in your dataset is a dict. The keys of that dict must be exactly the input variable names your chain expects. If your chain takes a variable called text and your dataset rows use question or input, the harness cannot wire them together. This is not a validation warning the library will necessarily surface helpfully; it is a structural contract. Rename the chain’s variables or reshape the dataset, but one side has to move. The same page adds that “The runnable is traced appropriately for each output,” which is why a component-level experiment doubles as a trace-inspection session.

A practical checklist for a first harness reduces to this: pick the runnable you want to grade, build a small dataset whose example inputs use that runnable’s exact input variable names as keys, and call evaluate() (or aevaluate()) with both. Everything else, evaluators, experiment naming, feedback, is layered on top of a loop that already runs.

Which layers you can point evaluate() at

The docs sentence names three targets plus an “etc.”, and the page carries one more section. Written out as an inventory, the missing row is where the design work actually lives.

Layer under testWiring the fetched docs supportStatus
Chat modelNamed in the runnable list; passes directly into evaluate() / aevaluate()Vendor-doc-sourced
RetrieverSame sentence, same listVendor-doc-sourced
ChainSame sentence; input-key matching stated for chains, example form {"text": "..."}Vendor-doc-sourced
LangGraph graphDedicated section on the same page, “How to evaluate a langgraph graph”; the fetched text includes the heading, not its contentsVendor-doc-sourced, heading only
Plain HTTP API, CLI, or MCP server your agent callsNot named on the page; no documented evaluate() pathGap; see below

For the last row, the documented contract accepts runnables, so a bare endpoint has no place in evaluate() until someone gives it one. The obvious route is to wrap the API as a LangChain tool or a small chain and evaluate the wrapper. That is an inference from the shape of the contract, not a documented behavior, and it carries a caveat worth stating plainly: the wrapper is now the thing under test, and the binding between wrapper and real API is your own code. Whether LangSmith can evaluate surfaces beyond runnables through some other documented path is not answered by the pages cited here; treat that as an open question rather than a settled no.

LangSmith’s tracing is broader than its eval harness. The observability page says tracing covers the OpenAI SDK, Anthropic SDK, Vercel AI SDK, LlamaIndex, custom implementations, and OpenTelemetry. But the same page separates the products, answering its own question “Can I use LangSmith Observability without LangSmith Evaluation?” with “Yes. Observability and Evaluation work well together but don’t require each other.” Broad tracing does not widen what evaluate() ingests; it widens what you can watch.

What the agents-as-users argument makes testable

Vercel’s post states its claim in one sentence:

Agents are now users of software, doing work on people’s behalf. Whether you’re building the agent or the software it uses (API, CLI, MCP server, SDK), evals give you a way to measure how well that work gets done.

The post walks agents through a human’s funnel, Discovery, Selection, Access, and Success, and focuses on Success. Its structural proposal is a testing pyramid sorted by LLM calls:

We group agentic software tests by how many LLM calls they typically need: deterministic tests (0), one-turn evals (1), and E2E evals (2+ across a whole task).

Mapped against the LangChain contract, the three tiers fare very differently.

Deterministic tests are ordinary software tests. Vercel’s examples for its coffee-shop CLI are that search “returns only Mission cafes that serve lattes,” that “quote adds tax and tip correctly,” and that “order charges exactly the quoted total.” No LLM is involved, and the post’s guidance is to “start with the problem you want to catch and pick the lowest tier that can catch it.” Nothing in the fetched LangChain docs routes a bare API into evaluate(). This tier belongs in CI with conventional tests; pushing it through an LLM harness adds cost without adding information.

One-turn evals are where the two vendors converge. A one-turn eval checks a single decision: does the agent run a quote before ordering, does it try another cafe when told there is no ice. In LangSmith terms the decision-maker is a model or chain, which is a runnable, with examples keyed to its input variables. This is the tier the wiring rules above were built for.

E2E evals are where the LangChain docs stop. Vercel defines the tier plainly: “An E2E eval lets the agent work through the whole task in an environment, then checks whether the final result meets the user’s requirements.” Its demonstration uses Harbor, an open-source framework from the creators of Terminal-Bench that “runs agents in containers, checks results, and records their actions,” with a verifier that scores the order the agent actually placed, checking drink, pickup time, and budget separately and passing the trial only if every constraint holds. The closest object on the LangSmith side is the LangGraph graph, which gets its own docs section; a whole agent working in a container against external state is not a shape the fetched page describes. Whether a LangSmith evaluator can read arbitrary external state, a database row, a charge, a file the agent wrote, is not settled by any page cited here.

The motivating failure is also the sharpest limit on component evals. In Vercel’s example, “An agent can place a “successful” order for a hot latte when the user asked for an iced one. The request worked, so the logs in your Observability stack look fine.” On multi-step tasks, “Each one can look reasonable on its own, and the agent can still get the wrong outcome.” Passing experiments on your model, retriever, and chain establish that each runnable behaved. They do not establish that the task came out right, and they say nothing about the funnel stages before Success, which are product-surface concerns, docs, MCP servers, skills, rather than eval-harness concerns.

The consequence is a shift in where the burden of eval design sits. Inside LangSmith, the unit of design is the component runnable you can name and key-match. The outer software, the API the agent calls and the end-to-end sequence that spans it, either gets wrapped into a runnable boundary someone maintains, or gets its tests somewhere else. A stack can carry dozens of passing LangSmith experiments and still contain the exact failure Vercel describes, because the layers where it happens have no runnable boundary at all.

What to check when a run produces nothing

The input-schema rule is the first thing to check when a run produces nothing: a key mismatch means the example data and the chain never connect. Whether the mismatch surfaces as a clear error or a confusing one is an inference from the matching rule rather than a documented behavior, so treat it as the likeliest place to look, not a known bug.

If your eval target is a LangGraph graph rather than a chain, the same runnable-evaluation page has the section for it. The input-key matching rule is stated for chains; start from that section rather than assuming the chain instructions transfer unchanged.

Where your traces live

Before standardizing on LangSmith, the hosting decision deserves more attention than the API does, because LangChain’s own pages are in mild tension about it. The LangSmith platform page advertises “SaaS with data residency in the US, Europe, and APAC,” alongside bring-your-own-cloud and self-hosted deployment. The observability page is more specific about the default:

When using LangSmith hosted at smith.langchain.com, data is stored in GCP us-central-1. If you’re on the Enterprise plan, we can deliver LangSmith to run on your kubernetes cluster in AWS, GCP, or Azure so that data never leaves your environment.

Read together: regional residency exists as an option, but the default hosted service puts your traces, which contain your prompts, your retrieved context, and often your users’ inputs, in one Google Cloud region in the central United States. For a team under EU data-residency obligations, the default is not the right answer, and an EU option on a marketing page is not the same as knowing how to get an account provisioned there. Resolve this before your first production trace, not after.

Trace volume, retention, and the exit-cost math

LangChain states that LangSmith has a free tier for development and small-scale production, and that paid plans scale with trace volume. Trace volume is the cost dial: every run you trace, including every eval experiment, counts.

The specific numbers below come from a third-party guide, not from LangChain itself, and may be out of date. LangChain’s pricing page, not aggregated guides, is the source for these figures; verify each one there before budgeting against them:

Decision axisWhat the evidence saysConfidence
Eval target wiringLangChain runnables pass directly into evaluate()/aevaluate(); example-input keys must match the chain’s input variablesHigh: official docs
Default data locationGCP us-central-1 for hosted smith.langchain.comMedium: vendor page
Residency optionsUS/EU/APAC SaaS residency, bring-your-own-cloud, self-hosted Kubernetes (Enterprise, per the observability page)Medium: vendor pages in tension on the default
Free tierFree tier exists; third-party guide claims a Developer plan with 1 seat and 5,000 base traces per monthLow for specifics
RetentionThird-party guide claims 14-day base retention, 400-day extended, with automatic upgrade when a trace receives feedbackLow
ExportThird-party guide claims scheduled automatic trace exports without self-managed infrastructureLow
Tracing scopeOpenAI, Anthropic, Vercel AI SDK, LlamaIndex, custom, OpenTelemetryMedium: vendor page

The exit-cost question deserves a direct answer. If you adopt LangSmith, your datasets, traces, and feedback live in a vendor platform. The vendor states that it will not train on customer data and that customers own all rights to their data, which addresses ownership on paper. Ownership is not portability. Whether you can get your traces out in bulk, on a schedule, rests on the export claim from a single unverified third-party source. Confirm the current export mechanics yourself before standardizing; it is a cheap, bounded verification step.

Because LangSmith traces OpenAI SDK, Anthropic SDK, and Vercel AI SDK applications too, it can quietly become the observability layer for your whole stack, not just the LangChain parts. That is convenient, and it means switching later means re-instrumenting everything, not just swapping an eval harness.

LangChain also claims its SDK uses an async callback handler sending traces to a distributed collector, so application performance is never impacted and agents keep running if LangSmith has an incident. That is the vendor’s self-assessment. The architecture described is plausible and is the standard way to isolate tracing from the serving path, but “never impacts performance” is a marketing absolute; load-test it rather than adopt it.

Verdict

Wire the loop the way the docs describe: pass your runnable directly into evaluate() or aevaluate(), and make every example input’s keys match the chain’s input variables exactly. Those two rules are well-supported, and for most teams they are the entire blocker between reading about evals and running one. They also bound the claim you can make. Within LangSmith, the practical unit of eval design is the component runnable you can name: a model, a retriever, a chain, a graph.

The agents-as-users argument is a vendor framing, but the burden it identifies is real. The software around the agent needs evaluation, and in LangSmith it enters the harness only when someone wraps it as a runnable, at which point the wrapper is what you are grading. Deterministic API behavior belongs in ordinary CI, which is where Vercel’s own pyramid puts it. End-to-end task completion against an environment and an external-state verifier is demonstrated in that post with container-based tooling; the fetched LangChain docs offer a graph-evaluation section and no documented equivalent. State your coverage in layers accordingly: “our model and retriever are evaluated” matches what you wired, while “our agentic stack is evaluated” does not, until the layers without a runnable boundary have a test home somewhere.

Standardizing is a separate decision from getting a first harness running. I would run the harness on the free tier against workloads you can afford to re-run, and treat two things as homework before LangSmith becomes load-bearing: confirm where your account’s data actually resides given the default us-central-1 storage, and verify current pricing, retention windows, and export behavior against LangChain’s own pricing page and docs rather than any aggregated guide. If a lost trace history or a residency violation would be expensive for you, the hosting and export answers matter more than anything evaluate() does.

References

Follow the links in the article for context. The supporting material is collected here for further reading.

  1. LangChain docs page on evaluating a runnabledocs.langchain.comAccessed
  2. LangSmith platform pagelangchain.comAccessed
  3. LangSmith observability pagelangchain.comAccessed
  4. Third-party LangSmith guidearticsledge.comAccessed

Join the discussion

Share a useful perspective or ask a question about this article.

Discussion guidelinesComments privacy