Skip to content

Commit 241712d

Browse files
committed
Provide use cases + assistant id clarifications in LS deployments docs
1 parent 324c917 commit 241712d

File tree

2 files changed

+455
-277
lines changed

2 files changed

+455
-277
lines changed

src/langsmith/assistants.mdx

Lines changed: 99 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Assistants
33
sidebarTitle: Overview
44
---
55

6-
**Assistants** allow you to manage configurations (like prompts, LLM selection, tools) separately from your graph's core logic, enabling rapid changes that don't alter the graph architecture. It is a way to create multiple specialized versions of the same graph architecture, each optimized for different use cases through configuration variations rather than structural changes.
6+
_Assistants_ allow you to manage configurations (like prompts, LLM selection, tools) separately from your graph's core logic, enabling rapid changes that don't alter the graph architecture. It is a way to create multiple specialized versions of the same graph architecture, each optimized for different [use cases](#when-to-use-assistants) through configuration variations rather than structural changes.
77

88
For example, imagine a general-purpose writing agent built on a common graph architecture. While the structure remains the same, different writing styles—such as blog posts and tweets—require tailored configurations to optimize performance. To support these variations, you can create multiple assistants (e.g., one for blogs and another for tweets) that share the underlying graph but differ in model selection and system prompt.
99

@@ -12,27 +12,116 @@ For example, imagine a general-purpose writing agent built on a common graph arc
1212
The LangGraph API provides several endpoints for creating and managing assistants and their versions. See the [API reference](https://langchain-ai.github.io/langgraph/cloud/reference/api/api_ref/#tag/assistants) for more details.
1313

1414
<Info>
15-
Assistants are a [LangSmith](/langsmith/home) concept. They are not available in the open source LangGraph library.
15+
Assistants are a [LangSmith Deployment](/langsmith/deployments) concept. They are not available in the open source LangGraph library.
1616
</Info>
1717

18-
## Configuration
18+
## When to use assistants
19+
20+
Assistants are ideal when you need to deploy the same graph logic with different configurations. Common use cases include:
21+
22+
- **User-level personalization**
23+
- Customize model selection, system prompts, or tool availability per user.
24+
- Store user preferences and apply them automatically to each interaction.
25+
- Enable users to choose between different AI personalities or expertise levels.
26+
27+
- **Customer or organization-specific configurations**
28+
- Maintain separate configurations for different customers or organizations.
29+
- Customize behavior for each client without deploying separate infrastructure.
30+
- Isolate configuration changes to specific customers.
31+
32+
```mermaid
33+
graph TD
34+
A["Graph: agent<br/>(deployed)"]
35+
A --> B["Customer A Assistant<br/>━━━━━━━━━━━━━<br/>Model: GPT-4<br/>Tone: Legal<br/>Tools: Custom"]
36+
A --> C["Customer B Assistant<br/>━━━━━━━━━━━━━<br/>Model: Claude<br/>Tone: Casual<br/>Tools: Standard"]
37+
A --> D["Customer C Assistant<br/>━━━━━━━━━━━━━<br/>Model: GPT-3.5<br/>Tone: Formal<br/>Tools: Limited"]
38+
39+
style A fill:#4A90E2,stroke:#2E5C8A,stroke-width:3px,color:#fff
40+
style B fill:#E8F4F8,stroke:#4A90E2,stroke-width:2px
41+
style C fill:#E8F4F8,stroke:#4A90E2,stroke-width:2px
42+
style D fill:#E8F4F8,stroke:#4A90E2,stroke-width:2px
43+
```
44+
45+
- **Environment-specific configurations**
46+
- Use different models or settings for development, staging, and production.
47+
- Test configuration changes in staging before promoting to production.
48+
- Reduce costs in non-production environments with smaller models.
49+
50+
- **A/B testing and experimentation**
51+
- Compare different prompts, models, or parameter settings.
52+
- Roll out configuration changes gradually to a subset of users.
53+
- Measure performance differences between configuration variants.
54+
55+
- **Specialized task variants**
56+
- Create domain-specific versions of a general-purpose agent.
57+
- Optimize configurations for different languages, regions, or industries.
58+
- Maintain consistent graph logic while varying the execution details.
59+
60+
```mermaid
61+
graph TD
62+
A["Graph: writing-agent<br/>(deployed)"]
63+
A --> B["Blog Assistant<br/>━━━━━━━━━━━━━<br/>Model: GPT-4<br/>Tone: Formal<br/>Style: Long-form<br/>Tools: SEO optimization"]
64+
A --> C["Tweet Assistant<br/>━━━━━━━━━━━━━<br/>Model: GPT-4-mini<br/>Tone: Casual<br/>Style: 280-char limit<br/>Tools: Hashtag suggestions"]
65+
A --> D["Email Assistant<br/>━━━━━━━━━━━━━<br/>Model: GPT-4<br/>Tone: Professional<br/>Style: Medium length<br/>Tools: Templates"]
66+
67+
style A fill:#4A90E2,stroke:#2E5C8A,stroke-width:3px,color:#fff
68+
style B fill:#E8F4F8,stroke:#4A90E2,stroke-width:2px
69+
style C fill:#E8F4F8,stroke:#4A90E2,stroke-width:2px
70+
style D fill:#E8F4F8,stroke:#4A90E2,stroke-width:2px
71+
```
72+
73+
## How assistants work with deployments
74+
75+
When you deploy a graph with LangSmith Deployment, [Agent Server](/langsmith/agent-server) automatically creates a **default assistant** tied to that graph's default configuration. You can then create additional assistants for the same graph, each with its own configuration.
76+
77+
Assistants have several key features:
78+
79+
- **[Managed via API and UI](/langsmith/configuration-cloud)**: Create, list, update, version, and select assistants using the Agent Server/LangGraph SDKs or the [LangSmith UI](https://smith.langchain.com).
80+
- **One graph, multiple assistants**: A single deployed graph can support multiple assistants, each with different configurations (e.g., prompts, models, tools).
81+
- **[Versioned](#versioning) configurations**: Each assistant maintains its own configuration history through versioning. Editing an assistant creates a new version, and you can promote or roll back to any version.
82+
- **[Configuration](#configuration) updates without graph changes**: Update prompts, model selection, and other settings through assistant configurations, enabling rapid iteration without modifying or redeploying your graph code.
83+
84+
<Note>
85+
When invoking a run, you can specify either:
86+
- A **graph name** (e.g., `"agent"`): Uses the default assistant for that graph
87+
- An **assistant ID** (UUID): Uses a specific assistant configuration
88+
89+
This flexibility allows you to quickly test with default settings or precisely control which configuration is used.
90+
</Note>
91+
92+
### Configuration
1993

2094
Assistants build on the LangGraph open source concept of [configuration](/oss/langgraph/graph-api#runtime-context).
2195

22-
While configuration is available in the open source LangGraph library, assistants are only present in [LangSmith](/langsmith/home). This is due to the fact that assistants are tightly coupled to your deployed graph. Upon deployment, Agent Server will automatically create a default assistant for each graph using the graph's default configuration settings.
96+
While configuration is available in the open source LangGraph library, assistants are only present in [LangSmith Deployment](/langsmith/deployments) because they are tightly coupled to your deployed graph. Upon deployment, [Agent Server](/langsmith/agent-server) will automatically create a default assistant for each graph using the graph's default configuration settings.
2397

2498
In practice, an assistant is just an _instance_ of a graph with a specific configuration. Therefore, multiple assistants can reference the same graph but can contain different configurations (e.g. prompts, models, tools). The LangSmith Deployment API provides several endpoints for creating and managing assistants. See the [API reference](https://langchain-ai.github.io/langgraph/cloud/reference/api/api_ref/) and [this how-to](/langsmith/configuration-cloud) for more details on how to create assistants.
2599

26-
## Versioning
100+
### Versioning
101+
102+
Assistants support versioning to track changes over time. Once you've created an assistant, subsequent edits will automatically create new versions.
103+
104+
- Each update creates a new version of the assistant.
105+
- You can promote any version to be the active version.
106+
- Rolling back to a previous version is as simple as setting it as active.
107+
- All versions remain available for reference and rollback.
108+
109+
<Warning>
110+
When updating an assistant, you must provide the entire configuration payload. The update endpoint creates new versions from scratch and does not merge with previous versions. Make sure to include all configuration fields you want to retain.
111+
</Warning>
112+
113+
For more details on how to manage assistant versions, refer to the [Manage assistants guide](/langsmith/configuration-cloud#create-a-new-version-for-your-assistant).
27114

28-
Assistants support versioning to track changes over time.
29-
Once you've created an assistant, subsequent edits to that assistant will create new versions. See [this how-to](/langsmith/configuration-cloud#create-a-new-version-for-your-assistant) for more details on how to manage assistant versions.
115+
### Execution
30116

31-
## Execution
117+
A _run_ is an invocation of an assistant. When you execute a run, you specify which assistant to use (either by graph name for the default assistant or by assistant ID for a specific configuration).
32118

33-
A **run** is an invocation of an assistant. Each run may have its own input, configuration, and metadata, which may affect execution and output of the underlying graph. A run can optionally be executed on a [thread](/oss/langgraph/persistence#threads).
119+
- Each run may have its own input, configuration overrides, and metadata.
120+
- Runs can be stateless (no thread) or stateful (executed on a [thread](/oss/langgraph/persistence#threads) for conversation persistence).
121+
- Multiple runs can use the same assistant configuration.
122+
- The assistant's configuration affects how the underlying graph executes.
34123

35-
LangSmith API provides several endpoints for creating and managing runs. See the [API reference](https://langchain-ai.github.io/langgraph/cloud/reference/api/api_ref/) for more details.
124+
The LangSmith API provides several endpoints for creating and managing runs. For more details, refer to the [API reference](https://langchain-ai.github.io/langgraph/cloud/reference/api/api_ref/).
36125

37126
## Video guide
38127

0 commit comments

Comments
 (0)