From f0572b8703ecb0ac9c3200e7f72bf4d116a3e748 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Mon, 11 Nov 2024 18:19:35 -0800 Subject: [PATCH 1/2] Add breadcrumbs --- docs/docs/concepts/index.md | 14 +- docs/docs/how-tos/index.md | 36 +++--- docs/mkdocs.yml | 158 +++++++++++++++++++++-- docs/overrides/main.html | 4 + examples/how-tos/stream-tokens.ipynb | 6 +- examples/how-tos/streaming-content.ipynb | 4 +- 6 files changed, 180 insertions(+), 42 deletions(-) diff --git a/docs/docs/concepts/index.md b/docs/docs/concepts/index.md index e82654ea..44edf515 100644 --- a/docs/docs/concepts/index.md +++ b/docs/docs/concepts/index.md @@ -15,11 +15,11 @@ The conceptual guide does not cover step-by-step instructions or specific implem ## LangGraph -**High Level** +### High Level - [Why LangGraph?](high_level.md): A high-level overview of LangGraph and its goals. -**Concepts** +### Concepts - [LangGraph Glossary](low_level.md): LangGraph workflows are designed as graphs, with nodes representing different components and edges representing the flow of information between them. This guide provides an overview of the key concepts associated with LangGraph graph primitives. - [Common Agentic Patterns](agentic_concepts.md): An agent uses an LLM to pick its own control flow to solve more complex problems! Agents are a key building block in many LLM applications. This guide explains the different types of agent architectures and how they can be used to control the flow of an application. @@ -41,14 +41,14 @@ The LangGraph Platform offers a few different deployment options described in th * LangGraph is an MIT-licensed open-source library, which we are committed to maintaining and growing for the community. * You can always deploy LangGraph applications on your own infrastructure using the open-source LangGraph project without using LangGraph Platform. -**High Level** +### High Level - [Why LangGraph Platform?](./langgraph_platform.md): The LangGraph platform is an opinionated way to deploy and manage LangGraph applications. This guide provides an overview of the key features and concepts behind LangGraph Platform. - [Deployment Options](./deployment_options.md): LangGraph Platform offers four deployment options: [Self-Hosted Lite](./self_hosted.md#self-hosted-lite), [Self-Hosted Enterprise](./self_hosted.md#self-hosted-enterprise), [bring your own cloud (BYOC)](./bring_your_own_cloud.md), and [Cloud SaaS](./langgraph_cloud.md). This guide explains the differences between these options, and which Plans they are available on. - [Plans](./plans.md): LangGraph Platforms offer three different plans: Developer, Plus, Enterprise. This guide explains the differences between these options, what deployment options are available for each, and how to sign up for each one. - [Template Applications](./template_applications.md): Reference applications designed to help you get started quickly when building with LangGraph. -**Components** +### Components The LangGraph Platform comprises several components that work together to support the deployment and management of LangGraph applications: @@ -58,7 +58,7 @@ The LangGraph Platform comprises several components that work together to suppor - [Python/JS SDK](./sdk.md): The Python/JS SDK provides a programmatic way to interact with deployed LangGraph Applications. - [Remote Graph](../how-tos/use-remote-graph.md): A RemoteGraph allows you to interact with any deployed LangGraph application as though it were running locally. -**LangGraph Server** +### LangGraph Server - [Application Structure](./application_structure.md): A LangGraph application consists of one or more graphs, a LangGraph API Configuration file (`langgraph.json`), a file that specifies dependencies, and environment variables. - [Assistants](./assistants.md): Assistants are a way to save and manage different configurations of your LangGraph applications. @@ -66,9 +66,7 @@ The LangGraph Platform comprises several components that work together to suppor - [Cron Jobs](./langgraph_server.md#cron-jobs): Cron jobs are a way to schedule tasks to run at specific times in your LangGraph application. - [Double Texting](./double_texting.md): Double texting is a common issue in LLM applications where users may send multiple messages before the graph has finished running. This guide explains how to handle double texting with LangGraph Deploy. - -**Deployment Options** - +### Deployment Options - [Self-Hosted Lite](./self_hosted.md): A free (up to 1 million nodes executed), limited version of LangGraph Platform that you can run locally or in a self-hosted manner - [Cloud SaaS](./langgraph_cloud.md): Hosted as part of LangSmith. diff --git a/docs/docs/how-tos/index.md b/docs/docs/how-tos/index.md index aee88e88..88512bcb 100644 --- a/docs/docs/how-tos/index.md +++ b/docs/docs/how-tos/index.md @@ -22,7 +22,6 @@ LangGraph.js is known for being a highly controllable agent framework. These how-to guides show how to achieve that controllability. - [How to define graph state](define-state.ipynb) -- [How to create subgraphs](subgraph.ipynb) - [How to create branches for parallel execution](branching.ipynb) - [How to create map-reduce branches for parallel execution](map-reduce.ipynb) @@ -34,8 +33,12 @@ LangGraph.js makes it easy to persist state across graph runs. The guides below - [How to add thread-level persistence to subgraphs](subgraph-persistence.ipynb) - [How to add cross-thread persistence](cross-thread-persistence.ipynb) - [How to use a Postgres checkpointer for persistence](persistence-postgres.ipynb) + +### Memory + +LangGraph makes it easy to manage conversation [memory](../concepts/memory.md) in your graph. These how-to guides show how to implement different strategies for that. + - [How to manage conversation history](manage-conversation-history.ipynb) -- [How to view and update past graph state](time-travel.ipynb) - [How to delete messages](delete-messages.ipynb) - [How to add summary of the conversation history](add-summary-conversation-history.ipynb) @@ -46,8 +49,9 @@ These guides cover common examples of that. - [How to add breakpoints](breakpoints.ipynb) - [How to add dynamic breakpoints](dynamic_breakpoints.ipynb) -- [How to wait for user input](wait-user-input.ipynb) - [How to edit graph state](edit-graph-state.ipynb) +- [How to wait for user input](wait-user-input.ipynb) +- [How to view and update past graph state](time-travel.ipynb) - [How to review tool calls](review-tool-calls.ipynb) ### Streaming @@ -55,12 +59,12 @@ These guides cover common examples of that. LangGraph is built to be streaming first. These guides show how to use different streaming modes. -- [How to stream full state of your graph](stream-values.ipynb) +- [How to stream the full state of your graph](stream-values.ipynb) - [How to stream state updates of your graph](stream-updates.ipynb) -- [How to configure multiple streaming modes](stream-multiple.ipynb) - [How to stream LLM tokens](stream-tokens.ipynb) - [How to stream LLM tokens without LangChain models](streaming-tokens-without-langchain.ipynb) - [How to stream custom data](streaming-content.ipynb) +- [How to configure multiple streaming modes](stream-multiple.ipynb) - [How to stream events from within a tool](streaming-events-from-within-tools.ipynb) - [How to stream from the final node](streaming-from-final-node.ipynb) @@ -73,21 +77,25 @@ These guides show how to use different streaming modes. ### Subgraphs +[Subgraphs](../concepts/low_level.md#subgraphs) allow you to reuse an existing graph from another graph. These how-to guides show how to use subgraphs: + - [How to add and use subgraphs](subgraph.ipynb) - [How to view and update state in subgraphs](subgraphs-manage-state.ipynb) - [How to transform inputs and outputs of a subgraph](subgraph-transform-state.ipynb) ### State management +- [How to define graph state](define-state.ipynb) - [Have a separate input and output schema](input_output_schema.ipynb) - [Pass private state between nodes inside the graph](pass_private_state.ipynb) -### Prebuilt ReAct Agent +### Other -- [How to create a ReAct agent](create-react-agent.ipynb) -- [How to add memory to a ReAct agent](react-memory.ipynb) -- [How to add a system prompt to a ReAct agent](react-system-prompt.ipynb) -- [How to add Human-in-the-loop to a ReAct agent](react-human-in-the-loop.ipynb) +- [How to add runtime configuration to your graph](configuration.ipynb) +- [How to add node retries](node-retry-policies.ipynb) +- [How to let agent return tool results directly](dynamically-returning-directly.ipynb) +- [How to have agent respond in structured format](respond-in-format.ipynb) +- [How to manage agent steps](managing-agent-steps.ipynb) ### Prebuilt ReAct Agent @@ -96,14 +104,6 @@ These guides show how to use different streaming modes. - [How to add a system prompt to a ReAct agent](react-system-prompt.ipynb) - [How to add Human-in-the-loop to a ReAct agent](react-human-in-the-loop.ipynb) -### Other - -- [How to add runtime configuration to your graph](configuration.ipynb) -- [How to let agent return tool results directly](dynamically-returning-directly.ipynb) -- [How to have agent respond in structured format](respond-in-format.ipynb) -- [How to manage agent steps](managing-agent-steps.ipynb) -- [How to add node retry policies](node-retry-policies.ipynb) - ## LangGraph Platform This section includes how-to guides for LangGraph Platform. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 58b20547..fc79e9d5 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -22,6 +22,7 @@ theme: - navigation.instant - navigation.instant.prefetch - navigation.instant.progress + - navigation.path - navigation.prune - navigation.tabs - navigation.top @@ -65,12 +66,150 @@ plugins: title_link: "/" # optional, default: '/' nav: - # Setting the names of the nav items explicitly due to mkdocs - # how-reload being a bit buggy with the names of the tabs. - - Home: "index.md" - - Tutorials: "tutorials/index.md" - - Concepts: "concepts/index.md" - - "How-to Guides": "how-tos/index.md" + - Home: index.md + - Tutorials: + - tutorials/index.md + - Quick Start: + - Quick Start: tutorials#quick-start + - tutorials/quickstart.ipynb + - Chatbots: + - Chatbots: tutorials/chatbots/customer_support_small_model.ipynb + - RAG: + - RAG: tutorials#rag + - tutorials/rag/langgraph_agentic_rag.ipynb + - tutorials/rag/langgraph_crag.ipynb + - tutorials/rag/langgraph_self_rag.ipynb + - Agent Architectures: + - Agent Architectures: tutorials#agent-architectures + - Multi-Agent Systems: + - Multi-Agent Systems: tutorials#multi-agent-systems + - tutorials/multi_agent/multi_agent_collaboration.ipynb + - tutorials/multi_agent/agent_supervisor.ipynb + - tutorials/multi_agent/hierarchical_agent_teams.ipynb + - Planning Agents: + - Planning Agents: tutorials#planning-agents + - tutorials/plan-and-execute/plan-and-execute.ipynb + - Reflection & Critique: + - Reflection & Critique: tutorials#reflection-critique + - tutorials/reflection/reflection.ipynb + - tutorials/rewoo/rewoo.ipynb + - Evaluation & Analysis: + - Evaluation & Analysis: tutorials#evaluation + - tutorials/chatbot-simulation-evaluation/agent-simulation-evaluation.ipynb + + - How-to Guides: + - how-tos/index.md + - LangGraph: + - LangGraph: how-tos#langgraph + - Controllability: + - Controllability: how-tos#controllability + - how-tos/define-state.ipynb + - how-tos/map-reduce.ipynb + - how-tos/branching.ipynb + - Persistence: + - Persistence: how-tos#persistence + - how-tos/persistence.ipynb + - how-tos/subgraph-persistence.ipynb + - how-tos/cross-thread-persistence.ipynb + - how-tos/persistence-postgres.ipynb + - Memory: + - Memory: how-tos#memory + - how-tos/manage-conversation-history.ipynb + - how-tos/delete-messages.ipynb + - how-tos/add-summary-conversation-history.ipynb + - Human-in-the-loop: + - Human-in-the-loop: how-tos#human-in-the-loop + - how-tos/breakpoints.ipynb + - how-tos/dynamic_breakpoints.ipynb + - how-tos/edit-graph-state.ipynb + - how-tos/wait-user-input.ipynb + - how-tos/time-travel.ipynb + - how-tos/review-tool-calls.ipynb + - Streaming: + - Streaming: how-tos#streaming + - how-tos/stream-values.ipynb + - how-tos/stream-updates.ipynb + - how-tos/stream-tokens.ipynb + - how-tos/streaming-tokens-without-langchain.ipynb + - how-tos/streaming-content.ipynb + - how-tos/stream-multiple.ipynb + - how-tos/streaming-events-from-within-tools.ipynb + - how-tos/streaming-from-final-node.ipynb + - Tool calling: + - Tool calling: how-tos#tool-calling + - how-tos/tool-calling.ipynb + - how-tos/force-calling-a-tool-first.ipynb + - how-tos/tool-calling-errors.ipynb + - how-tos/pass-run-time-values-to-tools.ipynb + - Subgraphs: + - Subgraphs: how-tos#subgraphs + - how-tos/subgraph.ipynb + - how-tos/subgraphs-manage-state.ipynb + - how-tos/subgraph-transform-state.ipynb + - State Management: + - State Management: how-tos#state-management + - how-tos/define-state.ipynb + - how-tos/input_output_schema.ipynb + - how-tos/pass_private_state.ipynb + - Other: + - Other: how-tos#other + - how-tos/configuration.ipynb + - how-tos/node-retry-policies.ipynb + - how-tos/dynamically-returning-directly.ipynb + - how-tos/respond-in-format.ipynb + - how-tos/managing-agent-steps.ipynb + - Prebuilt ReAct Agent: + - Prebuilt ReAct Agent: how-tos#prebuilt-react-agent + - how-tos/create-react-agent.ipynb + - how-tos/react-memory.ipynb + - how-tos/react-system-prompt.ipynb + - how-tos/react-human-in-the-loop.ipynb + - Troubleshooting: + - Troubleshooting: how-tos#troubleshooting + - troubleshooting/errors/index.md + - troubleshooting/errors/GRAPH_RECURSION_LIMIT.ipynb + - troubleshooting/errors/INVALID_CONCURRENT_GRAPH_UPDATE.ipynb + - troubleshooting/errors/INVALID_GRAPH_NODE_RETURN_VALUE.ipynb + - troubleshooting/errors/MULTIPLE_SUBGRAPHS.ipynb + + - Conceptual Guides: + - concepts/index.md + - LangGraph: + - LangGraph: concepts#langgraph + - concepts/high_level.md + - concepts/low_level.md + - concepts/agentic_concepts.md + - concepts/multi_agent.md + - concepts/human_in_the_loop.md + - concepts/persistence.md + - concepts/memory.md + - concepts/streaming.md + - concepts/faq.md + - LangGraph Platform: + - LangGraph Platform: concepts#langgraph-platform + - High Level: + - High Level: concepts#high-level + - concepts/langgraph_platform.md + - concepts/deployment_options.md + - concepts/plans.md + - concepts/template_applications.md + - Components: + - Components: concepts#components + - concepts/langgraph_server.md + - concepts/langgraph_studio.md + - concepts/langgraph_cli.md + - concepts/sdk.md + - how-tos/use-remote-graph.md + - LangGraph Server: + - LangGraph Server: concepts#langgraph-server + - concepts/application_structure.md + - concepts/assistants.md + - concepts/double_texting.md + - Deployment Options: + - Deployment Options: concepts#deployment-options + - concepts/self_hosted.md + - concepts/langgraph_cloud.md + - concepts/bring_your_own_cloud.md - "Reference": - "reference/index.html" - "Versions": @@ -148,7 +287,6 @@ validation: omitted_files: ignore # absolute_links: warn unrecognized_links: warn - nav: - not_found: warn - links: - not_found: warn + anchors: info + # this is needed to handle headers with anchors for nav + not_found: info diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 7616fba7..f1ab3991 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -34,6 +34,10 @@ color: #1E88E5; } + .md-sidebar { + display: none; + } + .md-typeset a:hover { color: #1565C0; } diff --git a/examples/how-tos/stream-tokens.ipynb b/examples/how-tos/stream-tokens.ipynb index 56360b36..55046f95 100644 --- a/examples/how-tos/stream-tokens.ipynb +++ b/examples/how-tos/stream-tokens.ipynb @@ -8,9 +8,7 @@ "# How to stream LLM tokens from your graph\n", "\n", "In this example, we will stream tokens from the language model powering an\n", - "agent. We will use a ReAct agent as an example. The tl;dr is to use\n", - "[streamEvents](https://js.langchain.com/docs/how_to/chat_streaming/#stream-events)\n", - "([API Ref](https://api.js.langchain.com/classes/langchain_core_runnables.Runnable.html#streamEvents)).\n", + "agent. We will use a ReAct agent as an example.\n", "\n", "
\n", "

Note

\n", @@ -313,7 +311,7 @@ "
\n", "

Compatibility

\n", "

\n", - " This guide requires @langchain/langgraph>=0.2.20. For help upgrading, see this guide.\n", + " This section requires @langchain/langgraph>=0.2.20. For help upgrading, see this guide.\n", "

\n", "
\n", "\n", diff --git a/examples/how-tos/streaming-content.ipynb b/examples/how-tos/streaming-content.ipynb index 5e404e63..cae757fd 100644 --- a/examples/how-tos/streaming-content.ipynb +++ b/examples/how-tos/streaming-content.ipynb @@ -74,12 +74,12 @@ "id": "29814253-ca9b-4844-a8a5-d6b19fbdbdba", "metadata": {}, "source": [ - "## Stream custom data using .stream", + "## Stream custom data using .stream\n", "\n", "
\n", "

Compatibility

\n", "

\n", - " This guide requires @langchain/langgraph>=0.2.20. For help upgrading, see this guide.\n", + " This section requires @langchain/langgraph>=0.2.20. For help upgrading, see this guide.\n", "

\n", "
" ] From 50a43316ba484945c8497dd7c22ab364e25709e4 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Mon, 11 Nov 2024 18:31:20 -0800 Subject: [PATCH 2/2] Add dep --- .github/workflows/deploy_docs.yml | 4 +++- docs/docs-requirements.txt | 3 ++- docs/mkdocs.yml | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 229019b7..5af5d09a 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -21,11 +21,13 @@ concurrency: jobs: deploy: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.MKDOCS_GITHUB_TOKEN }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/docs/docs-requirements.txt b/docs/docs-requirements.txt index 4a3c16e0..40c9cecf 100644 --- a/docs/docs-requirements.txt +++ b/docs/docs-requirements.txt @@ -7,4 +7,5 @@ mkdocs-rss-plugin mkdocs-material[imaging] mkdocs-typedoc markdown-include -markdown-callouts \ No newline at end of file +markdown-callouts +git+ssh://git@github.com/langchain-ai/mkdocs-material-insiders.git diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index fc79e9d5..79a145af 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -99,6 +99,10 @@ nav: - How-to Guides: - how-tos/index.md + - Installation: + - Installation: how-tos#installation + - how-tos/manage-ecosystem-dependencies.ipynb + - how-tos/use-in-web-environments.ipynb - LangGraph: - LangGraph: how-tos#langgraph - Controllability: