diff --git a/src/docs.json b/src/docs.json
index 1943a5fdb0..62c77cdc57 100644
--- a/src/docs.json
+++ b/src/docs.json
@@ -1074,6 +1074,7 @@
{
"group": "Evaluation types",
"pages": [
+ "langsmith/evaluation-types",
"langsmith/code-evaluator",
"langsmith/llm-as-judge",
"langsmith/composite-evaluators",
@@ -1093,6 +1094,7 @@
{
"group": "Evaluation techniques",
"pages": [
+ "langsmith/experiment-configuration",
"langsmith/define-target-function",
"langsmith/evaluate-on-intermediate-steps",
"langsmith/multiple-scores",
diff --git a/src/langsmith/evaluation-concepts.mdx b/src/langsmith/evaluation-concepts.mdx
index 4f9dd8b235..aea88a8c06 100644
--- a/src/langsmith/evaluation-concepts.mdx
+++ b/src/langsmith/evaluation-concepts.mdx
@@ -1,240 +1,306 @@
---
-title: Evaluation Concepts
+title: Evaluation concepts
sidebarTitle: Concepts
---
-LangSmith makes building high-quality evaluations easy. This guide explains the key concepts of the LangSmith evaluation framework. The building blocks of the LangSmith framework are:
+LLM outputs are non-deterministic, which makes response quality hard to assess. Evaluations (evals) are a way to breakdown what "good" looks like and measure it. LangSmith Evaluation provides a framework for measuring quality throughout the application lifecycle, from pre-deployment testing to production monitoring.
-* [**Datasets**:](/langsmith/evaluation-concepts#datasets) Collections of test inputs and reference outputs.
-* [**Evaluators**](/langsmith/evaluation-concepts#evaluators): Functions for scoring outputs. These can be [online evaluators](/langsmith/evaluation-concepts#online-evaluation) that run on traces in real time or [offline evaluators](/langsmith/evaluation-concepts#offline-evaluation) that run on a dataset.
+## What to evaluate
-## Datasets
+Before building evaluations, identify what matters for your application. Break down your system into its critical components—LLM calls, retrieval steps, tool invocations, output formatting—and determine quality criteria for each.
-A dataset is a collection of examples used for evaluating an application. An example is a test input, reference output pair.
+**Start with manually curated examples.** Create 5-10 examples of what "good" looks like for each critical component. These examples serve as your ground truth and inform which evaluation approaches to use. For instance:
+- **RAG system**: Examples of good retrievals (relevant documents) and good answers (accurate, complete).
+- **Agent**: Examples of correct tool selection and proper argument formatting.
+- **Chatbot**: Examples of helpful, on-brand responses that address user intent.
-
+Once you've defined "good" through examples, you can measure how often your system produces similar quality outputs.
-### Examples
+## Offline and online evaluations
-Each example consists of:
+LangSmith supports two types of evaluations that serve different purposes in your development workflow:
-* **Inputs**: a dictionary of input variables to pass to your application.
-* **Reference outputs** (optional): a dictionary of reference outputs. These do not get passed to your application, they are only used in evaluators.
-* **Metadata** (optional): a dictionary of additional information that can be used to create filtered views of a dataset.
+### Offline evaluations
-
+ Use offline evaluations for **pre-deployment testing**:
+- **Benchmarking**: Compare multiple versions to find the best performer.
+- **Regression testing**: Ensure new versions don't degrade quality.
+- **Unit testing**: Verify correctness of individual components.
+- **Backtesting**: Test new versions against historical data.
-### Dataset curation
+Offline evaluations target [_examples_](#examples) from [_datasets_](#datasets)—curated test cases with reference outputs that define what "good" looks like.
-There are various ways to build datasets for evaluation, including:
+### Online evaluations
-#### Manually curated examples
+ Use online evaluations for **production monitoring**:
+- **Real-time monitoring**: Track quality continuously on live traffic.
+- **Anomaly detection**: Flag unusual patterns or edge cases.
+- **Production feedback**: Identify issues to add to offline datasets.
-This is how we typically recommend people get started creating datasets. From building your application, you probably have some idea of what types of inputs you expect your application to be able to handle, and what "good" responses may be. You probably want to cover a few different common edge cases or situations you can imagine. Even 10-20 high-quality, manually-curated examples can go a long way.
+Online evaluations target [_runs_](#runs) and [_threads_](#threads) from [tracing](/langsmith/observability-quickstart)—real production traces without reference outputs.
-#### Historical traces
+This difference in targets determines what you can evaluate: offline evaluations can check correctness against expected answers, while online evaluations focus on quality patterns, safety, and real-world behavior.
-Once you have an application in production, you start getting valuable information: how are users actually using it? These real-world runs make for great examples because they're, well, the most realistic!
+## Evaluation lifecycle
-If you're getting a lot of traffic, how can you determine which runs are valuable to add to a dataset? There are a few techniques you can use:
+As you develop and [deploy your application](/langsmith/deployments), your evaluation strategy evolves from pre-deployment testing to production monitoring. LLM applications progress through distinct phases, each requiring different evaluation approaches. During development and testing, offline evaluations validate functionality against curated datasets. After deployment, online evaluations monitor production behavior on live traffic. As applications mature, both evaluation types work together in an iterative feedback loop to improve quality continuously.
-* **User feedback**: If possible - try to collect end user feedback. You can then see which datapoints got negative feedback. That is super valuable! These are spots where your application did not perform well. You should add these to your dataset to test against in the future.
-* **Heuristics**: You can also use other heuristics to identify "interesting" datapoints. For example, runs that took a long time to complete could be interesting to look at and add to a dataset.
-* **LLM feedback**: You can use another LLM to detect noteworthy runs. For example, you could use an LLM to label chatbot conversations where the user had to rephrase their question or correct the model in some way, indicating the chatbot did not initially respond correctly.
+```mermaid
+graph LR
+ A[Development] --> B[Testing]
+ B --> C[Deployment]
+ C --> D[Monitoring]
+ D --> E[Iteration]
-#### Synthetic data
+ A -.-> F[Offline]
+ B -.-> F
+ C -.-> G[Online]
+ D -.-> G
+ E -.-> H[Both]
-Once you have a few examples, you can try to artificially generate some more. It's generally advised to have a few good hand-crafted examples before this, as this synthetic data will often resemble them in some way. This can be a useful way to get a lot of datapoints, quickly.
+ style F fill:#8b5cf6,stroke:#7c3aed,color:#fff
+ style G fill:#8b5cf6,stroke:#7c3aed,color:#fff
+ style H fill:#8b5cf6,stroke:#7c3aed,color:#fff
+```
-### Splits
+### 1. Development with offline evaluation
-When setting up your evaluation, you may want to partition your dataset into different splits. For example, you might use a smaller split for many rapid and cheap iterations and a larger split for your final evaluation. In addition, splits can be important for the interpretability of your experiments. For example, if you have a RAG application, you may want your dataset splits to focus on different types of questions (e.g., factual, opinion, etc) and to evaluate your application on each split separately.
+Before production deployment, use offline evaluations to validate functionality, benchmark different approaches, and build confidence.
-Learn how to [create and manage dataset splits](/langsmith/manage-datasets-in-application#create-and-manage-dataset-splits).
+Follow the [quickstart](/langsmith/evaluation-quickstart) to run your first offline evaluation.
-### Versions
+### 2. Initial deployment with online evaluation
-Datasets are [versioned](/langsmith/manage-datasets#version-a-dataset) such that every time you add, update, or delete examples in your dataset, a new version of the dataset is created. This makes it easy to inspect and revert changes to your dataset in case you make a mistake. You can also [tag versions](/langsmith/manage-datasets#tag-a-version) of your dataset to give them a more human-readable name. This can be useful for marking important milestones in your dataset's history.
+After deployment, use online evaluations to monitor production quality, detect unexpected issues, and collect real-world data.
-You can run evaluations on specific versions of a dataset. This can be useful when running evaluations in CI, to make sure that a dataset update doesn't accidentally break your CI pipelines.
+Learn how to [configure online evaluations](/langsmith/online-evaluations) for production monitoring.
-## Evaluators
+### 3. Continuous improvement
-Evaluators are functions that score how well your application performs on a particular example.
+Use both evaluation types together in an iterative feedback loop. Online evaluations surface issues that become offline test cases, offline evaluations validate fixes, and online evaluations confirm production improvements.
-#### Evaluator inputs
+## Core evaluation targets
-Evaluators receive these inputs:
+Evaluations run on different targets depending on whether they are offline or online. Understanding these targets is essential for choosing the right evaluation approach.
-* [Example](/langsmith/evaluation-concepts#examples): The example(s) from your [Dataset](/langsmith/evaluation-concepts#datasets). Contains inputs, (reference) outputs, and metadata.
-* [Run](/langsmith/observability-concepts#runs): The actual outputs and intermediate steps (child runs) from passing the example inputs to the application.
+### Targets for offline evaluation
-#### Evaluator outputs
+Offline evaluations run on datasets and examples. The presence of reference outputs enables comparison between expected and actual results.
-An evaluator returns one or more metrics. These should be returned as a dictionary or list of dictionaries of the form:
+#### Datasets
-* `key`: The name of the metric.
-* `score` | `value`: The value of the metric. Use `score` if it's a numerical metric and `value` if it's categorical.
-* `comment` (optional): The reasoning or additional string information justifying the score.
+A dataset is a _collection of examples_ used for evaluating an application. An example is a test input, reference output pair.
-#### Defining evaluators
+
-There are a number of ways to define and run evaluators:
+#### Examples
-* **Custom code**: Define [custom evaluators](/langsmith/code-evaluator) as Python or TypeScript functions and run them client-side using the SDKs or server-side via the UI.
-* **Built-in evaluators**: LangSmith has a number of built-in evaluators that you can configure and run via the UI.
+Each example consists of:
-You can run evaluators using the LangSmith SDK ([Python](https://docs.smith.langchain.com/reference/python/reference) and [TypeScript](https://docs.smith.langchain.com/reference/js)), via the [Prompt Playground](/langsmith/observability-concepts#prompt-playground), or by configuring [Rules](/langsmith/rules) to automatically run them on particular tracing projects or datasets.
+- **Inputs**: a dictionary of input variables to pass to your application.
+- **Reference outputs** (optional): a dictionary of reference outputs. These do not get passed to your application, they are only used in evaluators.
+- **Metadata** (optional): a dictionary of additional information that can be used to create filtered views of a dataset.
-#### Evaluation techniques
+
-There are a few high-level approaches to LLM evaluation:
+Learn more about [managing datasets](/langsmith/manage-datasets).
-### Human
+### Targets for online evaluation
-Human evaluation is [often a great starting point for evaluation](https://hamel.dev/blog/posts/evals/#looking-at-your-traces). LangSmith makes it easy to review your LLM application outputs as well as the traces (all intermediate steps).
+Online evaluations run on runs and threads from production traffic. Without reference outputs, evaluators focus on detecting issues, anomalies, and quality degradation in real-time.
-LangSmith's [annotation queues](/langsmith/evaluation-concepts#annotation-queues) make it easy to get human feedback on your application's outputs.
+#### Runs
-### Heuristic
+A _run_ is a single execution trace from your [deployed application](/langsmith/deployments). Each run contains:
+- **Inputs**: The actual user inputs your application received.
+- **Outputs**: What your application actually returned.
+- **Intermediate steps**: All the child runs (tool calls, LLM calls, and so on).
+- **Metadata**: Tags, user feedback, latency metrics, etc.
-Heuristic evaluators are deterministic, rule-based functions. These are good for simple checks like making sure that a chatbot's response isn't empty, that a snippet of generated code can be compiled, or that a classification is exactly correct.
+Unlike examples in datasets, runs do not include reference outputs. Online evaluators must assess quality without knowing what the "correct" answer should be, relying instead on quality heuristics, safety checks, and reference-free evaluation techniques.
-### LLM-as-judge
+Learn more about [runs and traces in the Observability concepts](/langsmith/observability-concepts#runs).
-LLM-as-judge evaluators use LLMs to score the application's output. To use them, you typically encode the grading rules / criteria in the LLM prompt. They can be reference-free (e.g., check if system output contains offensive content or adheres to specific criteria). Or, they can compare task output to a reference output (e.g., check if the output is factually accurate relative to the reference).
+#### Threads
-With LLM-as-judge evaluators, it is important to carefully review the resulting scores and tune the grader prompt if needed. Often it is helpful to write these as few-shot evaluators, where you provide examples of inputs, outputs, and expected grades as part of the grader prompt.
+_Threads_ are collections of related runs representing multi-turn conversations. Online evaluators can run at the thread level to evaluate entire conversations rather than individual turns. This enables assessment of conversation-level properties like coherence across turns, topic maintenance, and user satisfaction throughout an interaction.
-Learn about [how to define an LLM-as-a-judge evaluator](/langsmith/llm-as-judge).
+## Evaluators
-### Pairwise
+_Evaluators_ are functions that score application performance. They provide the measurement layer for both offline and online evaluation, adapting their inputs based on what data is available.
-Pairwise evaluators allow you to compare the outputs of two versions of an application. This can use either a heuristic ("which response is longer"), an LLM (with a specific pairwise prompt), or human (asking them to manually annotate examples).
+### Defining and running evaluators
-**When should you use pairwise evaluation?**
+Evaluators can be defined and executed in multiple ways:
-Pairwise evaluation is helpful when it is difficult to directly score an LLM output, but easier to compare two outputs. This can be the case for tasks like summarization - it may be hard to give a summary an absolute score, but easy to choose which of two summaries is more informative.
+- **Custom code**: Define [custom evaluators](/langsmith/code-evaluator) as Python or TypeScript functions and run them client-side using the SDKs or server-side via the UI.
+- **Built-in evaluators**: LangSmith provides built-in evaluators that can be configured and run via the UI.
-Learn [how run pairwise evaluations](/langsmith/evaluate-pairwise).
+Run evaluators using the LangSmith SDK ([Python](https://docs.smith.langchain.com/reference/python/reference) and [TypeScript](https://docs.smith.langchain.com/reference/js)), via the [Prompt Playground](/langsmith/observability-concepts#prompt-playground), or by configuring [rules](/langsmith/rules) to automatically run them on tracing projects or datasets.
-## Experiment
+### Evaluator inputs
-Each time we evaluate an application on a dataset, we are conducting an experiment. An experiment contains the results of running a specific version of your application on the dataset. To understand how to use the LangSmith experiment view, see [how to analyze experiment results](/langsmith/analyze-an-experiment).
+Evaluator inputs differ based on evaluation type:
-
+**Offline evaluators** receive:
+- [Example](#examples): The example from your [dataset](#datasets), containing inputs, reference outputs, and metadata.
+- [Run](/langsmith/observability-concepts#runs): The actual outputs and intermediate steps from running the application on the example inputs.
-Typically, we will run multiple experiments on a given dataset, testing different configurations of our application (e.g., different prompts or LLMs). In LangSmith, you can easily view all the experiments associated with your dataset. Additionally, you can [compare multiple experiments in a comparison view](/langsmith/compare-experiment-results).
+**Online evaluators** receive:
+- [Run](/langsmith/observability-concepts#runs): The production trace containing inputs, outputs, and intermediate steps (no reference outputs available).
-
+### Evaluator outputs
+
+Evaluators return one or more metrics as a dictionary or list of dictionaries. Each dictionary contains:
+
+- `key`: The metric name.
+- `score` | `value`: The metric value (`score` for numerical metrics, `value` for categorical metrics).
+- `comment` (optional): Additional reasoning or explanation for the score.
+
+### Evaluation techniques
+LangSmith supports several evaluation approaches:
-## Experiment configuration
+- [Human](#human)
+- [Code](#code)
+- [LLM-as-judge](#llm-as-judge)
+- [Pairwise](#pairwise)
-LangSmith supports a number of experiment configurations which make it easier to run your evals in the manner you want.
+#### Human
-### Repetitions
+_Human evaluation_ involves manual review of application outputs and execution traces. This approach is [often an effective starting point for evaluation](https://hamel.dev/blog/posts/evals/#looking-at-your-traces). LangSmith provides tools to review application outputs and traces (all intermediate steps).
-Running an experiment multiple times can be helpful since LLM outputs are not deterministic and can differ from one repetition to the next. By running multiple repetitions, you can get a more accurate estimate of the performance of your system.
+[Annotation queues](#annotation-queues) streamline the process of collecting human feedback on application outputs.
-Repetitions can be configured by passing the `num_repetitions` argument to `evaluate` / `aevaluate` ([Python](https://docs.smith.langchain.com/reference/python/evaluation/langsmith.evaluation._runner.evaluate), [TypeScript](https://docs.smith.langchain.com/reference/js/interfaces/evaluation.EvaluateOptions#numrepetitions)). Repeating the experiment involves both re-running the target function to generate outputs and re-running the evaluators.
+#### Code
-To learn more about running repetitions on experiments, read the [how-to-guide](/langsmith/repetition).
+_Code evaluators_ are deterministic, rule-based functions. They work well for checks such as verifying the structure of a chatbot's response is not empty, that generated code compiles, or that a classification matches exactly.
-### Concurrency
+#### LLM-as-judge
-By passing the `max_concurrency` argument to `evaluate` / `aevaluate`, you can specify the concurrency of your experiment. The `max_concurrency` argument has slightly different semantics depending on whether you are using `evaluate` or `aevaluate`.
+_LLM-as-judge evaluators_ use LLMs to score application outputs. The grading rules and criteria are typically encoded in the LLM prompt. These evaluators can be:
-#### `evaluate`
+- **Reference-free**: Check if output contains offensive content or adheres to specific criteria.
+- **Reference-based**: Compare output to a reference (e.g., check factual accuracy relative to the reference).
-The `max_concurrency` argument to `evaluate` specifies the maximum number of concurrent threads to use when running the experiment. This is both for when running your target function as well as your evaluators.
+LLM-as-judge evaluators require careful review of scores and prompt tuning. Few-shot evaluators, which include examples of inputs, outputs, and expected grades in the grader prompt, often improve performance.
-#### `aevaluate`
+Learn about [how to define an LLM-as-a-judge evaluator](/langsmith/llm-as-judge).
-The `max_concurrency` argument to `aevaluate` is fairly similar to `evaluate`, but instead uses a semaphore to limit the number of concurrent tasks that can run at once. `aevaluate` works by creating a task for each example in the dataset. Each task consists of running the target function as well as all of the evaluators on that specific example. The `max_concurrency` argument specifies the maximum number of concurrent tasks, or put another way - examples, to run at once.
+#### Pairwise
-### Caching
+_Pairwise evaluators_ compare outputs from two application versions using heuristics (e.g., which response is longer), LLMs (with pairwise prompts), or human reviewers.
-Lastly, you can also cache the API calls made in your experiment by setting the `LANGSMITH_TEST_CACHE` to a valid folder on your device with write access. This will cause the API calls made in your experiment to be cached to disk, meaning future experiments that make the same API calls will be greatly sped up.
+Pairwise evaluation works well when directly scoring an output is difficult but comparing two outputs is straightforward. For example, in summarization tasks, choosing the more informative of two summaries is often easier than assigning an absolute score to a single summary.
-## Annotation queues
+Learn [how run pairwise evaluations](/langsmith/evaluate-pairwise).
-Human feedback is often the most valuable feedback you can gather on your application. With [annotation queues](/langsmith/annotation-queues) you can flag runs of your application for annotation. Human annotators then have a streamlined view to review and provide feedback on the runs in a queue. Often (some subset of) these annotated runs are then transferred to a [dataset](/langsmith/evaluation-concepts#datasets) for future evaluations. While you can always [annotate runs inline](/langsmith/annotate-traces-inline), annotation queues provide another option to group runs together, specify annotation criteria, and configure permissions.
+### Reference-free vs reference-based evaluators
-Learn more about [annotation queues and human feedback](/langsmith/annotation-queues).
+Understanding whether an evaluator requires reference outputs is essential for determining when it can be used.
-## Offline evaluation
+**Reference-free evaluators** assess quality without comparing to expected outputs. These work for both offline and online evaluation:
+- **Safety checks**: Toxicity detection, PII detection, content policy violations
+- **Format validation**: JSON structure, required fields, schema compliance
+- **Quality heuristics**: Response length, latency, specific keywords
+- **Reference-free LLM-as-judge**: Clarity, coherence, helpfulness, tone
-Evaluating an application on a dataset is what we call "offline" evaluation. It is offline because we're evaluating on a pre-compiled set of data. An online evaluation, on the other hand, is one in which we evaluate a deployed application's outputs on real traffic, in near realtime. Offline evaluations are used for testing a version(s) of your application pre-deployment.
+**Reference-based evaluators** require reference outputs and only work for offline evaluation:
+- **Correctness**: Semantic similarity to reference answer
+- **Factual accuracy**: Fact-checking against ground truth
+- **Exact match**: Classification tasks with known labels
+- **Reference-based LLM-as-judge**: Comparing output quality to a reference
-You can run offline evaluations client-side using the LangSmith SDK ([Python](https://docs.smith.langchain.com/reference/python/reference) and [TypeScript](https://docs.smith.langchain.com/reference/js)). You can run them server-side via the [Prompt Playground](/langsmith/observability-concepts#prompt-playground) or by configuring [automations](/langsmith/rules) to run certain evaluators on every new experiment against a specific dataset.
+When designing an evaluation strategy, reference-free evaluators provide consistency across both offline testing and online monitoring, while reference-based evaluators enable more precise correctness checks during development.
-
+## Experiment
-### Benchmarking
+An _experiment_ represents the results of evaluating a specific application version on a dataset. Each experiment captures outputs, evaluator scores, and execution traces for every example in the dataset.
-Perhaps the most common type of offline evaluation is one in which we curate a dataset of representative inputs, define the key performance metrics, and benchmark multiple versions of our application to find the best one. Benchmarking can be laborious because for many use cases you have to curate a dataset with gold-standard reference outputs and design good metrics for comparing experimental outputs to them. For a RAG Q\&A bot this might look like a dataset of questions and reference answers, and an LLM-as-judge evaluator that determines if the actual answer is semantically equivalent to the reference answer. For a ReACT agent this might look like a dataset of user requests and a reference set of all the tool calls the model is supposed to make, and a heuristic evaluator that checks if all of the reference tool calls were made.
+
-### Unit tests
+Multiple experiments typically run on a given dataset to test different application configurations (e.g., different prompts or LLMs). LangSmith displays all experiments associated with a dataset and supports [comparing multiple experiments](/langsmith/compare-experiment-results) side-by-side.
-Unit tests are used in software development to verify the correctness of individual system components. [Unit tests in the context of LLMs are often rule-based assertions](https://hamel.dev/blog/posts/evals/#level-1-unit-tests) on LLM inputs or outputs (e.g., checking that LLM-generated code can be compiled, JSON can be loaded, etc.) that validate basic functionality.
+
-Unit tests are often written with the expectation that they should always pass. These types of tests are nice to run as part of CI. Note that when doing so it is useful to set up a cache to minimize LLM calls (because those can quickly rack up!).
+Learn [how to analyze experiment results](/langsmith/analyze-an-experiment).
-### Regression tests
+## Evaluation types
-Regression tests are used to measure performance across versions of your application over time. They are used to, at the very least, ensure that a new app version does not regress on examples that your current version correctly handles, and ideally to measure how much better your new version is relative to the current. Often these are triggered when you are making app updates (e.g. updating models or architectures) that are expected to influence the user experience.
+LangSmith supports various evaluation approaches for different stages of development and deployment. Understanding when to use each type helps build a comprehensive evaluation strategy.
-LangSmith's comparison view has native support for regression testing, allowing you to quickly see examples that have changed relative to the baseline. Regressions are highlighted red, improvements green.
+Offline and online evaluations serve different purposes:
+- **Offline evaluation types** test pre-deployment on curated datasets with reference outputs
+- **Online evaluation types** monitor production behavior on live traffic without reference outputs
-
+Learn more about [evaluation types and when to use each](/langsmith/evaluation-types).
-### Backtesting
+## Best practices
-Backtesting is an approach that combines dataset creation (discussed above) with evaluation. If you have a collection of production logs, you can turn them into a dataset. Then, you can re-run those production examples with newer application versions. This allows you to assess performance on past and realistic user inputs.
+### Building datasets
-This is commonly used to evaluate new model versions. Anthropic dropped a new model? No problem! Grab the 1000 most recent runs through your application and pass them through the new model. Then compare those results to what actually happened in production.
+There are various strategies for building datasets:
-### Pairwise evaluation
+**Manually curated examples**
-For some tasks [it is easier](https://www.oreilly.com/radar/what-we-learned-from-a-year-of-building-with-llms-part-i/) for a human or LLM grader to determine if "version A is better than B" than to assign an absolute score to either A or B. Pairwise evaluations are just this — a scoring of the outputs of two versions against each other as opposed to against some reference output or absolute criteria. Pairwise evaluations are often useful when using LLM-as-judge evaluators on more general tasks. For example, if you have a summarizer application, it may be easier for an LLM-as-judge to determine "Which of these two summaries is more clear and concise?" than to give an absolute score like "Give this summary a score of 1-10 in terms of clarity and concision."
+This is the recommended starting point. Create 10–20 high-quality examples covering common scenarios and edge cases. These examples define what "good" looks like for your application.
-Learn [how run pairwise evaluations](/langsmith/evaluate-pairwise).
+**Historical traces**
-## Online evaluation
+Once in production, convert real traces into examples. For high-traffic applications:
+- **User feedback**: Add runs that received negative feedback to test against.
+- **Heuristics**: Identify interesting runs (e.g., long latency, errors).
+- **LLM feedback**: Use LLMs to detect noteworthy conversations.
-Evaluating a deployed application's outputs in (roughly) realtime is what we call "online" evaluation. In this case there is no dataset involved and no possibility of reference outputs — we're running evaluators on real inputs and real outputs as they're produced. This is useful for monitoring your application and flagging unintended behavior. Online evaluation can also work hand-in-hand with offline evaluation: for example, an online evaluator can be used to classify input questions into a set of categories that can later be used to curate a dataset for offline evaluation.
+**Synthetic data**
-Online evaluators are generally intended to be run server-side. LangSmith has built-in [LLM-as-judge evaluators](/langsmith/llm-as-judge) that you can configure, or you can define custom code evaluators that are also run within LangSmith.
+Generate additional examples from existing ones. Works best when starting with several high-quality, hand-crafted examples as templates.
-
+### Dataset organization
-## Testing
+**Splits**
-### Evaluations vs testing
+Partition datasets into subsets for targeted evaluation. Use splits for performance optimization (smaller splits for rapid iteration) and interpretability (evaluate different input types separately).
-Testing and evaluation are very similar and overlapping concepts that often get confused.
+Learn how to [create and manage dataset splits](/langsmith/manage-datasets-in-application#create-and-manage-dataset-splits).
-**An evaluation measures performance according to a metric(s).** Evaluation metrics can be fuzzy or subjective, and are more useful in relative terms than absolute ones. That is, they're often used to compare two systems against each other rather than to assert something about an individual system.
+**Versions**
-**Testing asserts correctness.** A system can only be deployed if it passes all tests.
+LangSmith automatically creates dataset [versions](/langsmith/manage-datasets#version-a-dataset) when examples change. [Tag versions](/langsmith/manage-datasets#tag-a-version) to mark important milestones. Target specific versions in CI pipelines to ensure dataset updates don't break workflows.
+
+### Human feedback collection
+
+Human feedback often provides the most valuable assessment, particularly for subjective quality dimensions.
+
+**Annotation queues**
-Evaluation metrics can be *turned into* tests. For example, you can write regression tests to assert that any new version of a system must outperform some baseline version of the system on the relevant evaluation metrics.
+[Annotation queues](/langsmith/annotation-queues) enable structured collection of human feedback. Flag specific runs for review, collect annotations in a streamlined interface, and transfer annotated runs to datasets for future evaluations.
-It can also be more resource efficient to run tests and evaluations together if your system is expensive to run and you have overlapping datasets for your tests and evaluations.
+Annotation queues complement [inline annotation](/langsmith/annotate-traces-inline) by offering additional capabilities: grouping runs, specifying criteria, and configuring reviewer permissions.
-You can also choose to write evaluations using standard software testing tools like `pytest` or `vitest/jest` out of convenience.
+### Evaluations vs testing
+
+Testing and evaluation are similar but distinct concepts.
-### Using `pytest` and `Vitest/Jest`
+**Evaluation measures performance according to metrics.** Metrics can be fuzzy or subjective, and prove more useful in relative terms. They typically compare systems against each other.
+
+**Testing asserts correctness.** A system can only be deployed if it passes all tests.
-The LangSmith SDKs come with integrations for [pytest](/langsmith/pytest) and [`Vitest/Jest`](/langsmith/vitest-jest). These make it easy to:
+Evaluation metrics can be converted into tests. For example, regression tests can assert that new versions must outperform baseline versions on relevant metrics. Run tests and evaluations together for efficiency when systems are expensive to run.
-* Track test results in LangSmith
-* Write evaluations as tests
+Evaluations can be written using standard testing tools like [pytest](/langsmith/pytest) or [Vitest/Jest](/langsmith/vitest-jest).
-Tracking test results in LangSmith makes it easy to share results, compare systems, and debug failing tests.
+## Quick reference: Offline vs online evaluation
-Writing evaluations as tests can be useful when each example you want to evaluate on requires custom logic for running the application and/or evaluators. The standard evaluation flows assume that you can run your application and evaluators in the same way on every example in a dataset. But for more complex systems or comprehensive evals, you may want to evaluate specific subsets of your system with specific types of inputs and metrics. These types of heterogenous evals are much easier to write as a suite of distinct test cases that all get tracked together rather than using the standard evaluate flow.
+The following table summarizes the key differences between offline and online evaluations:
-Using testing tools is also helpful when you want to *both* evaluate your system's outputs *and* assert some basic things about them.
+| | **Offline Evaluation** | **Online Evaluation** |
+|---|---|---|
+| **Runs on** | Dataset (Examples) | Tracing Project (Runs/Threads) |
+| **Data access** | Inputs, Outputs, Reference Outputs | Inputs, Outputs only |
+| **When to use** | Pre-deployment, during development | Production, post-deployment |
+| **Primary use cases** | Benchmarking, unit testing, regression testing, backtesting | Real-time monitoring, production feedback, anomaly detection |
+| **Evaluation timing** | Batch processing on curated test sets | Real-time or near real-time on live traffic |
+| **Setup location** | Evaluation tab (SDK, UI, Prompt Playground) | [Observability tab](/langsmith/online-evaluations) (automated rules) |
+| **Data requirements** | Requires dataset curation | No dataset needed, evaluates live traces |
diff --git a/src/langsmith/evaluation-types.mdx b/src/langsmith/evaluation-types.mdx
new file mode 100644
index 0000000000..ddcd4a8f06
--- /dev/null
+++ b/src/langsmith/evaluation-types.mdx
@@ -0,0 +1,70 @@
+---
+title: Evaluation types
+sidebarTitle: Evaluation types
+---
+
+LangSmith supports various evaluation types for different stages of development and deployment. Understanding when to use each helps build a comprehensive evaluation strategy.
+
+## Offline evaluation types
+
+Offline evaluation tests applications on curated datasets before deployment. By running evaluations on examples with reference outputs, teams can compare versions, validate functionality, and build confidence before exposing changes to users.
+
+Run offline evaluations client-side using the LangSmith SDK ([Python](https://docs.smith.langchain.com/reference/python/reference) and [TypeScript](https://docs.smith.langchain.com/reference/js)) or server-side via the [Prompt Playground](/langsmith/observability-concepts#prompt-playground) or [automations](/langsmith/rules).
+
+
+
+### Benchmarking
+
+_Benchmarking_ compares multiple application versions on a curated dataset to identify the best performer. This process involves creating a dataset of representative inputs, defining performance metrics, and testing each version.
+
+Benchmarking requires dataset curation with gold-standard reference outputs and well-designed comparison metrics. Examples:
+- **RAG Q&A bot**: Dataset of questions and reference answers, with an LLM-as-judge evaluator checking semantic equivalence between actual and reference answers.
+- **ReACT agent**: Dataset of user requests and reference tool calls, with a heuristic evaluator verifying all expected tool calls were made.
+
+### Unit tests
+
+_Unit tests_ verify the correctness of individual system components. In LLM contexts, [unit tests are often rule-based assertions](https://hamel.dev/blog/posts/evals/#level-1-unit-tests) on inputs or outputs (e.g., verifying LLM-generated code compiles, JSON loads successfully) that validate basic functionality.
+
+Unit tests typically expect consistent passing results, making them suitable for CI pipelines. When running in CI, configure caching to minimize LLM API calls and associated costs.
+
+### Regression tests
+
+_Regression tests_ measure performance consistency across application versions over time. They ensure new versions do not degrade performance on cases the current version handles correctly, and ideally demonstrate improvements over the baseline. These tests typically run when making updates expected to affect user experience (e.g., model or architecture changes).
+
+LangSmith's comparison view highlights regressions (red) and improvements (green) relative to the baseline, enabling quick identification of changes.
+
+
+
+### Backtesting
+
+_Backtesting_ evaluates new application versions against historical production data. Production logs are converted into a dataset, then newer versions process these examples to assess performance on past, realistic user inputs.
+
+This approach is commonly used for evaluating new model releases. For example, when a new model becomes available, test it on the most recent production runs and compare results to actual production outcomes.
+
+### Pairwise evaluation
+
+_Pairwise evaluation_ compares outputs from two versions by determining relative quality rather than assigning absolute scores. For some tasks, [determining "version A is better than B"](https://www.oreilly.com/radar/what-we-learned-from-a-year-of-building-with-llms-part-i/) is easier than scoring each version independently.
+
+This approach proves particularly useful for LLM-as-judge evaluations on subjective tasks. For example, in summarization, determining "Which summary is clearer and more concise?" is often simpler than assigning numeric clarity scores.
+
+Learn [how run pairwise evaluations](/langsmith/evaluate-pairwise).
+
+## Online evaluation types
+
+Online evaluation assesses production application outputs in near real-time. Without reference outputs, these evaluations focus on detecting issues, monitoring quality trends, and identifying edge cases that inform future offline testing.
+
+Online evaluators typically run server-side. LangSmith provides built-in [LLM-as-judge evaluators](/langsmith/llm-as-judge) for configuration, and supports custom code evaluators that run within LangSmith.
+
+
+
+### Real-time monitoring
+
+Monitor application quality continuously as users interact with the system. Online evaluations run automatically on production traffic, providing immediate feedback on each interaction. This enables detection of quality degradation, unusual patterns, or unexpected behaviors before they impact significant user populations.
+
+### Anomaly detection
+
+Identify outliers and edge cases that deviate from expected patterns. Online evaluators can flag runs with unusual characteristics—extremely long or short responses, unexpected error rates, or outputs that fail safety checks—for human review and potential addition to offline datasets.
+
+### Production feedback loop
+
+Use insights from production to improve offline evaluation. Online evaluations surface real-world issues and usage patterns that may not appear in curated datasets. Failed production runs become candidates for dataset examples, creating an iterative cycle where production experience continuously refines testing coverage.
diff --git a/src/langsmith/evaluation.mdx b/src/langsmith/evaluation.mdx
index 6e15f5db35..532e9c7734 100644
--- a/src/langsmith/evaluation.mdx
+++ b/src/langsmith/evaluation.mdx
@@ -1,22 +1,101 @@
---
-title: LangSmith Evaluations
+title: LangSmith Evaluation
sidebarTitle: Overview
mode: wide
---
import HostingSetup from '/snippets/langsmith/platform-setup-note.mdx';
-The following sections help you create datasets, run evaluations, and analyze results:
+LangSmith supports two types of evaluations based on when and where they run:
+
+
+
+ **Test before you ship**
+
+ Run evaluations on curated datasets during development to compare versions, benchmark performance, and catch regressions.
+
+
+
+ **Monitor in production**
+
+ Evaluate real user interactions in real-time to detect issues and measure quality on live traffic.
+
+
+
+
+## Evaluation workflow
+
+
+
+
+
+
+ Create a [dataset](/langsmith/manage-datasets) with [examples](/langsmith/evaluation-concepts#examples) from manually curated test cases, historical production traces, or synthetic data generation.
+
+
+
+ Create [evaluators](/langsmith/evaluation-concepts#evaluators) to score performance:
+ - [Human](/langsmith/evaluation-concepts#human) review
+ - [Code](/langsmith/evaluation-concepts#code) rules
+ - [LLM-as-judge](/langsmith/llm-as-judge)
+ - [Pairwise](/langsmith/evaluate-pairwise) comparison
+
+
+
+ Execute your application on the dataset to create an [experiment](/langsmith/evaluation-concepts#experiment). Configure [repetitions, concurrency, and caching](/langsmith/experiment-configuration) to optimize runs.
+
+
+
+ Compare experiments for [benchmarking](/langsmith/evaluation-types#benchmarking), [unit tests](/langsmith/evaluation-types#unit-tests), [regression tests](/langsmith/evaluation-types#regression-tests), or [backtesting](/langsmith/evaluation-types#backtesting).
+
+
+
+
+
+
+
+
+
+ Each interaction creates a [run](/langsmith/evaluation-concepts#runs) without reference outputs.
+
+
+
+ Set up [evaluators](/langsmith/online-evaluations) to run automatically on production traces: safety checks, format validation, quality heuristics, and reference-free LLM-as-judge. Apply [filters and sampling rates](/langsmith/online-evaluations#4-optional-configure-a-sampling-rate) to control costs.
+
+
+
+ Evaluators run automatically on [runs](/langsmith/evaluation-concepts#runs) or [threads](/langsmith/online-evaluations#configure-multi-turn-online-evaluators), providing real-time monitoring, anomaly detection, and alerting.
+
+
+
+ Add failing production traces to your [dataset](/langsmith/manage-datasets), create targeted evaluators, validate fixes with offline experiments, and redeploy.
+
+
+
+
+
+
+
+For more on the differences between offline and online evaluation, refer to the [Evaluation concepts](/langsmith/evaluation-concepts#quick-reference-offline-vs-online-evaluation) page.
+
+
+## Get started
- Review core terminology and concepts to understand how evaluations work in LangSmith.
+ Get started with offline evaluation.
- Evaluate your applications with different evaluators and techniques to measure quality.
+ Explore evaluation types, techniques, and frameworks for comprehensive testing.
- Gather human feedback through annotation queues and inline annotation on outputs.
+ Monitor production quality in real-time from the Observability tab.
The pytest integration is in beta and is subject to change in upcoming releases.
diff --git a/src/langsmith/vitest-jest.mdx b/src/langsmith/vitest-jest.mdx
index d61de35221..704a5c0aad 100644
--- a/src/langsmith/vitest-jest.mdx
+++ b/src/langsmith/vitest-jest.mdx
@@ -9,9 +9,9 @@ LangSmith provides integrations with Vitest and Jest that allow JavaScript and T
Compared to the `evaluate()` evaluation flow, this is useful when:
-* Each example requires different evaluation logic
-* You want to assert binary expectations, and both track these assertions in LangSmith and raise assertion errors locally (e.g. in CI pipelines)
-* You want to take advantage of mocks, watch mode, local results, or other features of the Vitest/Jest ecosystems
+* **Each example requires different evaluation logic**: Standard evaluation flows assume consistent application and evaluator execution across all dataset examples. For more complex systems or comprehensive evaluations, specific system subsets may require evaluation with particular input types and metrics. These heterogeneous evaluations are simpler to write as distinct test case suites that track together.
+* **You want to assert binary expectations**: Track assertions in LangSmith and raise assertion errors locally (e.g. in CI pipelines). Testing tools help when both evaluating system outputs and asserting basic properties about them.
+* **You want to take advantage of mocks, watch mode, local results, or other features of the Vitest/Jest ecosystems**
Requires JS/TS SDK version `langsmith>=0.3.1`.