mirror of
https://github.com/langchain-ai/react-agent-tool-server.git
synced 2026-06-29 22:13:20 -04:00
main
LangGraph ReAct Agent Template
A LangGraph Platform agent template that can be used to deploy a ReAct agent with access to a universal-tool-server.
LangGraph Studio UI
Use the LangGraph Studio UI to create and manage agents via simple configuration.
Getting started
To use this template, follow these steps:
- Deploy a universal-tool-server: You can use the example tool server or create your own.
- Launch the ReAct agent locally: Use the tool server URL and API key to launch the ReAct agent locally.
- Deploy on LangGraph Cloud: Follow the tutorial here: https://langchain-ai.github.io/langgraph/cloud/quick_start/, but fork this repository instead of the regular react agent template.
Deploy a Universal Tool Server
Using the Example Tool Server
-
Get the code
git clone git@github.com:langchain-ai/example-tool-server.git -
Run the tool server
cd example-tool-server # Only disable auth if you are running the tool server locally. # This is done for simplicity during development. DISABLE_AUTH=true uv run uvicorn app.server:app
See the example-tool-server for more information on how to deploy and configure the tool server.
From Scratch
-
Install the universal-tool-server package.
pip install universal-tool-server -
Create a new Python file called server.py and implement a simple tool server:
from universal_tool_server import Server app = Server() # Define tools @app.add_tool(permissions=["group1"]) async def echo(msg: str) -> str: """Echo a message.""" return msg + "!" -
Run the tool server.
uv run uvicorn server:app
Launch the ReAct Agent
If you already have a tool server running, you can launch the ReAct agent with the following command:
# Specify at least one chat model API key!
export ANTHROPIC_API_KEY="..."
export OPENAI_API_KEY="..."
# If you enabled auth on the tool server, set the API key.
# If you disabled auth, you set it to a non empty placeholder string.
export TOOL_SERVER_API_KEY="Authorization header token"
# Set the tool server URL
export TOOL_SERVER_URL="http://localhost:8000"
# Launch the ReAct agent
uv run langgraph dev
Languages
Python
85.8%
Makefile
14.2%
