mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-13 13:17:52 +02:00
Docs Draft (#286)
This commit is contained in:
@@ -9,7 +9,33 @@ docs_dir = root_dir / "docs/docs"
|
||||
how_tos_dir = docs_dir / "how-tos"
|
||||
tutorials_dir = docs_dir / "tutorials"
|
||||
|
||||
_MANUAL = {
|
||||
"how-tos": [
|
||||
"async.ipynb",
|
||||
"streaming-tokens.ipynb",
|
||||
"human-in-the-loop.ipynb",
|
||||
"persistence.ipynb",
|
||||
"time-travel.ipynb",
|
||||
"visualization.ipynb",
|
||||
"state-model.ipynb",
|
||||
"subgraph.ipynb",
|
||||
"persistence_postgres.ipynb",
|
||||
"branching.ipynb",
|
||||
],
|
||||
"tutorials": [
|
||||
"chat_agent_executor_with_function_calling/base.ipynb",
|
||||
"chat_agent_executor_with_function_calling/high-level.ipynb",
|
||||
"chat_agent_executor_with_function_calling/high-level-tools.ipynb",
|
||||
"chat_agent_executor_with_function_calling/prebuilt-tool-node.ipynb",
|
||||
"agent_executor/base.ipynb",
|
||||
"agent_executor/high-level.ipynb",
|
||||
],
|
||||
}
|
||||
_MANUAL_INVERSE = {v: docs_dir / k for k, vs in _MANUAL.items() for v in vs}
|
||||
_HOW_TOS = {"agent_executor", "chat_agent_executor_with_function_calling", "docs"}
|
||||
_MAP = {
|
||||
"persistence_postgres.ipynb": "tutorial",
|
||||
}
|
||||
_IGNORE = (".ipynb_checkpoints", ".venv", ".cache")
|
||||
|
||||
|
||||
@@ -33,30 +59,48 @@ def clean_notebooks():
|
||||
def copy_notebooks():
|
||||
# Nested ones are mostly tutorials rn
|
||||
for root, dirs, files in os.walk(examples_dir):
|
||||
if root == str(examples_dir):
|
||||
continue
|
||||
if any(path.startswith(".") or path.startswith("__") for path in root.split(os.sep)):
|
||||
if any(
|
||||
path.startswith(".") or path.startswith("__") for path in root.split(os.sep)
|
||||
):
|
||||
continue
|
||||
if any(path in _HOW_TOS for path in root.split(os.sep)):
|
||||
dst_dir = how_tos_dir
|
||||
else:
|
||||
dst_dir = tutorials_dir
|
||||
for file in files:
|
||||
if file.endswith(".ipynb"):
|
||||
dst_dir_ = dst_dir
|
||||
if file.endswith((".ipynb", ".png")):
|
||||
if file in _MAP:
|
||||
dst_dir = os.path.join(dst_dir, _MAP[file])
|
||||
src_path = os.path.join(root, file)
|
||||
dst_path = os.path.join(
|
||||
dst_dir, os.path.relpath(src_path, examples_dir)
|
||||
)
|
||||
for k in _MANUAL_INVERSE:
|
||||
if src_path.endswith(k):
|
||||
overridden_dir = _MANUAL_INVERSE[k]
|
||||
dst_path = os.path.join(overridden_dir, os.path.relpath(src_path, examples_dir))
|
||||
print(f"Overriding {src_path} to {dst_path}")
|
||||
break
|
||||
|
||||
os.makedirs(os.path.dirname(dst_path), exist_ok=True)
|
||||
shutil.copy(src_path, dst_path)
|
||||
# Convert all ./img/* to ../img/*
|
||||
if file.endswith(".ipynb"):
|
||||
with open(dst_path, "r") as f:
|
||||
content = f.read()
|
||||
content = content.replace("(./img/", "(../img/")
|
||||
with open(dst_path, "w") as f:
|
||||
f.write(content)
|
||||
dst_dir = dst_dir_
|
||||
# Top level notebooks are "how-to's"
|
||||
for file in examples_dir.iterdir():
|
||||
if file.suffix.endswith(".ipynb") and not os.path.isdir(
|
||||
os.path.join(examples_dir, file)
|
||||
):
|
||||
src_path = os.path.join(examples_dir, file)
|
||||
dst_path = os.path.join(docs_dir, "how-tos", file.name)
|
||||
shutil.copy(src_path, dst_path)
|
||||
# for file in examples_dir.iterdir():
|
||||
# if file.suffix.endswith(".ipynb") and not os.path.isdir(
|
||||
# os.path.join(examples_dir, file)
|
||||
# ):
|
||||
# src_path = os.path.join(examples_dir, file)
|
||||
# dst_path = os.path.join(docs_dir, "how-tos", file.name)
|
||||
# shutil.copy(src_path, dst_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# Concepts
|
||||
|
||||
|
||||
## State
|
||||
+20
-15
@@ -2,24 +2,29 @@
|
||||
|
||||
Welcome to the LangGraph How-To Guides! These guides provide practical, step-by-step instructions for accomplishing key tasks in LangGraph.
|
||||
|
||||
## Basics
|
||||
|
||||
- [State Management](state-model.ipynb): How to define and manage complex state in your graphs
|
||||
- [Tool Integration](sql_example.ipynb): How to integrate external tools and data sources
|
||||
- [Human-in-the-Loop](human-in-the-loop.ipynb): How to incorporate human feedback and intervention
|
||||
|
||||
## Performance
|
||||
## Core
|
||||
|
||||
- [Async Execution](async.ipynb): How to run nodes asynchronously for improved performance
|
||||
- [Streaming Responses](streaming-tokens.ipynb): How to stream agent responses in real-time
|
||||
|
||||
## Graph Structure
|
||||
|
||||
- [Subgraphs](subgraph.ipynb): How to modularize your graphs with subgraphs
|
||||
- [Human-in-the-Loop](human-in-the-loop.ipynb): How to incorporate human feedback and intervention
|
||||
- [Persistence](persistence.ipynb): How to save and load graph state for long-running applications
|
||||
- [Time Travel](time-travel.ipynb): How to navigate and manipulate graph state history
|
||||
- [Visualization](visualization.ipynb): How to visualize your graphs
|
||||
- [Pydantic State](state-model.ipynb): Use a pydantic model as your state
|
||||
- [Subgraphs](subgraph.ipynb): How to compose subgraphs within a larger graph
|
||||
- [Branching](branching.ipynb): How to create branching logic in your graphs
|
||||
|
||||
## Development
|
||||
## AgentExecutor
|
||||
|
||||
- [Human-in-the-Loop](agent_executor/human-in-the-loop.ipynb)
|
||||
- [Force Tool First](agent_executor/force-calling-a-tool-first.ipynb)
|
||||
- [Manage Agent Steps](agent_executor/managing-agent-steps.ipynb)
|
||||
|
||||
## Chat Agent (Function Calling)
|
||||
|
||||
- [Human-in-the-Loop](chat_agent_executor_with_function_calling/human-in-the-loop.ipynb)
|
||||
- [Force Tool First](chat_agent_executor_with_function_calling/force-calling-a-tool-first.ipynb)
|
||||
- [Respond in Format](chat_agent_executor_with_function_calling/respond-in-format.ipynb)
|
||||
- [Dynamic Direct Return](chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb)
|
||||
- [Manage Agent Steps](chat_agent_executor_with_function_calling/managing-agent-steps.ipynb)
|
||||
|
||||
- [Persistence](persistence.ipynb): How to save and load graph state for long-running applications
|
||||
- [Visualization](visualization.ipynb): How to visualize your graphs
|
||||
- [Time Travel](time-travel.ipynb): How to navigate and manipulate graph execution history
|
||||
+71
-79
@@ -4,119 +4,111 @@
|
||||
|
||||
⚡ Build language agents as graphs ⚡
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
Suppose you're building a customer support assistant. You want your assistant to:
|
||||
Suppose you're building a customer support assistant. You want your assistant to be able to:
|
||||
|
||||
1. Try to answer user questions using a knowledge base
|
||||
2. Escalate to a human if it's not confident in its answer
|
||||
3. Relay the human's resolution back to the user
|
||||
4. Remember the full conversation context across multiple user messages
|
||||
1. Use tools to respond to questions
|
||||
2. Connect with a human if needed
|
||||
3. Be able to pause the process indefinitely and resume whenever the human responds
|
||||
|
||||
With raw LLMs, the code to control the agentic loop, conversation state, route between the chatbot and human, and checkpoint the full application state can get complex.
|
||||
LangGraph makes this all easy. First install:
|
||||
|
||||
LangGraph makes it simple. First install:
|
||||
|
||||
```shell
|
||||
```bash
|
||||
pip install -U langgraph
|
||||
```
|
||||
|
||||
Then define your assistant:
|
||||
|
||||
```python
|
||||
from langgraph.graph import StateGraph
|
||||
import json
|
||||
|
||||
from langchain_anthropic import ChatAnthropic
|
||||
from langchain_community.tools.tavily_search import TavilySearchResults
|
||||
|
||||
from langgraph.checkpoint.sqlite import SqliteSaver
|
||||
|
||||
from langchain_anthropic
|
||||
from langgraph.graph import END, MessageGraph
|
||||
from langgraph.prebuilt.tool_node import ToolNode
|
||||
|
||||
|
||||
# Define the chatbot state
|
||||
class ChatbotState(TypedDict):
|
||||
conversation_history: Annotated[ConversationHistory, operator.add]
|
||||
pending_human_request: Optional[HumanRequest]
|
||||
|
||||
# Create nodes for the chatbot and human
|
||||
def chatbot(state: ChatbotState):
|
||||
# TODO
|
||||
|
||||
def human(state: ChatbotState):
|
||||
# TODO
|
||||
|
||||
# Create the graph
|
||||
graph = StateGraph(ChatbotState)
|
||||
graph.add_node("chatbot", chatbot)
|
||||
graph.add_node("human", human)
|
||||
|
||||
# Define routing logic between chatbot and human
|
||||
def should_escalate(state):
|
||||
if state['pending_human_request']:
|
||||
return "human"
|
||||
# Define the function that determines whether to continue or not
|
||||
def should_continue(messages):
|
||||
last_message = messages[-1]
|
||||
# If there is no function call, then we finish
|
||||
if not last_message.tool_calls:
|
||||
return END
|
||||
else:
|
||||
return "chatbot"
|
||||
return "action"
|
||||
|
||||
graph.add_conditional_edges("chatbot", should_escalate, {
|
||||
"human": "human",
|
||||
"chatbot": "chatbot"
|
||||
})
|
||||
|
||||
graph.add_edge("human", "chatbot")
|
||||
# Define a new graph
|
||||
workflow = MessageGraph()
|
||||
|
||||
memory = SqliteSaver.from_conn_string(":memory:")
|
||||
app = graph.compile(checkpointer=memory)
|
||||
# Run the graph
|
||||
result = app.invoke(new_user_message)
|
||||
tools = [TavilySearchResults(max_results=1)]
|
||||
model = ChatAnthropic(model="claude-3-haiku-20240307").bind_tools(tools)
|
||||
workflow.add_node("agent", model)
|
||||
workflow.add_node("action", ToolNode(tools))
|
||||
|
||||
workflow.set_entry_point("agent")
|
||||
|
||||
# Conditional agent -> action OR agent -> END
|
||||
workflow.add_conditional_edges(
|
||||
"agent",
|
||||
should_continue,
|
||||
)
|
||||
|
||||
# Always transition `action` -> `agent`
|
||||
workflow.add_edge("action", "agent")
|
||||
|
||||
memory = SqliteSaver.from_conn_string(":memory:") # Here we only save in-memory
|
||||
|
||||
# Setting the interrupt means that any time an action is called, the machine will stop
|
||||
app = workflow.compile(checkpointer=memory, interrupt_before=["action"])
|
||||
```
|
||||
|
||||
The graph handles all the hard parts:
|
||||
Now, run the graph:
|
||||
|
||||
- `conversation_history` in the state contains the assistant's "memory"
|
||||
- Conditional edges enable dynamic routing between the chatbot and human based on the chatbot's confidence
|
||||
- Persistence makes it easy to route to a human so they can respond and resume at any time
|
||||
```python
|
||||
# Run the graph
|
||||
thread = {"configurable": {"thread_id": "4"}}
|
||||
for event in app.stream("what is the weather in sf currently", thread):
|
||||
for v in event.values():
|
||||
print(v)
|
||||
|
||||
```
|
||||
We configured the graph to **wait** before executing the `action`. The `SqliteSaver` persists the state. Resume at any time.
|
||||
|
||||
```python
|
||||
for event in app.stream(None, thread):
|
||||
for v in event.values():
|
||||
print(v)
|
||||
```
|
||||
|
||||
The graph orchestrates everything:
|
||||
|
||||
- The `MessageGraph` contains the agent's "Memory"
|
||||
- Conditional edges enable dynamic routing between the chatbot, tools, and the user
|
||||
- Persistence makes it easy to stop, resume, and even rewind for full control over your application
|
||||
|
||||
With LangGraph, you can build complex, stateful agents without getting bogged down in manual state and interrupt management. Just define your nodes, edges, and state schema - and let the graph take care of the rest.
|
||||
|
||||
## Concepts
|
||||
|
||||
- [Graphs](concepts.md#graphs)
|
||||
- [State](concepts.md#state): The data structure passed between nodes, allowing you to persist context
|
||||
- [Nodes](concepts.#nodes): The building blocks of your graph - LLMs, tools, or custom logic
|
||||
- [Edges](concepts.md#edges): The connections that define the flow of data between your nodes
|
||||
- [Conditional Edges](concepts.md#conditional_edges): Special edges that let you dynamically route between nodes based on state
|
||||
- [Persistence](concepts.md#persistence): Save and resume your graph's state for long-running applications
|
||||
|
||||
## How-To Guides
|
||||
|
||||
Check out the [How-To Guides](how-tos/index.md) for instructions on handling common tasks with LangGraph.
|
||||
|
||||
- Manage State
|
||||
- Tool Integration
|
||||
- Human-in-the-Loop
|
||||
- Async Execution
|
||||
- Streaming Responses
|
||||
- Subgraphs & Branching
|
||||
- Persistence, Visualization, Time Travel
|
||||
- Benchmarking
|
||||
|
||||
## Tutorials
|
||||
|
||||
Consult the [Tutorials](tutorials/index.md) to learn more about implementing advanced
|
||||
Consult the [Tutorials](tutorials/index.md) to learn more about building with LangGraph, including advanced use cases.
|
||||
|
||||
- **Agent Executors**: Chat and Langchain agents
|
||||
- **Planning Agents**: Plan-and-Execute, ReWOO, LLMCompiler
|
||||
- **Reflection & Critique**: Improving quality via reflection
|
||||
- **Multi-Agent Systems**: Collaboration, supervision, teams
|
||||
- **Research & QA**: Web research, retrieval-augmented QA
|
||||
- **Applications**: Chatbots, code assist, web tasks
|
||||
- **Evaluation & Analysis**: Simulation, self-discovery, swarms
|
||||
|
||||
## How-To Guides
|
||||
|
||||
Check out the [How-To Guides](how-tos/index.md) for instructions on handling common tasks with LangGraph
|
||||
|
||||
## Why LangGraph?
|
||||
|
||||
LangGraph extends the core strengths of LangChain Runnables (shared interface for streaming, async, and batch calls) to make it easy to:
|
||||
LangGraph is framework agnostic (each node is a regular python function). It extends the core Runnable API (shared interface for streaming, async, and batch calls) to make it easy to:
|
||||
|
||||
- Seamless state management across multiple turns of conversation or tool usage
|
||||
- The ability to flexibly route between nodes based on dynamic criteria
|
||||
- Smooth switching between LLMs and human intervention
|
||||
- Persistence for long-running, multi-session applications
|
||||
|
||||
If you're building a straightforward DAG,, LangChain expression language is a great fit. But for more complex, stateful applications with nonlinear flows, LangGraph is the perfect tool for the job.
|
||||
If you're building a straightforward DAG, Runnables are a great fit. But for more complex, stateful applications with nonlinear flows, LangGraph is the perfect tool for the job.
|
||||
@@ -1,11 +1,4 @@
|
||||
# Checkpoints
|
||||
|
||||
|
||||
::: langgraph.checkpoint
|
||||
handler: python
|
||||
options:
|
||||
selection:
|
||||
docstring_style: google
|
||||
rendering:
|
||||
heading_level: 3
|
||||
show_root_toc_entry: false
|
||||
@@ -1,11 +1,12 @@
|
||||
# StateGraph
|
||||
|
||||
# Graph Definitions
|
||||
|
||||
::: langgraph.graph
|
||||
handler: python
|
||||
options:
|
||||
selection:
|
||||
docstring_style: google
|
||||
rendering:
|
||||
heading_level: 3
|
||||
show_root_toc_entry: false
|
||||
|
||||
## CompiledGraph
|
||||
|
||||
::: langgraph.graph.graph.CompiledGraph
|
||||
handler: python
|
||||
members:
|
||||
- get_graph
|
||||
- invoke
|
||||
@@ -1,11 +1,48 @@
|
||||
# Prebuilt
|
||||
# Prebuilt
|
||||
|
||||
## ToolNode
|
||||
|
||||
::: langgraph.prebuilt
|
||||
```python
|
||||
from langgraph.prebuilt import ToolNode
|
||||
```
|
||||
|
||||
::: langgraph.prebuilt.ToolNode
|
||||
handler: python
|
||||
options:
|
||||
selection:
|
||||
docstring_style: google
|
||||
rendering:
|
||||
heading_level: 3
|
||||
show_root_toc_entry: false
|
||||
|
||||
|
||||
## ToolExecutor
|
||||
|
||||
```python
|
||||
from langgraph.prebuilt import ToolExecutor
|
||||
```
|
||||
|
||||
::: langgraph.prebuilt.ToolExecutor
|
||||
handler: python
|
||||
|
||||
|
||||
## ToolInvocation
|
||||
|
||||
```python
|
||||
from langgraph.prebuilt import ToolInvocation
|
||||
```
|
||||
|
||||
::: langgraph.prebuilt.ToolInvocation
|
||||
handler: python
|
||||
heading_level: 4
|
||||
|
||||
|
||||
## `chat_agent_executor.create_tool_calling_executor`
|
||||
|
||||
```python
|
||||
from langgraph.prebuilt.chat_agent_executor import create_tool_calling_executor
|
||||
```
|
||||
|
||||
::: langgraph.prebuilt.chat_agent_executor
|
||||
|
||||
## `create_agent_executor`
|
||||
|
||||
```python
|
||||
from langgraph.prebuilt import create_agent_executor
|
||||
```
|
||||
|
||||
::: langgraph.prebuilt.create_agent_executor
|
||||
|
||||
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -1,69 +1,69 @@
|
||||
# Tutorials
|
||||
|
||||
Welcome to the LangGraph Tutorials! These notebooks provide end-to-end walkthroughs for building various types of language agents and applications using LangGraph.
|
||||
Welcome to the LangGraph Tutorials! These notebooks introduce LangGraph through building various language agents and applications.
|
||||
|
||||
## Agent Executors
|
||||
## AgentExecutor
|
||||
|
||||
- **Chat Agent (Function Calling)**
|
||||
- [Base](chat_agent_executor_with_function_calling/base.ipynb): Implementing a chat agent executor with function calling
|
||||
- [High-Level](chat_agent_executor_with_function_calling/high-level.ipynb): Using the high-level chat agent executor API
|
||||
- [High-Level Tools](chat_agent_executor_with_function_calling/high-level-tools.ipynb): Integrating tools into the high-level chat agent executor
|
||||
- **Modifications**
|
||||
- [Human-in-the-Loop](chat_agent_executor_with_function_calling/human-in-the-loop.ipynb)
|
||||
- [Force Tool First](chat_agent_executor_with_function_calling/force-calling-a-tool-first.ipynb)
|
||||
- [Respond in Format](chat_agent_executor_with_function_calling/respond-in-format.ipynb)
|
||||
- [Dynamic Direct Return](chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb)
|
||||
- [Manage Agent Steps](chat_agent_executor_with_function_calling/managing-agent-steps.ipynb)
|
||||
Learn to build a simple agent in LangGraph.
|
||||
|
||||
- **LangChain Agent**
|
||||
- [Base](agent_executor/base.ipynb): Implementing an agent executor with Langchain agents
|
||||
- [High-Level](agent_executor/high-level.ipynb): Using the high-level Langchain agent executor API
|
||||
- **Modifications**
|
||||
- [Human-in-the-Loop](agent_executor/human-in-the-loop.ipynb)
|
||||
- [Force Tool First](agent_executor/force-calling-a-tool-first.ipynb)
|
||||
- [Manage Agent Steps](agent_executor/managing-agent-steps.ipynb)
|
||||
- [Base](agent_executor/base.ipynb): Learn to build a LangGraph agent "from scratch"
|
||||
- [High-Level](agent_executor/high-level.ipynb): Learn to use the `create_agent_executor`
|
||||
|
||||
## Planning Agents
|
||||
## Chat Agent Executor
|
||||
|
||||
- [Plan-and-Execute](plan-and-execute/plan-and-execute.ipynb): Implementing a basic planning and execution agent
|
||||
- [Reasoning without Observation](rewoo/rewoo.ipynb): Reducing re-planning by saving observations as variables
|
||||
- [LLMCompiler](llm-compiler/LLMCompiler.ipynb): Streaming and eagerly executing a DAG of tasks from a planner
|
||||
Learn to build a simple chat agent executor, which is a basic graph with an agentic loop that also supports dialog with a user.
|
||||
|
||||
## Reflection & Critique
|
||||
- [Base](chat_agent_executor_with_function_calling/base.ipynb): Build a chat agent executor with function calling
|
||||
- [High-Level](chat_agent_executor_with_function_calling/high-level.ipynb): Using the high-level chat agent executor API
|
||||
- [High-Level Tools](chat_agent_executor_with_function_calling/high-level-tools.ipynb): Integrating tools into the high-level chat agent executor
|
||||
|
||||
- [Basic Reflection](reflection/reflection.ipynb): Prompting the agent to reflect on and revise its outputs
|
||||
- [Reflexion](reflexion/reflexion.ipynb): Critiquing missing and superfluous details to guide next steps
|
||||
- [Language Agent Tree Search](lats/lats.ipynb): Using reflection and rewards to drive a tree search over agents
|
||||
## Use cases
|
||||
|
||||
## Multi-Agent Systems
|
||||
Learn from example implementations of graphs designed for specific scenarios and that implement common design patterns.
|
||||
|
||||
#### Chatbots
|
||||
|
||||
- [Customer Support](chatbots/customer-support.ipynb): Building a customer support chatbot
|
||||
- [Info Gathering](chatbots/information-gather-prompting.ipynb): Building an information gathering chatbot
|
||||
- [Code Assistant](code_assistant/langgraph_code_assistant.ipynb): Building a code analysis and generation assistant
|
||||
- [Web Navigation](web-navigation/web_voyager.ipynb): Building an agent that can navigate and interact with websites
|
||||
|
||||
|
||||
#### Multi-Agent Systems
|
||||
|
||||
- [Collaboration](multi_agent/multi-agent-collaboration.ipynb): Enabling two agents to collaborate on a task
|
||||
- [Supervision](multi_agent/agent_supervisor.ipynb): Using an LLM to orchestrate and delegate to individual agents
|
||||
- [Hierarchical Teams](multi_agent/hierarchical_agent_teams.ipynb): Orchestrating nested teams of agents to solve problems
|
||||
|
||||
## Research & QA
|
||||
#### RAG
|
||||
|
||||
- [Adaptive RAG](rag/langgraph_adaptive_rag.ipynb)
|
||||
- [Adaptive RAG using Cohere](rag/langgraph_adaptive_rag_cohere.ipynb)
|
||||
- [Adaptive RAG using local models](rag/langgraph_adaptive_rag_local.ipynb)
|
||||
- [Agentic RAG.ipynb](rag/langgraph_agentic_rag.ipynb)
|
||||
- [Corrective RAG](rag/langgraph_crag.ipynb)
|
||||
- [Corrective RAG with local models](rag/langgraph_crag_local.ipynb)
|
||||
- [Self-RAG](rag/langgraph_self_rag.ipynb)
|
||||
- [Self-RAG with local models](rag/langgraph_self_rag_local.ipynb)
|
||||
|
||||
- **Retrieval-Augmented Generation**
|
||||
- [langgraph_adaptive_rag.ipynb](rag/langgraph_adaptive_rag.ipynb)
|
||||
- [langgraph_adaptive_rag_cohere.ipynb](rag/langgraph_adaptive_rag_cohere.ipynb)
|
||||
- [langgraph_adaptive_rag_local.ipynb](rag/langgraph_adaptive_rag_local.ipynb)
|
||||
- [langgraph_agentic_rag.ipynb](rag/langgraph_agentic_rag.ipynb)
|
||||
- [langgraph_crag.ipynb](rag/langgraph_crag.ipynb)
|
||||
- [langgraph_crag_local.ipynb](rag/langgraph_crag_local.ipynb)
|
||||
- [langgraph_self_rag.ipynb](rag/langgraph_self_rag.ipynb)
|
||||
- [langgraph_self_rag_local.ipynb](rag/langgraph_self_rag_local.ipynb)
|
||||
- [Web Research (STORM)](storm/storm.ipynb): Generating Wikipedia-like articles via research and multi-perspective QA
|
||||
|
||||
## Applications
|
||||
|
||||
- **Chatbots**
|
||||
- [Customer Support](chatbots/customer-support.ipynb): Building a customer support chatbot
|
||||
- [Info Gathering](chatbots/information-gather-prompting.ipynb): Building an information gathering chatbot
|
||||
- [Code Assistant](code_assistant/langgraph_code_assistant.ipynb): Building a code analysis and generation assistant
|
||||
- [Web Navigation](web-navigation/web_voyager.ipynb): Building an agent that can navigate and interact with websites
|
||||
#### Planning Agents
|
||||
|
||||
## Evaluation & Analysis
|
||||
- [Plan-and-Execute](plan-and-execute/plan-and-execute.ipynb): Implementing a basic planning and execution agent
|
||||
- [Reasoning without Observation](rewoo/rewoo.ipynb): Reducing re-planning by saving observations as variables
|
||||
- [LLMCompiler](llm-compiler/LLMCompiler.ipynb): Streaming and eagerly executing a DAG of tasks from a planner
|
||||
|
||||
- **Chatbot Evaluation via Simulation**
|
||||
- [Agent-based](chatbot-simulation-evaluation/agent-simulation-evaluation.ipynb): Evaluating chatbots via simulated user interactions
|
||||
- [Dataset-based](chatbot-simulation-evaluation/langsmith-agent-simulation-evaluation.ipynb): Evaluating chatbots over a dialog dataset
|
||||
#### Reflection & Critique
|
||||
|
||||
- [Basic Reflection](reflection/reflection.ipynb): Prompting the agent to reflect on and revise its outputs
|
||||
- [Reflexion](reflexion/reflexion.ipynb): Critiquing missing and superfluous details to guide next steps
|
||||
- [Language Agent Tree Search](lats/lats.ipynb): Using reflection and rewards to drive a tree search over agents
|
||||
- [Self-Discovering Agent](self-discover/self-discover.ipynb): Analyzing an agent that learns about its own capabilities
|
||||
|
||||
|
||||
#### Evaluation
|
||||
|
||||
- [Agent-based](chatbot-simulation-evaluation/agent-simulation-evaluation.ipynb): Evaluating chatbots via simulated user interactions
|
||||
- [Dataset-based](chatbot-simulation-evaluation/langsmith-agent-simulation-evaluation.ipynb): Evaluating chatbots in LangSmith over a dialog dataset
|
||||
+83
-69
@@ -4,8 +4,8 @@ site_url: https://langchain-ai.github.io/langgraph/
|
||||
theme:
|
||||
name: material
|
||||
custom_dir: overrides
|
||||
logo: static/img/brand/wordmark.png
|
||||
favicon: static/img/brand/favicon.png
|
||||
logo: static/wordmark.png
|
||||
favicon: static/favicon.png
|
||||
features:
|
||||
- announce.dismiss
|
||||
- content.action.edit
|
||||
@@ -54,10 +54,25 @@ plugins:
|
||||
- mkdocstrings:
|
||||
handlers:
|
||||
python:
|
||||
import:
|
||||
- https://docs.python.org/3/objects.inv
|
||||
- https://api.python.langchain.com/en/latest/objects.inv
|
||||
options:
|
||||
members_order: source
|
||||
allow_inspection: true
|
||||
heading_level: 3
|
||||
show_bases: true
|
||||
summary: true
|
||||
inherited_members: true
|
||||
# merge_init_into_class: true
|
||||
selection:
|
||||
docstring_style: google
|
||||
docstring_section_style: list
|
||||
show_root_toc_entry: false
|
||||
# show_signature_annotations: true
|
||||
# show_symbol_type_heading: true
|
||||
show_symbol_type_toc: true
|
||||
signature_crossrefs: true
|
||||
- mkdocs-jupyter:
|
||||
ignore_h1_titles: true
|
||||
execute: false
|
||||
@@ -69,83 +84,82 @@ plugins:
|
||||
nav:
|
||||
- Home:
|
||||
- 'index.md'
|
||||
- Quick Start: quick_start.ipynb
|
||||
- Concepts:
|
||||
- 'concepts.md'
|
||||
- "How-to Guides":
|
||||
- Basics:
|
||||
- State Management: how-tos/state-model.ipynb
|
||||
- Tool Integration: how-tos/sql_example.ipynb
|
||||
- Human-in-the-Loop: how-tos/human-in-the-loop.ipynb
|
||||
- Performance:
|
||||
- Async Execution: how-tos/async.ipynb
|
||||
- Streaming Responses: how-tos/streaming-tokens.ipynb
|
||||
- Graph Structure:
|
||||
- Subgraphs: how-tos/subgraph.ipynb
|
||||
- Branching: how-tos/branching.ipynb
|
||||
- Development:
|
||||
- Persistence: how-tos/persistence.ipynb
|
||||
- Visualization: how-tos/visualization.ipynb
|
||||
- Time Travel: how-tos/time-travel.ipynb
|
||||
- Benchmarking: how-tos/swe-bench.ipynb
|
||||
- Quick Start: how-tos/docs/quickstart.ipynb
|
||||
- Tutorials:
|
||||
- Agent Executors:
|
||||
- Chat Agent (Function Calling):
|
||||
- Base: tutorials/chat_agent_executor_with_function_calling/base.ipynb
|
||||
- High-Level: tutorials/chat_agent_executor_with_function_calling/high-level.ipynb
|
||||
- High-Level Tools: tutorials/chat_agent_executor_with_function_calling/high-level-tools.ipynb
|
||||
- Modifications:
|
||||
- Human-in-the-Loop: tutorials/chat_agent_executor_with_function_calling/human-in-the-loop.ipynb
|
||||
- Force Tool First: tutorials/chat_agent_executor_with_function_calling/force-calling-a-tool-first.ipynb
|
||||
- Respond in Format: tutorials/chat_agent_executor_with_function_calling/respond-in-format.ipynb
|
||||
- Dynamic Direct Return: tutorials/chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb
|
||||
- Manage Agent Steps: tutorials/chat_agent_executor_with_function_calling/managing-agent-steps.ipynb
|
||||
- Langchain Agent:
|
||||
- Base: tutorials/agent_executor/base.ipynb
|
||||
- High-Level: tutorials/agent_executor/high-level.ipynb
|
||||
- Modifications:
|
||||
- Human-in-the-Loop: tutorials/agent_executor/human-in-the-loop.ipynb
|
||||
- Force Tool First: tutorials/agent_executor/force-calling-a-tool-first.ipynb
|
||||
- Manage Agent Steps: tutorials/agent_executor/managing-agent-steps.ipynb
|
||||
- Planning Agents:
|
||||
- Plan-and-Execute: tutorials/plan-and-execute/plan-and-execute.ipynb
|
||||
- Reasoning w/o Observation: tutorials/rewoo/rewoo.ipynb
|
||||
- LLMCompiler: tutorials/llm-compiler/LLMCompiler.ipynb
|
||||
- Reflection & Critique:
|
||||
- Basic Reflection: tutorials/reflection/reflection.ipynb
|
||||
- Reflexion: tutorials/reflexion/reflexion.ipynb
|
||||
- Language Agent Tree Search: tutorials/lats/lats.ipynb
|
||||
- Multi-Agent Systems:
|
||||
- Collaboration: tutorials/multi_agent/multi-agent-collaboration.ipynb
|
||||
- Supervision: tutorials/multi_agent/agent_supervisor.ipynb
|
||||
- Hierarchical Teams: tutorials/multi_agent/hierarchical_agent_teams.ipynb
|
||||
- Research & QA:
|
||||
- Web Research (STORM): tutorials/storm/storm.ipynb
|
||||
- Retrieval-Augmented Generation:
|
||||
- 'tutorials/index.md'
|
||||
- Agent Executor:
|
||||
- "Base": tutorials/agent_executor/base.ipynb
|
||||
- "High-Level": tutorials/agent_executor/high-level.ipynb
|
||||
- Chat Agent Executor:
|
||||
- "Base": tutorials/chat_agent_executor_with_function_calling/base.ipynb
|
||||
- "High-Level": tutorials/chat_agent_executor_with_function_calling/high-level.ipynb
|
||||
- "Tool Node": tutorials/chat_agent_executor_with_function_calling/prebuilt-tool-node.ipynb
|
||||
- "High-Level Tools": tutorials/chat_agent_executor_with_function_calling/high-level-tools.ipynb
|
||||
- Use cases:
|
||||
- Chatbots:
|
||||
- Customer Support: tutorials/chatbots/customer-support.ipynb
|
||||
- Info Gathering: tutorials/chatbots/information-gather-prompting.ipynb
|
||||
- Code Assistant: tutorials/code_assistant/langgraph_code_assistant.ipynb
|
||||
- Web Navigation: tutorials/web-navigation/web_voyager.ipynb
|
||||
- Multi-Agent Systems:
|
||||
- Collaboration: tutorials/multi_agent/multi-agent-collaboration.ipynb
|
||||
- Supervision: tutorials/multi_agent/agent_supervisor.ipynb
|
||||
- Hierarchical Teams: tutorials/multi_agent/hierarchical_agent_teams.ipynb
|
||||
- RAG:
|
||||
- tutorials/rag/langgraph_adaptive_rag.ipynb
|
||||
- tutorials/rag/langgraph_adaptive_rag_cohere.ipynb
|
||||
- tutorials/rag/langgraph_adaptive_rag_local.ipynb
|
||||
- tutorials/rag/langgraph_agentic_rag.ipynb
|
||||
- tutorials/rag/langgraph_agentic_rag.ipynb
|
||||
- tutorials/rag/langgraph_crag.ipynb
|
||||
- tutorials/rag/langgraph_crag_local.ipynb
|
||||
- tutorials/rag/langgraph_self_rag.ipynb
|
||||
- tutorials/rag/langgraph_self_rag.ipynb
|
||||
- tutorials/rag/langgraph_self_rag_local.ipynb
|
||||
- Applications:
|
||||
- Chatbots:
|
||||
- Customer Support: tutorials/chatbots/customer-support.ipynb
|
||||
- Info Gathering: tutorials/chatbots/information-gather-prompting.ipynb
|
||||
- Code Assistant: tutorials/code_assistant/langgraph_code_assistant.ipynb
|
||||
- Web Navigation: tutorials/web-navigation/web_voyager.ipynb
|
||||
- Evaluation & Analysis:
|
||||
- Chatbot Eval via Sim:
|
||||
- Agent-based: tutorials/chatbot-simulation-evaluation/agent-simulation-evaluation.ipynb
|
||||
- Dataset-based: tutorials/chatbot-simulation-evaluation/langsmith-agent-simulation-evaluation.ipynb
|
||||
- Self-Discovering Agent: tutorials/self-discover/self-discover.ipynb
|
||||
- Swarm: tutorials/gptswarm/swarm.ipynb
|
||||
- Web Research (STORM): tutorials/storm/storm.ipynb
|
||||
- Planning Agents:
|
||||
- Plan-and-Execute: tutorials/plan-and-execute/plan-and-execute.ipynb
|
||||
- Reasoning w/o Observation: tutorials/rewoo/rewoo.ipynb
|
||||
- LLMCompiler: tutorials/llm-compiler/LLMCompiler.ipynb
|
||||
- Reflection & Critique:
|
||||
- Basic Reflection: tutorials/reflection/reflection.ipynb
|
||||
- Reflexion: tutorials/reflexion/reflexion.ipynb
|
||||
- Language Agent Tree Search: tutorials/lats/lats.ipynb
|
||||
- Self-Discovering Agent: tutorials/self-discover/self-discover.ipynb
|
||||
- Evaluation & Analysis:
|
||||
- Chatbot Eval via Sim:
|
||||
- Agent-based: tutorials/chatbot-simulation-evaluation/agent-simulation-evaluation.ipynb
|
||||
- Dataset-based: tutorials/chatbot-simulation-evaluation/langsmith-agent-simulation-evaluation.ipynb
|
||||
|
||||
- "How-to Guides":
|
||||
- 'how-tos/index.md'
|
||||
- Core:
|
||||
- "Quick Start": how-tos/docs/quickstart.ipynb
|
||||
- "State Management": how-tos/state-model.ipynb
|
||||
- "Async Execution": how-tos/async.ipynb
|
||||
- "Streaming Responses": how-tos/streaming-tokens.ipynb
|
||||
- "Human-in-the-Loop": how-tos/human-in-the-loop.ipynb
|
||||
- "Persistence": how-tos/persistence.ipynb
|
||||
- "Time Travel": how-tos/time-travel.ipynb
|
||||
- "Visualization": how-tos/visualization.ipynb
|
||||
- "Pydantic State": how-tos/state-model.ipynb
|
||||
- "Subgraphs": how-tos/subgraph.ipynb
|
||||
- "Branching": how-tos/branching.ipynb
|
||||
- Chat Agent (Function Calling):
|
||||
- Human-in-the-Loop: how-tos/chat_agent_executor_with_function_calling/human-in-the-loop.ipynb
|
||||
- Force Tool First: how-tos/chat_agent_executor_with_function_calling/force-calling-a-tool-first.ipynb
|
||||
- Respond in Format: how-tos/chat_agent_executor_with_function_calling/respond-in-format.ipynb
|
||||
- Dynamic Direct Return: how-tos/chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb
|
||||
- Manage Agent Steps: how-tos/chat_agent_executor_with_function_calling/managing-agent-steps.ipynb
|
||||
- AgentExecutor:
|
||||
- Human-in-the-Loop: how-tos/agent_executor/human-in-the-loop.ipynb
|
||||
- Force Tool First: how-tos/agent_executor/force-calling-a-tool-first.ipynb
|
||||
- Manage Agent Steps: how-tos/agent_executor/managing-agent-steps.ipynb
|
||||
- Persistance:
|
||||
- "Persistance in Postgres": how-tos/persistence_postgres.ipynb
|
||||
|
||||
- Reference:
|
||||
- Graphs: reference/graphs.md
|
||||
- Checkpointing: reference/checkpoints.md
|
||||
- Prebuilt Components: reference/prebuilt_components.md
|
||||
- Prebuilt Components: reference/prebuilt.md
|
||||
|
||||
|
||||
markdown_extensions:
|
||||
|
||||
Reference in New Issue
Block a user