Open-source project
langchain-ai/react-agent avatar
langchain-ai/react-agent

react-agent: a LangGraph template for a ReAct agent you are meant to edit

LangGraph template for a simple ReAct agent

854 stars701 forksPythonMIT

At a glance

What is it?
The react-agent repository is a starting point rather than a product, four source files that implement the reason-then-act loop with LangGraph, plus a model default, a search tool and a Studio workflow for editing past state. What makes it useful is the shape of the extension points, and what limits it is that the version is 0.0.1 and the tooling assumes you have Studio running.
Who is it for?
Adopt this template if you want a working ReAct loop in LangGraph to fork rather than a library to depend on, since the whole point is that the four source files are meant to be edited and the Studio workflow lets you debug a graph by rerunning it from a past state. Do not adopt it as a dependency, because the project version is 0.0.1, there are no releases to pin, and the package is published under two names, so treat it as code you copy.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

This is a starting point, and the README says so

The react-agent repository is described as a LangGraph template for a simple ReAct agent, and the project description calls it a starter template for making a custom Reasoning and Action agent, using tool calling, in LangGraph. The project metadata puts the version at 0.0.1, and the repository has no GitHub releases.

That version number is the honest summary of what this is. It is not a package anyone installs and forgets. It is a small working example that a team copies into its own repository and then edits until it stops resembling the template.

The agent itself is the classic ReAct pattern, and the README points at the paper for it. The loop is described in five steps: the agent takes a user query as input, reasons about the query and decides on an action, executes that action using the available tools, observes the result, and repeats the middle three steps until it can provide a final answer.

The implementation is LangGraph, and the template is designed for LangGraph Studio, which is the graphical environment where a graph is edited and run. The README describes ReAct agents as uncomplicated and prototypical agents that can be flexibly extended to many tools, and that framing is the whole selling point of a template like this: it shows the smallest thing that works, so that the next person can see where to put their own code.

The licence is MIT, the language is Python with a requirement of 3.11 or newer, and the last push was on 2026-10-15, so the template is being kept in step with the framework it demonstrates.

Four files carry the whole agent

The repository has a src/ directory with a react_agent package inside it, and the README points at four files by name, which is the quickest way to understand the structure.

The core logic is in graph.py, and it holds the flexible ReAct agent that iteratively reasons about user queries and executes actions. The tools are in tools.py, and a tool is any Python function that performs a specific task. The system prompt is in prompts.py, and the default system message is there too, in a file called context.py, which is where the runtime context and the default persona live.

The dependency list in the project file explains how much of the world this touches. LangGraph itself is at 1.2.11 or newer, and alongside it sit the OpenAI, Anthropic and Fireworks integrations, the core langchain package, python-dotenv, and the Tavily integration for search. So the template supports three model providers out of the box, plus a search provider, and it wires the environment file itself.

The package metadata has one detail that is easy to miss. The setuptools configuration maps the same source directory to two package names, langgraph.templates.react_agent and react_agent, with the first one being the name under which the template is distributed in the LangGraph ecosystem. The package data also includes a py.typed marker, so the template is typed for consumers.

The graph is also where you are expected to change the shape of the agent. The README says you can modify the agent's reasoning process in graph.py and adjust the ReAct loop or add additional steps to the decision-making process, and the studio view in the README screenshot shows that as a graph rather than as code.

Setup assumes Studio, a Tavily key and a specific default model

The getting started section opens with a precondition that shapes everything else: it assumes you have already installed LangGraph Studio.

With that in place, the first step is to create the environment file from the example:

bash
cp .env.example .env

Then you define the required API keys in that file. The primary search tool is Tavily, so a Tavily key is the one you cannot skip, and the README links to the place to create it. The example environment file also shows the shape of the rest, with a LangSmith project name to separate your traces from another application, and the keys for the three model providers:

bash
ANTHROPIC_API_KEY=your-api-key
bash
OPENAI_API_KEY=your-api-key

The default model is configured in one line of configuration, and the default is a specific named Anthropic model:

yaml
model: claude-sonnet-4-5-20250929

To use a different one, the README says you can select a compatible chat model with the provider/model-name form through runtime context, and it gives the example openai/gpt-4-turbo-preview. That is the same mechanism the studio uses, so the model can be changed from the interface without editing the configuration.

The consequence for a new user is that the template is opinionated about providers. Anthropic, OpenAI and Fireworks are wired in, the environment file expects keys for all three plus Tavily, and the default points at one specific Anthropic model. Anyone who wants a different provider has to add the integration, and the README's promise is that it is a small job rather than a large one.

The development loop is about editing past state, not editing code

The Development section describes a workflow that is specific to LangGraph Studio and worth understanding before you start changing things.

While iterating on a graph you can edit past state and rerun your application from past states to debug specific nodes, and local changes are applied automatically through hot reload. That is the core of the idea: instead of re-running the agent from the beginning to reach the state where the bug appears, you park the graph at that state and iterate from there.

The README gives three concrete starting points for that. Add an interrupt before the agent calls tools, which is the standard way to stop and inspect what the model decided to do. Update the default system message in context.py to give the agent a persona. Or add additional nodes and edges, which is how you extend the decision-making process beyond the plain ReAct loop.

The conversation model in the studio is also worth knowing. Follow-up requests are appended to the same thread, and you can create an entirely new thread, clearing the previous history, with the plus button in the top right. So the same graph can be run as a long conversation or as a fresh single query, which matters when you are comparing a system prompt change against a single turn.

For tracing and collaboration, LangGraph Studio integrates with LangSmith, and the environment file carries a project name for that purpose. The README also points at the LangGraph documentation, described as under construction, for patterns and examples to adapt.

The toolchain is strict, and the lint rules say what the project values

The Makefile and the project configuration show the standard a template is expected to meet, and they are worth copying if you fork it.

The lint target runs four checks in sequence: ruff for the general rules, ruff format in diff mode so formatting differences are reported rather than applied, ruff with the import rules selected to check sorting, and mypy in strict mode. There are separate targets so the same checks can be pointed at the package, at the tests or at only the files that changed on the branch, which is the lint_diff variant. The format target applies both the formatter and the import sorting fix.

The ruff configuration in the project file selects pycodestyle, pyflakes, isort, pydocstyle, the imperative mood rule, print statement detection and pyupgrade, with a handful of ignores that are explained in comments, including one that says the project does want to import from typing_extensions and another that relaxes the requirement to document every function parameter. The docstring convention is set to google, and the tests directory has the docstring and pyupgrade rules switched off entirely.

There is also a spell check, run through codespell against the pyproject configuration, with a codespellignore file at the root, and the .codespellignore name says exactly what that is for.

The test targets are equally thorough. There is a plain unit test target over tests/unit_tests, an integration test target, a watch mode that uses pytest-watch with snapshot updating, a profiling target that writes a profile SVG, and an extended test target that runs only the tests marked as extended. The development dependency group adds the LangGraph CLI with the in-memory backend, pytest, and anyio.

What all this adds up to is a template that arrives with a real quality bar, which matters because the people who fork it are usually the people who will own the code afterwards.

The limits of a template that ships as code

A few things are conspicuously absent, and they are worth knowing before you commit to the approach.

There is no homepage, no documentation site of its own and no releases. The project version is 0.0.1. This is a template that is meant to be copied rather than depended upon, and if you do depend on it, you are depending on a package that is published under two names and has no changelog to consult, only the commit history.

The version floors are the other constraint. The dependencies require LangGraph 1.2.11 or newer, langchain 1.3.17 or newer, the provider integrations at 1.6.x, and the Tavily integration at 0.2.18 or newer, and the project requires Python 3.11 or newer with an upper bound of 4.0. A team that has pinned older versions of any of those cannot use the template unchanged.

The model coupling is the other one. The default configuration names one specific Anthropic model, the environment file expects keys for three providers plus a search provider, and the tool list starts with Tavily. The README says extending with custom tools is easy, and the tool interface is just a Python function, so the search side is genuinely cheap to change. Swapping the model family is slightly more work, since the provider integration has to be present.

Finally, the agent has no memory, no evaluation and no production plumbing. It is a loop, a tool, a prompt and a graph, which is exactly what a template should be, and exactly what you have to build the rest of.

Editorial conclusion

Adopt this template if you want a working ReAct loop in LangGraph to fork rather than a library to depend on, since the whole point is that the four source files are meant to be edited and the Studio workflow lets you debug a graph by rerunning it from a past state. Do not adopt it as a dependency, because the project version is 0.0.1, there are no releases to pin, and the package is published under two names, so treat it as code you copy. Before you build on it, check that the LangGraph version your project already uses is compatible with the 1.2.11 floor this template declares, and decide which model provider you will use, because the default in the configuration is a specific Anthropic model and the environment file expects keys for three providers and a search provider.

Frequently asked questions

What does the react-agent template implement?

A ReAct agent built on LangGraph. The README describes the loop as taking a user query, reasoning about it and deciding on an action, executing that action with the available tools, observing the result, and repeating until it can give a final answer. The core logic is in src/react_agent/graph.py.

How do I set up the react-agent template?

The README assumes you have already installed LangGraph Studio, then says to create a .env file with cp .env.example .env and define the required API keys, with the primary search tool being Tavily. The default model is configured as a single line, and you can select another compatible chat model with the provider/model-name form.

How do I add my own tools to the agent?

You add them in tools.py, and the README says these can be any Python functions that perform specific tasks. The same file holds the search tool, which is the Tavily integration, so a new tool is a function and a registration.

What does LangGraph Studio add to the development workflow?

The README says you can edit past state and rerun your application from past states to debug specific nodes, with local changes applied through hot reload. It suggests adding an interrupt before the agent calls tools, updating the default system message in context.py to take on a persona, and adding nodes and edges.

Is react-agent published as a package I can depend on?

It is published under two names, langgraph.templates.react_agent and react_agent, both mapped to the same source directory, and the project version is 0.0.1 with no GitHub releases. The dependencies require LangGraph 1.2.11 or newer and Python 3.11 or newer, so treat it as code to copy rather than a version to pin.

Official sources

  1. Issues
  2. langchain-ai/react-agent on GitHub
  3. License: MIT
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/langchain-ai-react-agent.svg)](https://hysenlabs.com/projects/langchain-ai-react-agent)

Was this useful?