mirror of
https://github.com/langchain-ai/react-agent-js.git
synced 2026-07-19 22:23:54 -04:00
[PR #8] [MERGED] Modernize project to use LangChain v1 createAgent
#8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langchain-ai/react-agent-js/pull/8
Author: @christian-bromann
Created: 12/26/2025
Status: ✅ Merged
Merged: 12/29/2025
Merged by: @christian-bromann
Base:
main← Head:cb/update📝 Commits (1)
2113e87chore: update project to use createAgent📊 Changes
23 files changed (+4841 additions, -4813 deletions)
View changed files
📝
.env.example(+29 -10)➖
.eslintrc.cjs(+0 -61)📝
.github/assets/studio_ui.png(+0 -0)📝
.gitignore(+1 -6)📝
README.md(+150 -206)➕
eslint.config.ts(+14 -0)➖
jest.config.js(+0 -18)📝
langgraph.json(+2 -2)📝
package.json(+27 -31)➕
pnpm-lock.yaml(+4311 -0)➕
src/agent.ts(+54 -0)➕
src/index.ts(+39 -0)➕
src/prompts.ts(+53 -0)➖
src/react_agent/configuration.ts(+0 -32)➖
src/react_agent/graph.ts(+0 -75)➖
src/react_agent/prompts.ts(+0 -7)➖
src/react_agent/tests/integration/graph.int.test.ts(+0 -18)➖
src/react_agent/tests/unit/graph.test.ts(+0 -3)➖
src/react_agent/tools.ts(+0 -23)➖
src/react_agent/utils.ts(+0 -18)...and 3 more files
📄 Description
This PR completely modernizes the template project by migrating from the deprecated manual ReAct agent implementation to the new LangChain v1
createAgentAPI.🎯 Overview
The old implementation used a custom
StateGraphwith manually wired nodes and edges. This has been replaced withcreateAgentfromlangchain, which provides a cleaner, more maintainable approach with built-in middleware support.✨ What's Changed
Architecture
StateGraphimplementation withcreateAgentfromlangchainsrc/react_agent/tosrc/Dependencies
@langchain/openaifor OpenAI model support@langchain/langgraphdirect dependency (now handled internally bycreateAgent)Tooling
.eslintrc.cjsto modern flat config (eslint.config.ts)Example Tools
calculator,get_current_time,get_weather,search_knowledgetool()functionDocumentation
.github/assets/🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.