Leveraging LangSmith for Debugging Tools & Actions in Production LLM Applications

mendable · Tech · 2024 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: agentic LLM application debugging

Mendable's Tools & Actions feature made assistants capable of API-backed actions, but agent loops with custom tools, just-in-time AI-generated inputs, and production pipelines became difficult to debug without trace-level observability.

Constraints:

Architecture

Mendable integrated LangSmith into its LangChain/OpenAI-tool-agent stack for Tools & Actions. LangSmith traces expose run hierarchy, inputs, outputs, parameters, response times, feedback, token consumption, and tool inputs. The team used traces to identify a 7.23-second ChatOpenAI call caused by concatenating RAG prompts/sources with tool/action prompts, inspect AI-generated tool query parameters, refine tool descriptions and schemas, and save representative runs into datasets for future evaluation.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  Mendable_assistant["Mendable assistant"] --> Tools_and_Actions_module["Tools and Actions module"]
  Tools_and_Actions_module --> Custom_API_tools["Custom API tools"]
  Custom_API_tools --> Tool_schema_descriptions["Tool schema descriptions"]
  Tools_and_Actions_module --> LangChain_OpenAI_tool_agents["LangChain OpenAI tool agents"]
  LangChain_OpenAI_tool_agents --> LangSmith_tracing["LangSmith tracing"]
  Mendable_assistant --> LangSmith_tracing
  LangSmith_tracing --> Dataset_builder["Dataset builder"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Mendable assistant Enterprise GTM assistant that answers technical questions and can perform action workflows. Tools and Actions module, LangSmith tracing
Tools and Actions module Agentic feature that lets assistants invoke APIs and fill just-in-time AI-generated request values. Mendable assistant, Custom API tools, LangChain OpenAI tool agents
Custom API tools User-created API calls for CRM, news, DUNS, CoreSignal, and other enterprise data sources. Tools and Actions module, Tool schema descriptions
Tool schema descriptions Descriptions and schemas that guide AI-generated tool parameters at request time. Custom API tools, LangSmith tracing
LangChain OpenAI tool agents Agent runtime already used by Mendable and connected smoothly to LangSmith. Tools and Actions module, LangSmith tracing
LangSmith tracing Trace and debugging layer exposing call hierarchy, inputs, outputs, latency, token use, feedback, and tool behavior. Mendable assistant, Tools and Actions module, Dataset builder
Dataset builder LangSmith workflow for saving selected runs into evaluation datasets. LangSmith tracing

Data flow

A user asks a GTM assistant for prospect initiatives. The agent calls APIs such as CRM, Google News or DUNS, and CoreSignal, fills AI-generated tool parameters from the user's question and schema, then synthesizes sales guidance. LangSmith captures each agent run and tool call as a trace, letting Mendable inspect slow model calls, generated query parameters, tool schemas, and selected runs that become evaluation datasets.

4 supporting quotes
“Call the CRM API and get the exact team the salesperson is trying to sell to”article, stated
“Use the Google News or DUNS API to get the latest news on the specific team and related initiatives”article, stated
“The question inside the {query : { q } } parameter was generated by the AI.”article, stated
“When you enable tracing in a LangChain, the app captures and displays a detailed visualization of the runs’ call hierarchy.”article, stated

Why this architecture

Mendable needed observability at the agent-loop and tool-input level because console logs could not explain why an agent failed to call a tool, generated the wrong tool schema input, or slowed down from prompt bloat. LangSmith fit because it integrated with their existing LangChain agent stack and exposed the exact run hierarchy and metrics needed to debug production agent behavior.

3 supporting quotes
“Understanding the key interactions, decisions of an Agent loop can be quite tricky. Especially when it has been giving access to multiple resources and is embedded in a production pipeline.”article, stated
“Trying to debug why a tool wasn’t being called or why the API request had failed became a nightmare.”article, stated
“Here is where LangSmith from LangChain came to help.”article, stated

Models used: LangChain OpenAI tool agents · ChatOpenAI · LangSmith · RAG pipeline · CRM API · Google News API · DUNS API · CoreSignal API

Scale

Alternatives considered (roads not taken)

Debug with console.log statements

Rejected because: Console logs became messy and did not give visibility into agent behavior, tool calls, or custom-tool correctness.

“Soon our development process was full of “console.logs” everywhere and high latency runs.”article, stated
“we had no proper visibility on what the agentic behavior looked like nor if custom tools were working as expected.”article, stated

Concatenate all RAG prompts and sources into tool/action prompts

Rejected because: Tracing showed the combined prompt was massive and delayed streaming.

“the prompt was massive, it had concatenated all of our RAG pipeline prompts/sources with our Tools & Actions, leading to delay in the streaming process.”article, stated

Assume generated tool inputs are correct

Rejected because: Mendable found tool descriptions were critical to generating correct schemas and inputs.

“Making sure that query was accurate with what the user inputted but also optimized for the tool being used was very challenging.”article, stated
“What we realized is that the Tools description was critical for the correct schema and input to be generated.”article, stated

Patterns

tool-use-orchestration (agent architecture)

Mendable's assistants call CRM, news, DUNS, CoreSignal, and custom user-created API tools to move beyond Q&A into action-based workflows.

“the introduction of Tools & Actions in Mendable expands capabilities quite a bit, enabling chatbots to access and utilize a wider range of data sources and perform various automated tasks.”article, stated
“Call the CoreSignal API to get the latest hiring trends for the company based on job postings and more”article, stated

observability-tracing (operations)

LangSmith traces expose agent run hierarchy, tool calls, inputs, outputs, latency, feedback, and token consumption for debugging production behavior.

“LangSmith allows us to have a peek inside of the agents’ brain.”article, stated
“This feature allows you to explore the inputs, outputs, parameters, response times, feedback, token consumption, and other critical metrics of your run.”article, stated

eval-driven-development (quality)

Mendable converts selected traced runs into LangSmith datasets for evaluation after optimization experiments.

“the need to quickly save inputs/outputs for further evaluation became evident.”article, stated
“we now had all the data in one place from our runs and we could even evaluate that using LangSmith itself.”article, stated

latency-optimization (serving)

Tracing identified prompt concatenation as the cause of a slow ChatOpenAI call, leading the team to reduce which prompt chunks Tools & Actions used.

“the last call to `ChatOpenAI` took a long time: 7.23 seconds.”article, stated
“This allowed to further optimize what chunks of the prompt need to be used by the Tools & Action module, reducing total latency overall.”article, stated

structured-output-contract (tooling)

Custom tools require accurate schemas and AI-generated request parameters, so Mendable inspected and improved tool descriptions to make generated inputs reliable.

“when we create a tool in the backend, it needs to have the correct schema defined partially by what the user inputted in our UI”article, stated
“the Tools description was critical for the correct schema and input to be generated”article, stated

Tradeoffs

Make assistants action-capable

Chose Tools & Actions with API calls over Simple question-answering assistants.

Rationale: Mendable saw workflow value in letting assistants gather external data and synthesize it into actions, but accepted more observability and reliability complexity.

“less just Question and Answer and more action-based”article, stated
“expands capabilities quite a bit, enabling chatbots to access and utilize a wider range of data sources and perform various automated tasks”article, stated

Adopt LangSmith tracing

Chose Dedicated LangSmith debugging and evaluation over Console logs and ad hoc manual debugging.

Rationale: LangSmith integrated with their LangChain agent stack and exposed the run data needed to debug slow and incorrect tool behavior.

“Soon our development process was full of “console.logs” everywhere and high latency runs.”article, stated
“LangSmith's debugging tools have been a game-changer for us.”article, stated

Gotchas (what bit them)

Agent tools are hard to debug without trace-level visibility.

Root cause: Custom tools, AI-generated values, multiple resources, and production pipelines hide key decisions inside the agent loop.

Resolution: Use LangSmith tracing to inspect run hierarchy, parameters, response times, feedback, tokens, and tool inputs.

“Understanding the key interactions, decisions of an Agent loop can be quite tricky.”article, stated
“When we connected LangSmith to our tools & action module, we quickly spotted problems that we didn’t have the visibility for.”article, stated

Prompt bloat can hide inside a single slow model call.

Root cause: The Tools & Actions prompt had concatenated RAG prompts and sources, creating a massive prompt.

Resolution: Use trace latency to identify the slow call and reduce the prompt chunks used by Tools & Actions.

“When you click on the 7.23s Run we saw that the prompt was massive”article, stated
“reducing total latency overall”article, stated

AI-generated tool inputs depend heavily on tool descriptions.

Root cause: The AI fills request values from the user's question and schema at runtime.

Resolution: Inspect repeated tool runs in LangSmith, annotate failures, improve the AI-generated product surface, and instruct users to provide detailed tool descriptions.

“the AI can fill that value at request time with an ‘AI generated’ value based on the user's question and schema”article, stated
“made users aware that they need to provide good detailed descriptions when creating a Tool”article, stated

Evaluation

Mendable uses LangSmith traces for debugging and saves selected runs into datasets for further evaluation, with manual inspection of repeated tool executions and schema accuracy.

Metrics: tool input and schema accuracy · response time per model/tool call · feedback · token consumption · dataset coverage for future evaluation

3 supporting quotes
“the app captures and displays a detailed visualization of the runs’ call hierarchy”article, stated
“we ran the same tool with different queries ~20 times and quickly scrolled through LangSmith making sure the output and schema were accurate”article, stated
“With LangSmith we selected the runs that we wanted to add to our dataset and clicked the “Add to Dataset” button.”article, stated

Outcomes

Mendable reports a deployment to roughly 1,000 GTM users at a $20+ billion company, $1.3 million savings in five months, and projected $3 million annual savings; this is self-reported in a partner blog.

3 supporting quotes
“we equipped ~1000 customer success + sales people at a $20+ billion tech company with GTM assistants”article, stated
“In five months, the platform achieved $1.3 million in savings, and it's projected to save $3 million this year”article, stated
“Mendable Tools & Actions has launched but we are still early in the process.”article, stated