Trace

What is a trace?

A trace is a detailed record of a complete AI interaction that includes the user input, system prompts, tool calls (if applicable), intermediate steps, and final LLM responses. In multi-turn conversations, a trace captures all the back and forth between the user and the LLM.

For example, in a customer interview coaching application, a trace would include the system prompts, the interview transcript submitted by the user, and the AI's coaching feedback. If the application used tools, the trace would also capture which tools were called and what results they returned.

Why are traces important for AI product development?

Traces serve as the foundation for error analysis and continuous improvement. By logging and analyzing traces from production, teams can:

Identify failure modes. When users report problems or get unexpected responses, teams examine the trace to understand exactly what happened—which prompts were used, what data was processed, and how the LLM responded.

Build better evals. Real traces reveal edge cases and failure patterns that teams might not anticipate when initially designing test cases. These production examples become the basis for new evals that prevent regression.

Iterate on quality. Annotating traces, analyzing patterns across many interactions, and running experiments based on trace data are continuous activities that drive AI product quality improvements.

Observability—the ability to see and analyze traces—is essential for building quality AI products. The richness of trace data, including intermediate steps and tool calls, makes traces particularly valuable for understanding non-deterministic AI behavior.

What are the ethical considerations with traces?

Storing traces requires transparency with users about data collection practices. Teams must implement appropriate consent mechanisms and be clear about what data is being collected, how it's stored, and how it will be used.

Traces often contain sensitive user inputs and system responses, making ethical data practices critical for responsible AI development.

Learn more:

Related terms:

← Back to Ai Glossary