LangSmith automatically traces every LLM call within an agent run. You can inspect the exact input messages by viewing the trace in the LangSmith UI, where each LLM run shows the full messages array including system, human, AI, and tool messages. You can also programmatically fetch the trace via the LangSmith SDK.
When you enable LangSmith tracing (set LANGSMITH_TRACING_V2=true), every invocation of an LLM (including those inside agents) creates a trace. In the LangSmith web app, you can select a trace, expand the LLM call, and see the exact inputs object which contains the messages array that was sent to the provider. This includes all the role/content pairs and tool call definitions. You can also attach custom tags or metadata to runs to filter them. For programmatic access, you can use the langsmith Client to fetch runs by ID and examine the inputs.
In the LangSmith UI, the trace view also shows token usage, latency, and any errors. This is invaluable for debugging why an agent made a specific tool call or to verify that the conversation history is correctly constructed.