LangChain Support
Back to SDKs and APIs

Why do I see inconsistent output formats for the same agent across different traces?

SDKs and APIs·2 min read·Nov 23, 2025··

Context

When using the LangSmith Agent SDK, you may notice that the same agent produces different output formats across multiple traces. This can make it challenging to create evaluators since you can only specify one output path, but your traces might have outputs at different paths like output.output[0].content[0].text and output.content[0].text.

Answer

This issue is typically caused by using different versions of the LangSmith SDK across your traces. The output format was standardized in version 0.4.34, where the SDK now flattens the output into a consistent output.content format.

To resolve this issue:

  1. Upgrade to LangSmith SDK version 0.4.34 or later - This version includes a fix that ensures consistent output formatting across all traces.

  2. Ensure all environments are using the same SDK version - Check that your local development environment, staging, and production environments are all using the same updated version.

  3. Verify your traces are using the updated format - After upgrading, new traces should consistently use the output.content format instead of the nested output.output.content format.

If you need to work with traces that have mixed formats temporarily, you can add metadata tags to your traces to identify which format they use, then filter for specific formats when running evaluators.

The standardized output format in version 0.4.34+ ensures that all traces from the same agent will have consistent output paths, making it possible to create single evaluators that work across all traces.