LangChain.js migration guide
Migrate LangChain.js from 0.2 to 0.3 or from 0.3 to 1.0. Find the langchain and @langchain/core imports that break in your code and review supported fixes.
Choose your LangChain.js migration path
LangChain.js is published as langchain and @langchain/core, and a major upgrade moves both. Start with the release you are moving to. Each guide names the changes Emendant covers, shows code before and after, and states what still needs your review.
- Migrate langchain 0.2 to 0.3: 39 document loader and tool subpaths move to
@langchain/communityunder the same names, andlangchain/memory/indexbecomeslangchain/memory. Read it with the LangChain v0.3 migration notes. - Migrate langchain 0.3 to 1.0: chains, legacy agents, retrievers, memory and document loaders move to
@langchain/classic, andRemoteRunnableis removed. Also read the@langchain/core1.0 guide:predictandpredictMessagesare removed from chat models, with four legacy subpaths and 24 named exports. Read both with the LangChain v1 migration guide. - Later 1.x releases of both packages: each page covers a change to agent, middleware, model or stream types, such as
streamEventsv3 for agents in langchain 1.4.0. Read the page for each release between your current version and your target. Thelangchainpages are listed below, and the@langchain/corerelease pages list the rest.
Check your repository before you upgrade
- Check the installed
langchainand@langchain/coreversions in your manifest and lockfile. Read each guide between those versions and your target. - Run
npx emendant scanin your TypeScript or JavaScript repository. It reports supported changes at affected call sites without editing your files. - Review the findings, then run
npx emendant fix --dry-runto inspect eligible patches. Emendant does not update package versions or install packages for you. The 0.3 and 1.0 patches rewrite imports to@langchain/communityor@langchain/classic, so add that package before you apply them. - After you update dependencies, run your own typecheck and tests.
What Emendant fixes, and the gaps
- Transforms patch the import moves in langchain 0.3 and 1.0. The
@langchain/core1.0 changes and the type changes in later 1.x releases are patched only when you name a model provider. - Some removals have no replacement, so Emendant reports them and does not patch them: the self-query translators and the NotionDB loader in 0.3,
RemoteRunnablein 1.0, and four legacy@langchain/coresubpaths. - Emendant does not move legacy chains or agents to the 1.0 agent API. It moves their imports to
@langchain/classic, which publishes the same modules. - The feed covers
langchainand@langchain/coreonly. A scan does not report changes in@langchain/community,@langchain/classic,@langchain/langgraphor provider packages such as@langchain/openai.
Emendant reports only changes in its curated feed. A clean scan does not prove that every LangChain.js migration step is complete. Read the supported projects guide for the current scope and the fix guide for patch grades.
LangChain.js release pages
- langchain 1.x breaking changes: 1.0.3 to 1.5.17
18 releases, 1.0.3 to 1.5.17, released 6 November 2025 to 15 October 2026. 55 breaking, 6 deprecations. - LangChain 1.0 for JavaScript: the legacy modules moved to @langchain/classic
langchain 1.0.1, released 18 October 2025. 2 breaking, 0 deprecations. - LangChain 0.3 for JavaScript: 39 entrypoints move to @langchain/community, six are gone
langchain 0.3.0, released 13 September 2024. 3 breaking, 0 deprecations.
Releases without a page here may still be in the feed. Run emendant feed status to see what your snapshot holds.