- Semantic Intent: What the user was trying to do.
- Semantic Outcome: What actually happened, did the task succeed.
- Trajectory: How the conversation unfolded, including trajectory of tool calls.
Online evaluators extend trace retention by default. You can opt out for an individual evaluator when the agent environment uses base retention. Other actions can still extend those traces. If extended retention is disabled for the workspace, evaluations continue without new retention upgrades, regardless of saved environment defaults.
How it works
Multi-turn online evaluators follow this evaluation lifecycle:- Trace ingestion: Each turn in a conversation is traced as a separate run and associated with a thread using a shared thread ID.
- Idle time detection: After the last trace in a thread is ingested, LangSmith waits for the configured idle time to elapse. This idle period signals that the conversation is complete and ready for evaluation.
- Message assembly: LangSmith collects the
messagesfrom each trace in the thread and assembles them into a single conversation history. If each trace contains only the latest message, LangSmith stitches messages together across turns. If each trace contains the full history, LangSmith uses that directly. Because consecutive traces in a thread often resend prior history, LangSmith deduplicates overlapping messages so each one appears only once. The result is a single list of messages in OpenAI chat format ({"role": ..., "content": ...}), which is what theall_messagesvariable in your prompt resolves to. - LLM-as-a-judge evaluation: The assembled conversation is passed to your configured LLM-as-a-judge prompt. The evaluator scores the full thread based on your criteria: semantic intent, outcome, or trajectory.
- Feedback recording: The evaluator writes feedback to LangSmith using the feedback key you configured, associated with the thread.
Prerequisites
- Your agent environment must be using threads.
- The top-level inputs and outputs of each trace in a thread must have a
messageskey that contains a list of messages. We support messages in LangChain, OpenAI Chat Completions, and Anthropic Messages formats.- If the top-level inputs and outputs of each trace only contain the latest message in the conversation, LangSmith will automatically combine messages across turns into a thread.
- If the top-level inputs and outputs of each trace contain the full conversation history, LangSmith will use that directly.
If your traces don’t follow the format above, thread level evaluators won’t work. You’ll need to update how you trace to LangSmith to ensure each trace’s top-level inputs and outputs contain a list of
messages.Please refer to the troubleshooting section for more information.Configuration
To create a multi-turn online evaluator:- Select your agent, go to Tracing, and select the environment.
- Click the Online Evaluators tab, then click + Evaluator, and select LLM-as-a-Judge Evaluator under Create from scratch.
- Name your evaluator.
- Select Threads under Trigger On, or under Source if the panel shows the filter builder instead of a search bar.
-
Apply Filters or a Sampling Rate.
Use filters or sampling to control evaluator cost. For example, evaluate only threads under N turns or sample 10% of all threads.
The filter controls depend on which experience the panel shows:
- Search bar (Trigger On): If trajectory evaluators are available, or the evaluator uses the
trajectoryvariable, Threads shows a filter builder with only the Is Trace, Run Name, Run Type, and Metadata fields. Otherwise, Threads shows the search bar. Refer to Filter threads with the search bar. - Filter builder (Source): Filter on Trace Count to limit thread length. If the evaluator uses the
trajectoryvariable, the builder offers only the Is Trace, Run Name, Run Type, and Metadata fields.
- Search bar (Trigger On): If trajectory evaluators are available, or the evaluator uses the
- Configure the remaining settings:
- Click Create. Your evaluator appears in the Online Evaluators tab. You can test it once the idle time has passed for any new threads created after that.
Check the idle time
Under Advanced, Thread Idle Time shows the environment’s idle time: the amount of time after the last trace in a thread before it is considered complete and ready for evaluation. This value should reflect the expected length of user interactions in your app. The idle time defaults to 10 minutes and cannot be set below 2 minutes.The idle time is set on the agent environment. It applies to every thread-level evaluator on that environment and to every automation rule whose item type is Threads. To change it, click the Edit tracing settings icon next to the value or on the environment’s Tracing page.
Configure your model
Select the provider and model for your evaluator. Threads tend to get long, so use a model with a large context window to avoid running into limits. For example, OpenAI’s GPT-5.4 mini and Gemini 2.5 Flash both have 1M+ token context windows.Configure your LLM-as-a-judge prompt
Define what you want to evaluate. The evaluator applies this prompt to the thread. You can also configure which parts of the assembled conversation theall_messages variable passes to the evaluator:
- All messages: Send the full conversation as a list of JSON message objects in OpenAI chat format (
{"role": ..., "content": ...}), with each message rendered as indented JSON and separated by a blank line. - Human and AI pairs: Send only user and assistant messages, formatted as
<user>...</user>and<assistant>...</assistant>and excluding system messages, tool calls, and other roles. - First human and last AI: Send only the first user message and the last assistant reply.
Set up your feedback configuration
Configure a name for the feedback key, the format for the feedback you want to collect and optionally enable reasoning on the feedback.Filter threads with the search bar
When Threads shows a search bar, each filter condition applies to the scope you choose in the scope selector. This happens where trajectory evaluators are not available, and for LangChain Tuned Evaluators. The search bar offers three scopes:- Thread: Matches attributes of the thread as a whole, such as
turn_count,total_tokens,total_cost,thread_duration, andnum_errored_turns. For the full list, refer to Thread fields. - Root run: Matches the entry run of each trace in the thread.
- Any run: Matches any run in the thread.
turn_count:<10 in the Thread scope. To also require a failed tool call, click the Add filter scope icon at the right of the search bar and add run_type:tool AND status:error in the Any run scope. Rows combine with AND. For the syntax, refer to Query syntax.
A filter in the Thread scope turns off backfill for the evaluator, so the evaluator applies only to new threads.
When you open a thread-level evaluator whose filter uses the filter builder syntax, LangSmith converts its Trace Count conditions to turn_count clauses in the Thread scope, and its other conditions to the Any run scope. This works when the conditions are joined with AND. A filter that mixes Trace Count with other conditions using OR or NOT is not converted, and the evaluator keeps the filter builder with the original filter intact.
Evaluate trajectories
trajectory is one of the variables a thread evaluator can use, alongside all_messages, human_ai_pairs, and first_human_last_ai. It resolves to the trajectory of the conversation: the flat, ordered list of messages from start to finish, including tool calls and their results. Use it to score the path an agent took, such as whether it picked the right tools, followed its plan, and got there without wasted steps.
On LangSmith Cloud, the
trajectory variable is available in the GCP US, GCP EU, GCP APAC, and AWS US regions.On BYOC, the trajectory variable is available on data planes that store and query traces in SmithDB.Self-hosted installations support the trajectory variable on LangSmith v0.17 or later, after you switch queries to SmithDB. See SmithDB feature availability.all_messages,human_ai_pairs, andfirst_human_last_airesolve to the conversation assembled from the inputs and outputs of each root run in the thread. Work that happens in child runs, such as intermediate model calls, tool calls, and tool result, is not included unless a root run’s own inputs or outputs contain it. human_ai_pairs and first_human_last_ai narrow further to user and assistant messages only.trajectoryresolves to the trajectory built from the model and tool calls inside each trace. The tool calls and tool results the other views omit are preserved.
Use the trajectory variable
Follow the configuration steps above. Two things change:- Under Trigger On, select Threads. The variable is available only on an evaluator that runs on an agent environment, not on a dataset.
- Reference
{{trajectory}}in your prompt and map that variable to thetrajectorysource. The variable must be namedtrajectory: a differently named variable pointed at that source is rejected. The seeded default prompt and mapping already do this, so a new evaluator needs no changes here.
{{trajectory}} cannot appear alongside {{all_messages}}, {{human_ai_pairs}}, or {{first_human_last_ai}}. Once you map the trajectory source, the other sources are disabled in the variable source dropdown, and once you map one of the others, the trajectory source is disabled. Either way, the dropdown explains that trajectory variables and non-trajectory variables cannot be used together. Saving an evaluator that mixes them fails the same way.
When the evaluator completes, LangSmith writes feedback to the most recent root run in the thread, under the feedback key you configured, and associates that feedback with the thread. To find it later, see View feedback.
For a complete prompt you can adapt, see Example with trajectory context.
Settings and constraints
An evaluator that usestrajectory supports the following settings:
- Filters: Limit which threads the evaluator runs on, using the filter builder.
- Sampling rate: Evaluate a percentage of the threads that match your filters.
- Idle time: The agent environment’s thread idle time, which applies to every thread-level evaluator on that environment.
- Datasets and experiments as a source.
- Backfill over existing threads.
- Few-shot examples, extended stats, and dataset corrections.
- Code evaluators on the same automation rule, and non-evaluator actions such as adding threads to an annotation queue.
Limits
These are the current limits for thread-level processing (subject to change). They apply to multi-turn online evaluators and to automation rules whose item type is Threads. Reach out if you are running into any of these limits.- Runs must be less than one week old: When a thread becomes idle, only runs within the past 7 days are eligible for evaluation.
- Maximum of 500 threads processed at once: A single execution processes at most 500 matching threads, ordered by most recent activity.
Troubleshooting
Checking the status of your evaluator To check when your evaluator last ran, open the agent environment’s Online Evaluators tab on the Tracing page and click Logs in your evaluator’s row to view its run history. Inspect the data sent to the evaluator To inspect the data sent to your evaluator, open the agent environment’s Online Evaluators tab on the Tracing page, click your evaluator, and click the Traces tab. The tab shows traces only if you turned on tracing for the evaluator. New evaluators start with tracing turned off. In this tab, you can see the inputs passed into the LLM-as-a-judge evaluator. If your messages are not being passed in correctly, you will see blank values in the inputs. This can happen if your messages are not formatted in one of the expected formats.Connect these docs to your agent of choice via MCP for real-time answers.

