LLM applications can behave unpredictably when natural-language inputs expose edge cases. LangSmith is a development and observability platform for debugging, testing, and monitoring those applications. Its traces make a workflow visible when an answer or agent action does not follow the expected path. section 7.5
For a document Q&A chatbot, enable tracing, run a question, and open the latest trace to inspect the chain’s execution. For a tool-based agent, a graphical trace exposes LLM steps, tool calls, intermediate states, and message flow—even when the agent itself is built from prebuilt components. section 7.5 section 11.9.3 section 11.9.4
LANGSMITH_TRACING=true LANGSMITH_ENDPOINT="https://api.smith.langchain.com" LANGSMITH_API_KEY="<your-langsmith-api-key>" LANGSMITH_PROJECT="langchain-in-action-react-agent"
Set these environment variables in a .env file to enable tracing, supply the LangSmith endpoint and API key, and name the project where runs will appear. Keep the API key secure. section 11.9.4 section 7.5
Use the trace as a debugging path:
- Run the application and submit a question. section 11.9.4
- In LangSmith, open Observability → Tracing Projects, select the project, and open its latest trace. section 11.9.4
- Compare the visible chain or agent steps with the workflow you expected; inspect tool calls and message flow when an agent takes an unexpected path. section 7.5 section 11.9.4
Tracing is one part of the platform. LangSmith also supports built-in evaluators for relevance, correctness, and sensitivity; datasets assembled from sources including production data for continuous and regression testing; and production monitoring with human labels and annotations. These capabilities help investigate deviations rather than assuming a successful-looking answer means the workflow ran correctly. section 7.5

