Skip to content

Commit 7957e65

Browse files
authored
Iterative improvements to OSS <> LangSmith (#1547)
This PR adds some clarification to the OSS docs for deployment and obs in LangSmith. There is likely more work to be done here, but this PR does the following: - Updates the nav to make the workflow of going from dev to production with LangSmith. - Updates some of the intros to that content to contextualize LangChain or LangGraph --> LangSmith. - More links!
1 parent d65b848 commit 7957e65

File tree

10 files changed

+104
-69
lines changed

10 files changed

+104
-69
lines changed

src/docs.json

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,17 @@
194194
]
195195
},
196196
{
197-
"group": "Use in production",
197+
"group": "Agent development",
198+
"pages": [
199+
"oss/python/langchain/studio",
200+
"oss/python/langchain/test",
201+
"oss/python/langchain/ui"
202+
]
203+
},
204+
{
205+
"group": "Deploy with LangSmith",
198206
"pages": [
199-
"oss/python/langchain/studio",
200-
"oss/python/langchain/test",
201207
"oss/python/langchain/deploy",
202-
"oss/python/langchain/ui",
203208
"oss/python/langchain/observability"
204209
]
205210
}
@@ -242,10 +247,10 @@
242247
"group": "Production",
243248
"pages": [
244249
"oss/python/langgraph/application-structure",
245-
"oss/python/langgraph/studio",
246250
"oss/python/langgraph/test",
247-
"oss/python/langgraph/deploy",
251+
"oss/python/langgraph/studio",
248252
"oss/python/langgraph/ui",
253+
"oss/python/langgraph/deploy",
249254
"oss/python/langgraph/observability"
250255
]
251256
},
@@ -530,12 +535,17 @@
530535
]
531536
},
532537
{
533-
"group": "Use in production",
538+
"group": "Agent development",
539+
"pages": [
540+
"oss/javascript/langchain/studio",
541+
"oss/javascript/langchain/test",
542+
"oss/javascript/langchain/ui"
543+
]
544+
},
545+
{
546+
"group": "Deploy with LangSmith",
534547
"pages": [
535-
"oss/javascript/langchain/studio",
536-
"oss/javascript/langchain/test",
537548
"oss/javascript/langchain/deploy",
538-
"oss/javascript/langchain/ui",
539549
"oss/javascript/langchain/observability"
540550
]
541551
}
@@ -578,10 +588,10 @@
578588
"group": "Production",
579589
"pages": [
580590
"oss/javascript/langgraph/application-structure",
581-
"oss/javascript/langgraph/studio",
582591
"oss/javascript/langgraph/test",
583-
"oss/javascript/langgraph/deploy",
592+
"oss/javascript/langgraph/studio",
584593
"oss/javascript/langgraph/ui",
594+
"oss/javascript/langgraph/deploy",
585595
"oss/javascript/langgraph/observability"
586596
]
587597
},

src/oss/langchain/deploy.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
---
2-
title: Deploy
2+
title: LangSmith Deployment
3+
sidebarTitle: Deployment
34
---
45

56
import deploy from '/snippets/oss/deploy.mdx';
67

7-
LangSmith is the fastest way to turn agents into production systems. Traditional hosting platforms are built for stateless, short-lived web apps, while LangGraph is **purpose-built for stateful, long-running agents**, so you can go from repo to reliable cloud deployment in minutes.
8+
When you're ready to deploy your LangChain agent to production, LangSmith provides a managed hosting platform designed for agent workloads. Traditional hosting platforms are built for stateless, short-lived web applications, while LangGraph is **purpose-built for stateful, long-running agents** that require persistent state and background execution. LangSmith handles the infrastructure, scaling, and operational concerns so you can deploy directly from your repository.
89

910
## Prerequisites
1011

1112
Before you begin, ensure you have the following:
1213

13-
* A [GitHub account](https://github.com/)
14-
* A [LangSmith account](https://smith.langchain.com/) (free to sign up)
14+
- A [GitHub account](https://github.com/)
15+
- A [LangSmith account](https://smith.langchain.com/) (free to sign up)
1516

1617
## Deploy your agent
1718

src/oss/langchain/observability.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
---
2-
title: Observability
2+
title: LangSmith Observability
3+
sidebarTitle: Observability
34
---
45

56
import observability from '/snippets/oss/observability.mdx';
67

7-
Observability is crucial for understanding how your agents behave in production. With LangChain's @[`create_agent`], you get built-in observability through [LangSmith](https://smith.langchain.com/) - a powerful platform for tracing, debugging, evaluating, and monitoring your LLM applications.
8+
As you build and run agents with LangChain, you need visibility into how they behave: which [tools](/oss/langchain/tools) they call, what prompts they generate, and how they make decisions. LangChain agents built with @[`create_agent`] automatically support tracing through [LangSmith](/langsmith/home), a platform for capturing, debugging, evaluating, and monitoring LLM application behavior.
89

9-
Traces capture every step your agent takes, from the initial user input to the final response, including all tool calls, model interactions, and decision points. This enables you to debug your agents, evaluate performance, and monitor usage.
10+
[_Traces_](/langsmith/observability-concepts#traces) record every step of your agent's execution, from the initial user input to the final response, including all tool calls, model interactions, and decision points. This execution data helps you debug issues, evaluate performance across different inputs, and monitor usage patterns in production.
11+
12+
This guide shows you how to enable tracing for your LangChain agents and use LangSmith to analyze their execution.
1013

1114
## Prerequisites
1215

1316
Before you begin, ensure you have the following:
1417

15-
* A [LangSmith account](https://smith.langchain.com/) (free to sign up)
18+
- **A LangSmith account**: Sign up (for free) or log in at [smith.langchain.com](https://smith.langchain.com).
19+
- **A LangSmith API key**: Follow the [Create an API key](/langsmith/create-account-api-key#create-an-api-key) guide.
1620

1721
## Enable tracing
1822

@@ -23,11 +27,7 @@ export LANGSMITH_TRACING=true
2327
export LANGSMITH_API_KEY=<your-api-key>
2428
```
2529

26-
<Info>
27-
You can get your API key from your [LangSmith settings](https://smith.langchain.com/settings).
28-
</Info>
29-
30-
## Quick start
30+
## Quickstart
3131

3232
No extra code is needed to log a trace to LangSmith. Just run your agent code as you normally would:
3333

src/oss/langchain/studio.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: Studio
2+
title: LangSmith Studio
3+
sidebarTitle: LangSmith Studio
34
---
45

56
import Studio from '/snippets/oss/studio.mdx';

src/oss/langgraph/application-structure.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: Application structure
33
---
44

5-
6-
7-
## Overview
8-
95
A LangGraph application consists of one or more graphs, a configuration file (`langgraph.json`), a file that specifies dependencies, and an optional `.env` file that specifies environment variables.
106

11-
This guide shows a typical structure of an application and shows how the required information to deploy an application using the LangSmith is specified.
7+
This guide shows a typical structure of an application and shows you how to provide the required configuration to deploy an application with [LangSmith Deployment](/langsmith/deployments).
8+
9+
<Info>
10+
LangSmith Deployment is a managed hosting platform for deploying and scaling LangGraph agents. It handles the infrastructure, scaling, and operational concerns so you can deploy your stateful, long-running agents directly from your repository. Learn more in the [Deployment documentation](/langsmith/deployments).
11+
</Info>
1212

1313
## Key Concepts
1414

src/oss/langgraph/deploy.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: Deploy
2+
title: LangSmith Deployment
33
---
44

55
import deploy from '/snippets/oss/deploy.mdx';
66

7-
LangSmith is the fastest way to turn agents into production systems. Traditional hosting platforms are built for stateless, short-lived web apps, while LangGraph is **purpose-built for stateful, long-running agents**, so you can go from repo to reliable cloud deployment in minutes.
7+
When you're ready to deploy your agent to production, LangSmith provides a managed hosting platform designed for agent workloads. Traditional hosting platforms are built for stateless, short-lived web applications, while LangGraph is **purpose-built for stateful, long-running agents** that require persistent state and background execution. LangSmith handles the infrastructure, scaling, and operational concerns so you can deploy directly from your repository.
88

99
## Prerequisites
1010

src/oss/langgraph/observability.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Observability
2+
title: LangSmith Observability
33
---
44

55
import observability from '/snippets/oss/observability.mdx';
@@ -15,7 +15,8 @@ Traces are a series of steps that your application takes to go from input to out
1515

1616
Before you begin, ensure you have the following:
1717

18-
* A [LangSmith account](https://smith.langchain.com/) (free to sign up)
18+
- **A LangSmith account**: Sign up (for free) or log in at [smith.langchain.com](https://smith.langchain.com).
19+
- **A LangSmith API key**: Follow the [Create an API key](/langsmith/create-account-api-key#create-an-api-key) guide.
1920

2021
## Enable tracing
2122

src/oss/langgraph/overview.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,19 @@ LangGraph provides low-level supporting infrastructure for *any* long-running, s
117117

118118
While LangGraph can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools for building agents. To improve your LLM application development, pair LangGraph with:
119119

120-
* [LangSmith](http://www.langchain.com/langsmith) — Helpful for agent evals and observability. Debug poor-performing LLM app runs, evaluate agent trajectories, gain visibility in production, and improve performance over time.
121-
* [LangGraph](/oss/langgraph/overview) — Deploy and scale agents effortlessly with a purpose-built deployment platform for long running, stateful workflows. Discover, reuse, configure, and share agents across teams — and iterate quickly with visual prototyping in [Studio](/langsmith/studio).
122-
* [LangChain](/oss/langchain/overview) - Provides integrations and composable components to streamline LLM application development. Contains agent abstractions built on top of LangGraph.
120+
<Columns cols={1}>
121+
<Card title="LangSmith" icon="chart-line" href="http://www.langchain.com/langsmith" arrow cta="Learn more">
122+
Trace requests, evaluate outputs, and monitor deployments in one place. Prototype locally with LangGraph, then move to production with integrated observability and evaluation to build more reliable agent systems.
123+
</Card>
124+
125+
<Card title="LangGraph" icon="server" href="/langsmith/agent-server" arrow cta="Learn more">
126+
Deploy and scale agents effortlessly with a purpose-built deployment platform for long running, stateful workflows. Discover, reuse, configure, and share agents across teams — and iterate quickly with visual prototyping in Studio.
127+
</Card>
128+
129+
<Card title="LangChain" icon="link" href="/oss/langchain/overview" arrow cta="Learn more">
130+
Provides integrations and composable components to streamline LLM application development. Contains agent abstractions built on top of LangGraph.
131+
</Card>
132+
</Columns>
123133

124134
## Acknowledgements
125135

src/oss/langgraph/studio.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Studio
2+
title: LangSmith Studio
33
---
44

55
import Studio from '/snippets/oss/studio.mdx';

src/snippets/oss/studio.mdx

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
This guide will walk you through how to use **Studio** to visualize, interact, and debug your agent locally.
1+
When building agents with LangChain locally, it's helpful to visualize what's happening inside your agent, interact with it in real-time, and debug issues as they occur. **LangSmith Studio** is a free visual interface for developing and testing your LangChain agents from your local machine.
22

3-
Studio is our free-to-use, powerful agent IDE that integrates with [LangSmith](/langsmith/home) to enable tracing, evaluation, and prompt engineering. See exactly how your agent thinks, trace every decision, and ship smarter, more reliable agents.
3+
Studio connects to your locally running agent to show you each step your agent takes: the prompts sent to the model, tool calls and their results, and the final output. You can test different inputs, inspect intermediate states, and iterate on your agent's behavior without additional code or deployment.
44

5-
<Frame>
6-
<iframe
7-
className="w-full aspect-video rounded-xl"
8-
src="https://www.youtube.com/embed/Mi1gSlHwZLM?si=zA47TNuTC5aH0ahd"
9-
title="Studio"
10-
frameBorder="0"
11-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
12-
allowFullScreen
13-
></iframe>
14-
</Frame>
5+
This pages describes how to set up Studio with your local LangChain agent.
156

167
## Prerequisites
178

189
Before you begin, ensure you have the following:
19-
* An API key for [LangSmith](https://smith.langchain.com/settings) (free to sign up)
2010

21-
## Setup local Agent server
11+
- **A LangSmith account**: Sign up (for free) or log in at [smith.langchain.com](https://smith.langchain.com).
12+
- **A LangSmith API key**: Follow the [Create an API key](/langsmith/create-account-api-key#create-an-api-key) guide.
13+
- If you don't want data [traced](/langsmith/observability-concepts#traces) to LangSmith, set `LANGSMITH_TRACING=false` in your application's `.env` file. With tracing disabled, no data leaves your local server.
14+
15+
## Set up local Agent server
2216

2317
### 1. Install the LangGraph CLI
2418

19+
The [LangGraph CLI](/langsmith/cli) provides a local development server (also called [Agent Server](/langsmith/agent-server)) that connects your agent to Studio.
20+
2521
:::python
2622
```shell
2723
# Python >= 3.11 is required.
@@ -37,7 +33,7 @@ npx @langchain/langgraph-cli
3733

3834
### 2. Prepare your agent
3935

40-
We'll use the following simple agent as an example:
36+
If you already have a LangChain agent, you can use it directly. This example uses a simple email agent:
4137

4238
```python title="agent.py"
4339
from langchain.agents import create_agent
@@ -62,10 +58,10 @@ agent = create_agent(
6258

6359
### 3. Environment variables
6460

65-
Create a `.env` file in the root of your project and fill in the necessary API keys. We'll need to set the `LANGSMITH_API_KEY` environment variable to the API key you get from [LangSmith](https://smith.langchain.com/settings).
61+
Studio requires a LangSmith API key to connect your local agent. Create a `.env` file in the root of your project and add your API key from [LangSmith](https://smith.langchain.com/settings).
6662

6763
<Warning>
68-
Be sure not to commit your `.env` to version control systems such as Git!
64+
Ensure your `.env` file is not committed to version control, such as Git.
6965
</Warning>
7066

7167
```bash .env
@@ -74,7 +70,7 @@ LANGSMITH_API_KEY=lsv2...
7470

7571
### 4. Create a LangGraph config file
7672

77-
Inside your app's directory, create a configuration file `langgraph.json`:
73+
The LangGraph CLI uses a configuration file to locate your agent and manage dependencies. Create a `langgraph.json` file in your app's directory:
7874

7975
```json title="langgraph.json"
8076
{
@@ -86,13 +82,13 @@ Inside your app's directory, create a configuration file `langgraph.json`:
8682
}
8783
```
8884

89-
@[`create_agent`] automatically returns a compiled LangGraph graph that we can pass to the `graphs` key in our configuration file.
85+
The @[`create_agent`] function automatically returns a compiled LangGraph graph, which is what the `graphs` key expects in the configuration file.
9086

9187
<Info>
92-
See the [LangGraph configuration file reference](/langsmith/cli#configuration-file) for detailed explanations of each key in the JSON object of the configuration file.
88+
For detailed explanations of each key in the JSON object of the configuration file, refer to the [LangGraph configuration file reference](/langsmith/cli#configuration-file).
9389
</Info>
9490

95-
So far, our project structure looks like this:
91+
At this point, the project structure will look like this:
9692

9793
```bash
9894
my-app/
@@ -105,7 +101,7 @@ my-app/
105101
### 5. Install dependencies
106102

107103
:::python
108-
In the root of your new LangGraph app, install the dependencies:
104+
Install your project dependencies from the root directory:
109105

110106
<CodeGroup>
111107
```shell pip
@@ -125,7 +121,7 @@ yarn install
125121

126122
### 6. View your agent in Studio
127123

128-
Start your Agent server:
124+
Start the development server to connect your agent to Studio:
129125

130126
:::python
131127
```shell
@@ -143,18 +139,34 @@ npx @langchain/langgraph-cli dev
143139
Safari blocks `localhost` connections to Studio. To work around this, run the above command with `--tunnel` to access Studio via a secure tunnel.
144140
</Warning>
145141

146-
Your agent will be accessible via API (`http://127.0.0.1:2024`) and the Studio UI `https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024`:
142+
Once the server is running, your agent is accessible both via API at `http://127.0.0.1:2024` and through the Studio UI at `https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024`:
147143

148144
<Frame>
149145
![Agent view in the Studio UI](/oss/images/studio_create-agent.png)
150146
</Frame>
151147

152-
Studio makes each step of your agent easily observable. Replay any input and inspect the exact prompt, tool arguments, return values, and token/latency metrics. If a tool throws an exception, Studio records it with surrounding state so you can spend less time debugging.
148+
With Studio connected to your local agent, you can iterate quickly on your agent's behavior. Run a test input, inspect the full execution trace including prompts, tool arguments, return values, and token/latency metrics. When something goes wrong, Studio captures exceptions with the surrounding state to help you understand what happened.
153149

154-
Keep your dev server running, edit prompts or tool signatures, and watch Studio hot-reload. Re-run the conversation thread from any step to verify behavior changes. See [Manage threads](/langsmith/use-studio#edit-thread-history) for more details.
150+
The development server supports hot-reloading—make changes to prompts or tool signatures in your code, and Studio reflects them immediately. Re-run conversation threads from any step to test your changes without starting over. This workflow scales from simple single-tool agents to complex multi-node graphs.
155151

156-
As your agent grows, the same view scales from a single-tool demo to multi-node graphs, keeping decisions legible and reproducible.
152+
For more information on how to run Studio, refer to the following guides in the [LangSmith docs](/langsmith/home):
157153

158-
<Tip>
159-
For an in-depth look at Studio, check out the [overview page](/langsmith/studio).
160-
</Tip>
154+
- [Run application](/langsmith/use-studio#run-application)
155+
- [Manage assistants](/langsmith/use-studio#manage-assistants)
156+
- [Manage threads](/langsmith/use-studio#manage-threads)
157+
- [Iterate on prompts](/langsmith/observability-studio)
158+
- [Debug LangSmith traces](/langsmith/observability-studio#debug-langsmith-traces)
159+
- [Add node to dataset](/langsmith/observability-studio#add-node-to-dataset)
160+
161+
## Video guide
162+
163+
<Frame>
164+
<iframe
165+
className="w-full aspect-video rounded-xl"
166+
src="https://www.youtube.com/embed/Mi1gSlHwZLM?si=zA47TNuTC5aH0ahd"
167+
title="Studio"
168+
frameBorder="0"
169+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
170+
allowFullScreen
171+
></iframe>
172+
</Frame>

0 commit comments

Comments
 (0)