You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://langgraph-studio.vercel.app/templates/open?githubUrl=https://github.com/langchain-ai/new-langgraph-project)
6
5
7
-
This template demonstrates a simple chatbot implemented using [LangGraph](https://github.com/langchain-ai/langgraph), designed for [LangGraph Studio](https://github.com/langchain-ai/langgraph-studio). The chatbot maintains persistent chat memory, allowing for coherent conversations across multiple interactions.
6
+
This template demonstrates a simple application implemented using [LangGraph](https://github.com/langchain-ai/langgraph), designed for showing how to get started with [LangGraph Server](https://langchain-ai.github.io/langgraph/concepts/langgraph_server/#langgraph-server) and using [LangGraph Studio](https://langchain-ai.github.io/langgraph/concepts/langgraph_studio/), a visual debugging IDE.
8
7
9
-

8
+
<divalign="center">
9
+
<imgsrc="./static/studio_ui.png"alt="Graph view in LangGraph studio UI"width="75%" />
10
+
</div>
10
11
11
-
The core logic, defined in `src/agent/graph.py`, showcases a straightforward chatbot that responds to user queries while maintaining context from previous messages.
12
+
The core logic defined in `src/agent/graph.py`, showcases an single-step application that responds with a fixed string and the configuration provided.
12
13
13
-
## What it does
14
+
You can extend this graph to orchestrate more complex agentic workflows that can be visualized and debugged in LangGraph Studio.
14
15
15
-
The simple chatbot:
16
+
## Getting Started
16
17
17
-
1. Takes a user **message** as input
18
-
2. Maintains a history of the conversation
19
-
3. Generates a response based on the current message and conversation history
20
-
4. Updates the conversation history with the new interaction
18
+
<!--
19
+
Setup instruction auto-generated by `langgraph template lock`. DO NOT EDIT MANUALLY.
20
+
-->
21
21
22
-
This template provides a foundation that can be easily customized and extended to create more complex conversational agents.
22
+
<!--
23
+
End setup instructions
24
+
-->
23
25
24
-
## Getting Started
26
+
1. Install dependencies, along with the [LangGraph CLI](https://langchain-ai.github.io/langgraph/concepts/langgraph_cli/), which will be used to run the server.
25
27
26
-
Assuming you have already [installed LangGraph Studio](https://github.com/langchain-ai/langgraph-studio?tab=readme-ov-file#download), to set up:
28
+
```bash
29
+
cd path/to/your/app
30
+
pip install -e ."langgraph-cli[inmem]"
31
+
```
27
32
28
-
1.Create a `.env` file.
33
+
2. (Optional) Customize the code and project as needed. Create a `.env` file if you need to use secrets.
29
34
30
35
```bash
31
36
cp .env.example .env
32
37
```
33
38
34
-
2. Define required API keys in your `.env` file.
35
-
36
-
<!--
37
-
Setup instruction auto-generated by `langgraph template lock`. DO NOT EDIT MANUALLY.
38
-
-->
39
+
If you want to enable LangSmith tracing, add your LangSmith API key to the `.env` file.
39
40
41
+
```text
42
+
# .env
43
+
LANGSMITH_API_KEY=lsv2...
44
+
```
40
45
46
+
3. Start the LangGraph Server.
41
47
42
-
<!--
43
-
End setup instructions
44
-
-->
48
+
```shell
49
+
langgraph dev
50
+
```
45
51
46
-
3. Customize the code as needed.
47
-
4. Open the folder in LangGraph Studio!
52
+
For more information on getting started with LangGraph Server, [see here](https://langchain-ai.github.io/langgraph/tutorials/langgraph-platform/local-server/).
48
53
49
54
## How to customize
50
55
51
-
1.**Modify the system prompt**: The default system prompt is defined in [configuration.py](./src/agent/configuration.py). You can easily update this via configuration in the studio to change the chatbot's personality or behavior.
52
-
2.**Select a different model**: We default to Anthropic's Claude 3 Sonnet. You can select a compatible chat model using `provider/model-name` via configuration. Example: `openai/gpt-4-turbo-preview`.
53
-
3.**Extend the graph**: The core logic of the chatbot is defined in [graph.py](./src/agent/graph.py). You can modify this file to add new nodes, edges, or change the flow of the conversation.
54
-
55
-
You can also quickly extend this template by:
56
+
1.**Define configurable parameters**: Modify the `Configuration` class in the `graph.py` file to expose the arguments you want to configure. For example, in a chatbot application you may want to define a dynamic system prompt or LLM to use. For more information on configurations in LangGraph, [see here](https://langchain-ai.github.io/langgraph/concepts/low_level/?h=configuration#configuration).
56
57
57
-
- Adding custom tools or functions to enhance the chatbot's capabilities.
58
-
- Implementing additional logic for handling specific types of user queries or tasks.
59
-
- Integrating external APIs or databases to provide more dynamic responses.
58
+
2.**Extend the graph**: The core logic of the application is defined in [graph.py](./src/agent/graph.py). You can modify this file to add new nodes, edges, or change the flow of information.
60
59
61
60
## Development
62
61
63
-
While iterating on your graph, you can edit past state and rerun your app from previous states to debug specific nodes. Local changes will be automatically applied via hot reload. Try experimenting with:
62
+
While iterating on your graph in LangGraph Studio, you can edit past state and rerun your app from previous states to debug specific nodes. Local changes will be automatically applied via hot reload.
64
63
65
-
- Modifying the system prompt to give your chatbot a unique personality.
66
-
- Adding new nodes to the graph for more complex conversation flows.
67
-
- Implementing conditional logic to handle different types of user inputs.
64
+
Follow-up requests extend the same thread. You can create an entirely new thread, clearing previous history, using the `+` button in the top right.
68
65
69
-
Follow-up requests will be appended to the same thread. You can create an entirely new thread, clearing previous history, using the `+` button in the top right.
70
-
71
-
For more advanced features and examples, refer to the [LangGraph documentation](https://github.com/langchain-ai/langgraph). These resources can help you adapt this template for your specific use case and build more sophisticated conversational agents.
66
+
For more advanced features and examples, refer to the [LangGraph documentation](https://langchain-ai.github.io/langgraph/). These resources can help you adapt this template for your specific use case and build more sophisticated conversational agents.
72
67
73
68
LangGraph Studio also integrates with [LangSmith](https://smith.langchain.com/) for more in-depth tracing and collaboration with teammates, allowing you to analyze and optimize your chatbot's performance.
74
69
@@ -82,4 +77,4 @@ Configuration auto-generated by `langgraph template lock`. DO NOT EDIT MANUALLY.
0 commit comments