mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-13 21:27:52 +02:00
@@ -454,18 +454,6 @@ We also have a lot of examples highlighting how to slightly modify the base chat
|
||||
- [Force calling a tool first](https://github.com/langchain-ai/langgraph/blob/main/examples/agent_executor/force-calling-a-tool-first.ipynb): How to always call a specific tool first
|
||||
- [Managing agent steps](https://github.com/langchain-ai/langgraph/blob/main/examples/agent_executor/managing-agent-steps.ipynb): How to more explicitly manage intermediate steps that an agent takes
|
||||
|
||||
### Multi-agent Examples
|
||||
|
||||
- [Multi-agent collaboration](https://github.com/langchain-ai/langgraph/blob/main/examples/multi_agent/multi-agent-collaboration.ipynb): how to create two agents that work together to accomplish a task
|
||||
- [Multi-agent with supervisor](https://github.com/langchain-ai/langgraph/blob/main/examples/multi_agent/agent_supervisor.ipynb): how to orchestrate individual agents by using an LLM as a "supervisor" to distribute work
|
||||
- [Hierarchical agent teams](https://github.com/langchain-ai/langgraph/blob/main/examples/multi_agent/hierarchical_agent_teams.ipynb): how to orchestrate "teams" of agents as nested graphs that can collaborate to solve a problem
|
||||
|
||||
### Chatbot Evaluation via Simulation
|
||||
|
||||
It can often be tough to evaluation chat bots in multi-turn situations. One way to do this is with simulations.
|
||||
|
||||
- [Chat bot evaluation as multi-agent simulation](https://github.com/langchain-ai/langgraph/blob/main/examples/chatbot-simulation-evaluation/agent-simulation-evaluation.ipynb): How to simulate a dialogue between a "virtual user" and your chat bot
|
||||
|
||||
### Async
|
||||
|
||||
If you are running LangGraph in async workflows, you may want to create the nodes to be async by default.
|
||||
@@ -486,6 +474,32 @@ For a walkthrough on how to do that, see [this documentation](https://github.com
|
||||
LangGraph comes with built-in support for human-in-the-loop workflows. This is useful when you want to have a human review the current state before proceeding to a particular node.
|
||||
For a walkthrough on how to do that, see [this documentation](https://github.com/langchain-ai/langgraph/blob/main/examples/human-in-the-loop.ipynb)
|
||||
|
||||
|
||||
### Planning Agent Examples
|
||||
|
||||
The following notebooks implement agent architectures prototypical of the "plan-and-execute" style, where an LLM planner decomposes a user request into a program, an executor executes the program, and an LLM synthesizes a response (and/or dynamically replans) based on the program outputs.
|
||||
|
||||
- [Plan-and-execute](https://github.com/langchain-ai/langgraph/blob/main/examples/plan-and-execute/plan-and-execute.ipynb): a simple agent with a **planner** that generates a multi-step task list, an **executor** that invokes the tools in the plan, and a **replanner** that responds or generates an updated plan. Based on the [Plan-and-solve](https://arxiv.org/abs/2305.04091) paper by Wang, et. al.
|
||||
- [Reasoning without Observation](https://github.com/langchain-ai/langgraph/blob/main/examples/rewoo/rewoo.ipynb): planner generates a task list whose observations are saved as **variables**. Variables can be used in subsequent tasks to reduce the need for further re-planning. Based on the [ReWOO](https://arxiv.org/abs/2305.18323) paper by Xu, et. al.
|
||||
- [LLMCompiler](https://github.com/langchain-ai/langgraph/blob/main/examples/llm-compiler/LLMCompiler.ipynb): planner generates a **DAG** of tasks with variable responses. Tasks are **streamed** and executed eagerly to minimize tool execution runtime. Based on the [paper](https://arxiv.org/abs/2312.04511) by Kim, et. al.
|
||||
|
||||
|
||||
### Multi-agent Examples
|
||||
|
||||
- [Multi-agent collaboration](https://github.com/langchain-ai/langgraph/blob/main/examples/multi_agent/multi-agent-collaboration.ipynb): how to create two agents that work together to accomplish a task
|
||||
- [Multi-agent with supervisor](https://github.com/langchain-ai/langgraph/blob/main/examples/multi_agent/agent_supervisor.ipynb): how to orchestrate individual agents by using an LLM as a "supervisor" to distribute work
|
||||
- [Hierarchical agent teams](https://github.com/langchain-ai/langgraph/blob/main/examples/multi_agent/hierarchical_agent_teams.ipynb): how to orchestrate "teams" of agents as nested graphs that can collaborate to solve a problem
|
||||
|
||||
### Chatbot Evaluation via Simulation
|
||||
|
||||
It can often be tough to evaluation chat bots in multi-turn situations. One way to do this is with simulations.
|
||||
|
||||
- [Chat bot evaluation as multi-agent simulation](https://github.com/langchain-ai/langgraph/blob/main/examples/chatbot-simulation-evaluation/agent-simulation-evaluation.ipynb): how to simulate a dialogue between a "virtual user" and your chat bot
|
||||
|
||||
### Multimodal Examples
|
||||
|
||||
- [WebVoyager](https://github.com/langchain-ai/langgraph/blob/main/examples/web-navigation/web_voyager.ipynb): vision-enabled web browsing agent that uses [Set-of-marks](https://som-gpt4v.github.io/) prompting to navigate a web browser and execute tasks
|
||||
|
||||
## Documentation
|
||||
|
||||
There are only a few new APIs to use.
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
"\n",
|
||||
"This notebook shows how to implement [LLMCompiler, by Kim, et. al](https://arxiv.org/abs/2312.04511) in LangGraph.\n",
|
||||
"\n",
|
||||
"LLMCompiler is an agent architecture intented on speeding up the latency of agentic tasks via fast, parallel tool execution. It has 3 main components:\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"1. Planner: generate a DAG of tasks.\n",
|
||||
"2. Task Fetching Unit: schedules and executes the tasks\n",
|
||||
"LLMCompiler is an agent architecture designed to speed up the execution of agentic tasks by eagerly-executed tasks within a DAG. It has 3 main components:\n",
|
||||
"\n",
|
||||
"1. Planner: stream a DAG of tasks.\n",
|
||||
"2. Task Fetching Unit: schedules and executes the tasks as soon as they are executable\n",
|
||||
"3. Joiner: Responds to the user or triggers a second plan\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"This notebook walks through each component and shows how to wire them together using LangGraph. \n",
|
||||
"\n",
|
||||
@@ -299,7 +300,10 @@
|
||||
"}\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"The basic idea is to begin executing tools as soon as their dependencies are met. This is done through multi-threading."
|
||||
"\n",
|
||||
"The basic idea is to begin executing tools as soon as their dependencies are met. This is done through multi-threading. We will combine the task fetching unit and exector below:\n",
|
||||
"\n",
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 863 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -12,6 +12,10 @@
|
||||
"The core idea is to first come up with a multi-step plan, and then go through that plan one item at a time.\n",
|
||||
"After accomplishing a particular task, you can then revisit the plan and modify as appropriate.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"This compares to a typical [ReAct](https://arxiv.org/abs/2210.03629) style agent where you think one step at a time.\n",
|
||||
"The advantages of this \"plan-and-execute\" style agent are:\n",
|
||||
"\n",
|
||||
@@ -454,12 +458,14 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "8c20341e-267d-4ba0-9a0b-dad055a76b1d",
|
||||
"cell_type": "markdown",
|
||||
"id": "8bf585a9-0f1e-4910-bd00-65e7bb05b6e6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"source": [
|
||||
"## Conclusion\n",
|
||||
"\n",
|
||||
"Congrats on making a plan-and-execute agent! One known limitations of the above design is that each task is still executed in sequence, meaning embarassingly parallel operations all add to the total execution time. You could improve on this by having each task represented as a DAG (similar to LLMCompiler), rather than a regular list."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
@@ -486,7 +492,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.1"
|
||||
"version": "3.11.2"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 234 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 829 KiB |
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user