
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@langchain/langgraph
Advanced tools
[!NOTE] Looking for the Python version? See the Python repo and the Python docs.
LangGraph — used by Replit, Uber, LinkedIn, GitLab and more — is a low-level orchestration framework for building controllable agents. While langchain provides integrations and composable components to streamline LLM application development, the LangGraph library enables agent orchestration — offering customizable architectures, long-term memory, and human-in-the-loop to reliably handle complex tasks.
npm install @langchain/langgraph @langchain/core
To learn more about how to use LangGraph, check out the docs. We show a simple example below of how to create a ReAct agent.
// npm install @langchain-anthropic
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { ChatAnthropic } from "@langchain/anthropic";
import { tool } from "@langchain/core/tools";
import { z } from "zod";
const search = tool(async ({ query }) => {
if (query.toLowerCase().includes("sf") || query.toLowerCase().includes("san francisco")) {
return "It's 60 degrees and foggy."
}
return "It's 90 degrees and sunny."
}, {
name: "search",
description: "Call to surf the web.",
schema: z.object({
query: z.string().describe("The query to use in your search."),
}),
});
const model = new ChatAnthropic({
model: "claude-3-7-sonnet-latest"
});
const agent = createReactAgent({
llm: model,
tools: [search],
});
const result = await agent.invoke(
{
messages: [{
role: "user",
content: "what is the weather in sf"
}]
}
);
Get started quickly by building a full-stack LangGraph application using the create-agent-chat-app
CLI:
npx create-agent-chat-app@latest
The CLI sets up a chat interface and helps you configure your application, including:
npm
, yarn
, or pnpm
)LangGraph is built for developers who want to build powerful, adaptable AI agents. Developers choose LangGraph for:
LangGraph is trusted in production and powering agents for companies like:
While LangGraph can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools for building agents. To improve your LLM application development, pair LangGraph with:
While LangGraph is our open-source agent orchestration framework, enterprises that need scalable agent deployment can benefit from LangGraph Platform.
LangGraph Platform can help engineering teams:
LangGraph is inspired by Pregel and Apache Beam. The public interface draws inspiration from NetworkX. LangGraph is built by LangChain Inc, the creators of LangChain, but can be used without LangChain.
FAQs
LangGraph
We found that @langchain/langgraph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.