langchain-agent-experiments
БесплатноБез исполняемых скриптовНе проверенUse when testing an agent or LLM application offline in LangSmith before it ships, including building and maintaining evaluation datasets, writing the target…
от langchain-ai★ 1 369 звёзд на GitHubОб этом скилле
Test agents with LangSmith experiments
An experiment runs one version of an application over a dataset and scores each result with evaluators. It answers "is this version better than the last one, and where does it fail?" before a change ships.
The order matters: inspect real outputs, shape the dataset to match, write the target function, then evaluators. Most broken evaluations come from guessing the output shape.
Choose the harness
- Experiment with
evaluate(): the default for comparing versions of an application over a shared dataset, with results, comparisons, and evaluator feedback in LangSmith. - pytest or Vitest/Jest integration: when the checks belong next to the code as test cases with assertions, run in CI, and the team already reads test output. Results are still logged to LangSmith as experiments.
- Harbor task: when the agent must act in a controlled environment, such as
files, services, or a simulated user, and the verifier inspects the resulting
state. Use
langchain-eval-engineering. - Online evaluator: when the question is how live traffic behaves, not how
a candidate version compares. Use
langchain-agent-monitoring.
Inspect before you build
Run the application on a few representative inputs and read the traces
(langchain-agent-tracing covers finding them). Note the exact fields in the
root run's inputs and outputs, and where tool calls, retrieved documents, or
intermediate decisions appear. Framework output shapes vary; never assume one.
Build the dataset
Default to assertion-based reference outputs: short claims a correct answer
must or must not satisfy, stored as {"assertions": [{"key", "comment"}]} in
the example's outputs. Assertions survive harmless rewording, accept more than
one good answer, and give one score per claim, so a failure points at the
criterion that broke. Name keys after the claim (must_cite_source,
must_not_promise_refund) and keep each comment to one checkable sentence.
Where you can, phrase an assertion so code can decide it (an exact phrase,
field, link, or tool call) rather than one that needs a judge.
Use a different shape only when the check needs it:
- Exact answer: a single correct value, such as a label, number, or extracted field.
- Single step: the inputs and expected output of one model call, node, or tool. Tests a component in isolation.
- Trajectory: inputs and the expected tool calls. Tests the execution path.
- Retrieval: the chunks a question should retrieve or cite. Tests grounding.
- Conversation: for a multi-turn agent, either store the conversation so far and score the next reply, or store a scenario and let a simulated user (openevals) drive several turns, then score the whole conversation. The first is cheaper and repeatable; the second tests how the agent recovers.
Start from production traces when they exist: they hold the inputs users actually send. Keep the root runs worth testing and write what a correct answer must contain. Do not copy the recorded output as the reference; that turns today's mistakes into the expected answer. Reviewers can write assertions while reviewing runs in a single-run annotation queue, and Engine can propose them for recurring issues; both save to a dataset. Keep failure and edge cases, not only the happy path.
Create and maintain it with the CLI
Write the first version as a JSON array of {"inputs": {...}, "outputs": {...}}
objects and upload it. upload always creates a new dataset and reads only
inputs and outputs, so add metadata and splits afterward.
langsmith datasets upload ./dataset.json --name "support-agent-regression"
langsmith examples list --dataset "support-agent-regression" --format json
After that, change the dataset in place rather than uploading a new copy:
- Add:
langsmith examples create. - Edit:
langsmith examples updatereplaces each field it is given, so pass the full new value, such as every assertion, not just the one that changed. - Large edits: export with
langsmith datasets export, review the change, then apply it example by example. - Freeze a version: before comparing experiments across changes, tag it
with
langsmith datasets update-tagsand run experiments against that tag.
Use the SDK (Client.create_examples, Client.update_examples) when building
or editing the dataset from code. Every change creates a new dataset version,
so earlier experiments keep pointing at the examples they ran on. Never delete
and recreate a dataset to refresh it: deleting a dataset deletes its
experiments.
When test cases live in git, keep one LangSmith dataset per eval suite, not a copy per branch or developer; copies get different example IDs, so their experiments cannot be compared. Give each case a stable ID, derive the example ID from it, update examples in place, and record the branch and commit in experiment metadata. When several branches w
Установить langchain-agent-experiments в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл langchain-agent-experiments?
Use when testing an agent or LLM application offline in LangSmith before it ships, including building and maintaining evaluation datasets, writing the target function and evaluators, aligning LLM judges with human labels, running and comparing experiments, and diagnosing why an experiment scored badly.
Как установить скилл langchain-agent-experiments?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл langchain-agent-experiments запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic