Skip to content

Commit

Permalink
docs: get started with langgraph platform (#2469)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyurtsev authored Nov 21, 2024
1 parent 7082e26 commit 5559344
Show file tree
Hide file tree
Showing 7 changed files with 307 additions and 49 deletions.
6 changes: 3 additions & 3 deletions docs/docs/cloud/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ If you want to learn how to build an agent like this from scratch, take a look a

This tutorial will use:

- Anthropic for the LLM - sign up and get an API key [here](https://console.anthropic.com/)
- Tavily for the search engine - sign up and get an API key [here](https://app.tavily.com/)
- LangSmith for hosting - sign up and get an API key [here](https://smith.langchain.com/)
- Anthropic for the LLM - sign up and get an API key [here](https://console.anthropic.com/).
- Tavily for the search engine - sign up and get an API key [here](https://app.tavily.com/).
- LangSmith for hosting - sign up and get an API key [here](https://smith.langchain.com/).

## Create and configure your app

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/concepts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The conceptual guide does not cover step-by-step instructions or specific implem
- [Streaming](streaming.md): Streaming is crucial for enhancing the responsiveness of applications built on LLMs. By displaying output progressively, even before a complete response is ready, streaming significantly improves user experience (UX), particularly when dealing with the latency of LLMs.
- [FAQ](faq.md): Frequently asked questions about LangGraph.

## LangGraph Platform
## LangGraph Platform

LangGraph Platform is a commercial solution for deploying agentic applications in production, built on the open-source LangGraph framework.

Expand Down
22 changes: 10 additions & 12 deletions docs/docs/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@ title: Tutorials

# Tutorials

Welcome to the LangGraph Tutorials! These notebooks introduce LangGraph through building various language agents and applications.
New to LangGraph or LLM app development? Read this material to get up and running building your first applications.

## Quick Start
## Get Started 🚀 {#quick-start}

Learn the basics of LangGraph through a comprehensive quick start in which you will build an agent from scratch.
- [LangGraph Quickstart](introduction.ipynb): Build a chatbot that can use tools and keep track of conversation history. Add human-in-the-loop capabilities and explore how time-travel works.
- [LangGraph Server Quickstart](langgraph-platform/local-server.md): Launch a LangGraph server locally and interact with it using the REST API and LangGraph Studio Web UI.
- [LangGraph Cloud QuickStart](../cloud/quick_start.md): Deploy a LangGraph app using LangGraph Cloud.

- [Quick Start](introduction.ipynb): In this tutorial, you will build a support chatbot using LangGraph.
- [LangGraph Cloud Quick Start](../cloud/quick_start.md): In this tutorial, you will build and deploy an agent to LangGraph Cloud.
## Use cases 🛠️

## Use cases

Learn from example implementations of graphs designed for specific scenarios and that implement common design patterns.
Explore practical implementations tailored for specific scenarios:

### Chatbots

- [Customer Support](customer-support/customer-support.ipynb): Build a customer support chatbot to manage flights, hotel reservations, car rentals, and other tasks
- [Prompt Generation from User Requirements](chatbots/information-gather-prompting.ipynb): Build an information gathering chatbot
- [Code Assistant](code_assistant/langgraph_code_assistant.ipynb): Build a code analysis and generation assistant

- [Customer Support](customer-support/customer-support.ipynb): Build a multi-functional support bot for flights, hotels, and car rentals.
- [Prompt Generation from User Requirements](chatbots/information-gather-prompting.ipynb): Build an information gathering chatbot.
- [Code Assistant](code_assistant/langgraph_code_assistant.ipynb): Build a code analysis and generation assistant.

### RAG

Expand Down
77 changes: 46 additions & 31 deletions docs/docs/tutorials/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"id": "4a1aae78-88a6-4133-b905-7e46c8e3772f",
"metadata": {},
"source": [
"# LangGraph Quick Start\n",
"# 🚀 LangGraph Quick Start\n",
"\n",
"In this comprehensive quick start, we will build a support chatbot in LangGraph that can:\n",
"In this tutorial, we will build a support chatbot in LangGraph that can:\n",
"\n",
"- Answer common questions by searching the web\n",
"- Maintain conversation state across calls\n",
"- Route complex queries to a human for review\n",
"- Use custom state to control its behavior\n",
"- Rewind and explore alternative conversation paths\n",
"✅ **Answer common questions** by searching the web \n",
"✅ **Maintain conversation state** across calls \n",
"✅ **Route complex queries** to a human for review \n",
"✅ **Use custom state** to control its behavior \n",
"✅ **Rewind and explore** alternative conversation paths \n",
"\n",
"We'll start with a basic chatbot and progressively add more sophisticated capabilities, introducing key LangGraph concepts along the way.\n",
"We'll start with a **basic chatbot** and progressively add more sophisticated capabilities, introducing key LangGraph concepts along the way. Let’s dive in! 🌟\n",
"\n",
"## Setup\n",
"\n",
Expand All @@ -38,7 +38,7 @@
"id": "a6d1e870-1bc0-4d44-86c0-96681ccf6113",
"metadata": {},
"source": [
"Next, set your API keys:"
"In this tutorial, we'll be "
]
},
{
Expand Down Expand Up @@ -120,27 +120,24 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "31c755cd-8994-4867-bdff-96a55d7beae7",
"metadata": {},
"source": [
"<div class=\"admonition tip\">\n",
" <p class=\"admonition-title\">Note</p>\n",
" <p>\n",
" The first thing you do when you define a graph is define the <code>State</code> of the graph. The <code>State</code> consists of the schema of the graph as well as <a href=\"https://langchain-ai.github.io/langgraph/concepts/low_level/#reducers\">reducer functions</a> which specify how to apply updates to the state. In our example <code>State</code> is a <code>TypedDict</code> with a single key: <code>messages</code>. The <code>messages</code> key is annotated with the <a href=\"https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.message.add_messages\"><code>add_messages</code></a> reducer function, which tells LangGraph to append new messages to the existing list, rather than overwriting it. State keys without an annotation will be overwritten by each update, storing the most recent value. Check out <a href=\"https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.message.add_messages\">this conceptual guide</a> to learn more about state, reducers and other low-level concepts.\n",
" </p>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "4137feed-746e-4c72-a34a-f7a699ad5dcf",
"id": "c08c41da-0855-49d3-9a3d-b7eb94413367",
"metadata": {},
"source": [
"So now our graph knows two things:\n",
"Our graph can now handle two key tasks:\n",
"\n",
"1. Each `node` can receive the current `State` as input and output an update to the state.\n",
"2. Updates to `messages` will be appended to the existing list rather than overwriting it, thanks to the prebuilt [`add_messages`](https://langchain-ai.github.io/langgraph/reference/graphs/?h=add+messages#add_messages) function used with the `Annotated` syntax.\n",
"\n",
"------\n",
"\n",
"!!! tip \"Concept\"\n",
"\n",
" When defining a graph, the first step is to define its `State`. The `State` includes the graph's schema and [reducer functions](https://langchain-ai.github.io/langgraph/concepts/low_level/#reducers) that handle state updates. In our example, `State` is a `TypedDict` with one key: `messages`. The [`add_messages`](https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.message.add_messages) reducer function is used to append new messages to the list instead of overwriting it. Keys without a reducer annotation will overwrite previous values. Learn more about state, reducers, and related concepts in [this guide](https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.message.add_messages).\n",
"\n",
"---------\n",
"\n",
"1. Every `node` we define will receive the current `State` as input and return a value that updates that state.\n",
"2. `messages` will be _appended_ to the current list, rather than directly overwritten. This is communicated via the prebuilt [`add_messages`](https://langchain-ai.github.io/langgraph/reference/graphs/?h=add+messages#add_messages) function in the `Annotated` syntax.\n",
"\n",
"Next, add a \"`chatbot`\" node. Nodes represent units of work. They are typically regular python functions."
]
Expand Down Expand Up @@ -365,7 +362,7 @@
"id": "f22c5d4a-3134-413c-81fe-dd9752fbeb66",
"metadata": {},
"source": [
"## Part 2: Enhancing the Chatbot with Tools\n",
"## Part 2: 🛠️ Enhancing the Chatbot with Tools\n",
"\n",
"To handle queries our chatbot can't answer \"from memory\", we'll integrate a web search tool. Our bot can use this tool to find relevant information and provide better responses.\n",
"\n",
Expand Down Expand Up @@ -3136,11 +3133,29 @@
"id": "e584d57f-5aad-4507-815f-0b2e4b64b791",
"metadata": {},
"source": [
"## Conclusion\n",
"## Next Steps\n",
"\n",
"Take your journey further by exploring deployment and advanced features:\n",
"\n",
"### Server Quickstart\n",
"\n",
"- **[LangGraph Server Quickstart](../langgraph-platform/local-server)**: Launch a LangGraph server locally and interact with it using the REST API and LangGraph Studio Web UI.\n",
"\n",
"### LangGraph Cloud\n",
"\n",
"- **[LangGraph Cloud QuickStart](../../cloud/quick_start)**: Deploy your LangGraph app using LangGraph Cloud.\n",
"\n",
"### LangGraph Framework\n",
"\n",
"- **[LangGraph Concepts](../../concepts)**: Learn the foundational concepts of LangGraph. \n",
"- **[LangGraph How-to Guides](../../how-tos)**: Guides for common tasks with LangGraph.\n",
"\n",
"### LangGraph Platform\n",
"\n",
"Congrats! You've completed the intro tutorial and built a chat bot in LangGraph that supports tool calling, persistent memory, human-in-the-loop interactivity, and even time-travel!\n",
"Expand your knowledge with these resources:\n",
"\n",
"The [LangGraph documentation](https://langchain-ai.github.io/langgraph/) is a great resource for diving deeper into the library's capabilities."
"- **[LangGraph Platform Concepts](../../concepts#langgraph-platform)**: Understand the foundational concepts of the LangGraph Platform. \n",
"- **[LangGraph Platform How-to Guides](../../how-tos#langgraph-platform)**: Guides for common tasks with LangGraph Platform. "
]
}
],
Expand All @@ -3160,7 +3175,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 5559344

Please sign in to comment.