Manage ecosystem dependencies¶
LangGraph.js is part of the LangChain ecosystem, which includes the primary langchain
package as well as packages that contain integrations with individual third-party providers. They can be as specific as @langchain/anthropic
, which contains integrations just for Anthropic chat models, or as broad as @langchain/community
, which contains broader variety of community contributed integrations.
These packages, as well as LangGraph.js itself, all depend on @langchain/core
, which contains the base abstractions that these packages extend.
To ensure that all integrations and their types interact with each other properly, it is important that they all use the same version of @langchain/core
. The best way to guarantee this is to add a "resolutions"
or "overrides"
field like the following in your project's package.json
. The specific field name will depend on your package manager. Here are a few examples:
Tip
The resolutions
or pnpm.overrides
fields for yarn
or pnpm
must be set in the root package.json
file.
If you are using yarn
, you should set "resolutions"
:
{
"name": "your-project",
"version": "0.0.0",
"private": true,
"engines": {
"node": ">=18"
},
"dependencies": {
"@langchain/anthropic": "^0.2.1",
"@langchain/langgraph": "0.0.23"
},
"resolutions": {
"@langchain/core": "0.2.6"
}
}
For npm
, use "overrides"
:
{
"name": "your-project",
"version": "0.0.0",
"private": true,
"engines": {
"node": ">=18"
},
"dependencies": {
"@langchain/anthropic": "^0.2.1",
"@langchain/langgraph": "0.0.23"
},
"overrides": {
"@langchain/core": "0.2.6"
}
}
For pnpm
, use the nested "pnpm.overrides"
field:
{
"name": "your-project",
"version": "0.0.0",
"private": true,
"engines": {
"node": ">=18"
},
"dependencies": {
"@langchain/anthropic": "^0.2.1",
"@langchain/langgraph": "0.0.23"
},
"pnpm": {
"overrides": {
"@langchain/core": "0.2.6"
}
}
}
Next steps¶
You've now learned about some special considerations around using LangGraph.js with other LangChain ecosystem packages.
Next, check out some how-to guides on core functionality.