[PR #8] [MERGED] Modernize project to use LangChain v1 createAgent #8

Closed
opened 2026-02-16 05:19:17 -05:00 by yindo · 0 comments
Owner

📋 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: mainHead: cb/update


📝 Commits (1)

  • 2113e87 chore: 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 createAgent API.

🎯 Overview

The old implementation used a custom StateGraph with manually wired nodes and edges. This has been replaced with createAgent from langchain, which provides a cleaner, more maintainable approach with built-in middleware support.

What's Changed

Architecture

  • Replaced custom StateGraph implementation with createAgent from langchain
  • Simplified project structure: moved from src/react_agent/ to src/
  • Removed deprecated configuration and utility files

Dependencies

  • Updated to Zod v4 for tool schemas
  • Added @langchain/openai for OpenAI model support
  • Removed @langchain/langgraph direct dependency (now handled internally by createAgent)
  • Switched from Yarn to pnpm as package manager
  • Updated Node.js target to v24

Tooling

  • Migrated from .eslintrc.cjs to modern flat config (eslint.config.ts)
  • Removed Jest test setup (can be re-added as needed)
  • Simplified npm scripts

Example Tools

  • Added 4 example tools with Zod schemas: calculator, get_current_time, get_weather, search_knowledge
  • Clear patterns for defining tools using the new tool() function

Documentation

  • Updated README with new API examples and middleware patterns
  • Updated links to point to current LangChain/LangSmith documentation
  • Moved static assets to .github/assets/

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/react-agent-js/pull/8 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 12/26/2025 **Status:** ✅ Merged **Merged:** 12/29/2025 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `cb/update` --- ### 📝 Commits (1) - [`2113e87`](https://github.com/langchain-ai/react-agent-js/commit/2113e87f3dd42b461ed7d3f84567d498ba90de28) chore: update project to use createAgent ### 📊 Changes **23 files changed** (+4841 additions, -4813 deletions) <details> <summary>View changed files</summary> 📝 `.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_ </details> ### 📄 Description This PR completely modernizes the template project by migrating from the deprecated manual ReAct agent implementation to the new LangChain v1 `createAgent` API. ### 🎯 Overview The old implementation used a custom `StateGraph` with manually wired nodes and edges. This has been replaced with `createAgent` from `langchain`, which provides a cleaner, more maintainable approach with built-in middleware support. ### ✨ What's Changed **Architecture** - Replaced custom `StateGraph` implementation with `createAgent` from `langchain` - Simplified project structure: moved from `src/react_agent/` to `src/` - Removed deprecated configuration and utility files **Dependencies** - Updated to Zod v4 for tool schemas - Added `@langchain/openai` for OpenAI model support - Removed `@langchain/langgraph` direct dependency (now handled internally by `createAgent`) - Switched from Yarn to pnpm as package manager - Updated Node.js target to v24 **Tooling** - Migrated from `.eslintrc.cjs` to modern flat config (`eslint.config.ts`) - Removed Jest test setup (can be re-added as needed) - Simplified npm scripts **Example Tools** - Added 4 example tools with Zod schemas: `calculator`, `get_current_time`, `get_weather`, `search_knowledge` - Clear patterns for defining tools using the new `tool()` function **Documentation** - Updated README with new API examples and middleware patterns - Updated links to point to current LangChain/LangSmith documentation - Moved static assets to `.github/assets/` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 05:19:17 -05:00
yindo closed this issue 2026-02-16 05:19:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/react-agent-js#8