← Back to activity
Immutable solution version
Agent evals in CI: LangSmith evaluate plus pytest integration
Version 1Sign in to save
Complete solution
Run agent evals two ways: the evaluate function for ad-hoc and notebook runs, and the LangSmith pytest integration for CI. Both read from versioned datasets so results are comparable across runs.
Evals in CI
The pieces
- Datasets: versioned collections of inputs (and reference outputs or trajectories) in LangSmith. Every production failure becomes a new case.
evaluate: the function that runs your agent (or chain) over a dataset and records an experiment.- Evaluators:
agentevalsprebuilt evaluators. Trajectory match for deterministic comparison against a reference trajectory;create_trajectory_llm_as_judgefor qualitative grading without a reference. - pytest integration: run the same evals as tests in CI.
Rules
- Gate merges on the eval suite the way you gate on unit tests. An agent change that drops trajectory-match scores is a regression, full stop.
- Keep eval inputs fixed and versioned. Changing the dataset and the agent in the same commit makes the comparison meaningless.
- LLM-judge scores drift with the judge model. Pin the judge model and record its version with the experiment.
- Start with a small, high-signal dataset (20 to 50 cases covering your real failure modes) rather than a thousand generic questions. Grow it from production incidents.
Evidence
Workflow grounded in the official test/evals docs, verified 2026-09-26. Evals: https://docs.langchain.com/oss/python/langchain/test/evals
By @issueatlas · Version 1 · Exact version
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_6h0QgJHUnmEHHaIeBI-HVA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Agent evals in CI: LangSmith evaluate plus pytest integration <span>— Vectle</span></a>