diff --git a/docs/_scripts/link_map.py b/docs/_scripts/link_map.py index 6bac5950a..d7c0045f7 100644 --- a/docs/_scripts/link_map.py +++ b/docs/_scripts/link_map.py @@ -1,3 +1,6 @@ JS_LINK_MAP = { "langgraph.types.interrupt": "https://langchain-ai.github.io/langgraphjs/reference/functions/langgraph.interrupt-2.html", -} + "create_react_agent": "https://langchain-ai.github.io/langgraphjs/reference/functions/langgraph_prebuilt.createReactAgent.html", + "langgraph.types.Command": "https://langchain-ai.github.io/langgraphjs/reference/classes/langgraph.Command.html", + +} \ No newline at end of file diff --git a/docs/docs/agents/agents.md b/docs/docs/agents/agents.md index 9006843a5..c492c4b26 100644 --- a/docs/docs/agents/agents.md +++ b/docs/docs/agents/agents.md @@ -251,7 +251,7 @@ npm install langchain @langchain/langgraph @langchain/anthropic ## 2. Create an agent -Use [`createReactAgent`](/langgraphjs/reference/functions/langgraph_prebuilt.createReactAgent.html) to instantiate an agent: +Use [`createReactAgent`][create_react_agent] to instantiate an agent: ```ts import { createReactAgent } from "@langchain/langgraph/prebuilt"; diff --git a/docs/docs/agents/context.md b/docs/docs/agents/context.md index f2fa12af9..291733888 100644 --- a/docs/docs/agents/context.md +++ b/docs/docs/agents/context.md @@ -514,6 +514,4 @@ await agent.invoke( { configurable: { userId: "user_123" } } ); ``` - -For more details, see [how to update state from tools](../how-tos/update-state-from-tools.ipynb). ::: \ No newline at end of file diff --git a/docs/docs/agents/human-in-the-loop.md b/docs/docs/agents/human-in-the-loop.md index ef0240de3..14016c058 100644 --- a/docs/docs/agents/human-in-the-loop.md +++ b/docs/docs/agents/human-in-the-loop.md @@ -294,7 +294,7 @@ const agent = createReactAgent({ }); ``` -1. The [`interrupt` function](/langgraphjs/reference/functions/langgraph.interrupt-1.html) pauses the agent graph at a specific node. In this case, we call `interrupt()` at the beginning of the tool function, which pauses the graph at the node that executes the tool. The information inside `interrupt()` (e.g., tool calls) can be presented to a human, and the graph can be resumed with the user input (tool call approval, edit or feedback). +1. The [`interrupt` function][langgraph.types.interrupt] pauses the agent graph at a specific node. In this case, we call `interrupt()` at the beginning of the tool function, which pauses the graph at the node that executes the tool. The information inside `interrupt()` (e.g., tool calls) can be presented to a human, and the graph can be resumed with the user input (tool call approval, edit or feedback). 2. The `InMemorySaver` is used to store the agent state at every step in the tool calling loop. This enables [short-term memory](./memory.md#short-term-memory) and [human-in-the-loop](./human-in-the-loop.md) capabilities. In this example, we use `InMemorySaver` to store the agent state in memory. In a production application, the agent state will be stored in a database. 3. Initialize the agent with the `checkpointer`. @@ -336,7 +336,7 @@ for await (const chunk of await agent.stream( }; ``` -1. The [`interrupt` function](/langgraphjs/reference/functions/langgraph.interrupt-1.html) is used in conjunction with the [`Command`](/langgraphjs/reference/classes/langgraph.Command.html) object to resume the graph with a value provided by the human. +1. The [`interrupt` function][langgraph.types.interrupt] is used in conjunction with the [`Command`][langgraph.types.Command] object to resume the graph with a value provided by the human. ::: diff --git a/docs/docs/agents/overview.md b/docs/docs/agents/overview.md index f180001a0..9bc797e7a 100644 --- a/docs/docs/agents/overview.md +++ b/docs/docs/agents/overview.md @@ -201,7 +201,7 @@ document$.subscribe(initializeWidget); The high-level components are organized into several packages, each with a specific focus. | Package | Description | Installation | -| ------------------------ | --------------------------------------------------------------------------- | -------------------------------------------------- | +|--------------------------|-----------------------------------------------------------------------------|----------------------------------------------------| | `langgraph` | Prebuilt components to [**create agents**](./agents.md) | `npm install @langchain/langgraph @langchain/core` | | `langgraph-supervisor` | Tools for building [**supervisor**](./multi-agent.md#supervisor) agents | `npm install @langchain/langgraph-supervisor` | | `langgraph-swarm` | Tools for building a [**swarm**](./multi-agent.md#swarm) multi-agent system | `npm install @langchain/langgraph-swarm` | @@ -210,7 +210,7 @@ The high-level components are organized into several packages, each with a speci ## Visualize an agent graph -Use the following tool to visualize the graph generated by [`createReactAgent`](/langgraphjs/reference/functions/langgraph_prebuilt.createReactAgent.html) and to view an outline of the corresponding code. It allows you to explore the infrastructure of the agent as defined by the presence of: +Use the following tool to visualize the graph generated by [`createReactAgent`][create_react_agent] and to view an outline of the corresponding code. It allows you to explore the infrastructure of the agent as defined by the presence of: - [`tools`](./tools.md): A list of tools (functions, APIs, or other callable objects) that the agent can use to perform tasks. - `preModelHook`: A function that is called before the model is invoked. It can be used to condense messages or perform other preprocessing tasks. @@ -234,7 +234,9 @@ Use the following tool to visualize the graph generated by [`createReactAgent`]( -The following code snippet shows how to create the above agent (and underlying graph) with [`createReactAgent`](/langgraphjs/reference/functions/langgraph_prebuilt.createReactAgent.html): +The following code snippet shows how to create the above agent (and underlying graph) with [`createReactAgent`][create_react_agent]: + +```typescript