What this thread does
The problem
Your coding agent generates old imports, or an upgrade leaves prompts and streamed output wrong. Choose between restoring legacy imports, migrating the prebuilt loop, and retaining a custom graph. This answers how to upgrade an existing app.
Versions and licences
| Package | Registry observation | Licence |
|---|---|---|
Python langchain | As of November 2026, 1.5.2; checked 2026-11-24 | MIT; checked 2026-10-20; PyPI |
Python langgraph | As of November 2026, 1.2.24; checked 2026-11-24 | MIT; checked 2026-10-20; PyPI |
JavaScript langchain, @langchain/langgraph | Exact npm versions unverified; fetches failed; checked 2026-10-20 | Not reverified |
These are registry observations, not a tested compatible lockfile. No hosted-service or model-price comparison.
What changed
- Announced 2025-10-22; checked 2026-10-20. LangChain 1.0 and LangGraph 1.0 (checked 2026-10-20) introduced an agent-focused surface and middleware. Official announcement.
- Migration status checked 2026-10-20. Legacy chains, retrievers, indexing and hub code left LangChain's main namespace.
LLMChainandConversationChainmoved tolangchain-classic; they were not all deleted. Deprecated agents are legacy functionality, not automatically converted agents. Python migration guide. - Deprecations checked 2026-10-20. LangGraph's
create_react_agentis deprecated in favour oflangchain.agents.create_agent; the core graph API is largely backwards compatible.MessageGraphis deprecated in favour ofStateGraphwith messages. Python >=3.10 is required (checked 2026-10-20). LangGraph migration guide. - Behaviour checked 2026-10-20. Middleware controls prompts, model calls and tools through hooks including
before_model,after_model,wrap_model_callandwrap_tool_call. Release notes.
What breaks
Old retriever imports can produce ModuleNotFoundError: No module named 'langchain.retrievers'. ChoYongHo's docs issue #1195 reproduces this exact message; checked 2026-10-20.
Dynamic prompts cannot be migrated by merely renaming their argument. Hooks, custom agent state and pre-bound models need review. Stream consumers filtering on "agent" can miss output because the new factory uses "model". Prompted structured output is removed; use ToolStrategy or ProviderStrategy. Python migration guide, checked 2026-10-20.
When to pick which
| Constraint | Route |
|---|---|
| Restore legacy chains/retrievers with a small diff | langchain-classic and import changes |
| Standard agent with custom hooks | create_agent and middleware |
Hand-built StateGraph | Keep the graph; audit dependencies/deprecations |
| TypeScript app | Use the JavaScript guide and its API spellings |
How to migrate
Ordered steps; API names and commands checked 2026-10-20. Instructions for your branch, not commands run for this draft.
1. Save the lockfile. Run python -m pip show langchain langgraph langchain-core and python -m pip check. Search source for langchain.chains, langchain.retrievers, initialize_agent, AgentExecutor, create_react_agent, pre_model_hook and post_model_hook. Inventory state and stream filters. 2. For compatibility, the guide gives pip install langchain-classic. Use from langchain_classic.chains import LLMChain; move old retrievers under langchain_classic.retrievers. Keep provider integrations separate. Python migration guide. 3. The graph guide gives pip install -U langgraph langchain-core. Resolve dependencies in your project environment and record the resulting lockfile. Replace the factory as below; model and tools are your existing objects, so no model-ID change is needed. LangGraph migration guide.
from langchain.agents import create_agent
agent = create_agent(
model,
tools,
system_prompt="You are a helpful assistant.",
)
4. Move pre/post model hooks to before_model/after_model, dynamic instructions to @dynamic_prompt, and tool exception handling to wrap_tool_call. Custom agent state uses TypedDict, rather than old Pydantic/dataclass state. Python migration guide. Preserve checkpoint thread identity when moving per-run dependencies to context. 5. Update streaming filters and structured-output handling. Prefer content_blocks when you need provider-independent output. Release notes. 6. For JavaScript, the guide gives npm install langchain@latest @langchain/core@latest and npm install @langchain/classic. Replace createReactAgent from @langchain/langgraph/prebuilts with createAgent from langchain; use systemPrompt, beforeModel, afterModel and wrapToolCall. These are documented commands, not verified npm pins. JavaScript migration guide, checked 2026-10-20.
What to test
Check imports and dependencies, then compare a no-tool answer, one tool call, a tool exception, dynamic prompts, structured output and streamed node labels. Test sync/async middleware paths you use. Resume a checkpointed test conversation and verify custom state and thread identity. Compare with the old lockfile; installation alone proves little.
Community evidence
- ChoYongHo / bart0401, docs #1195, reports outdated retriever examples and supplies corrected imports. The issue links a closing pull request. It supports the import failure, not a whole-app rewrite; checked 2026-10-20.
- Mathijs de Bruin / dokterbob, LangChain #37627, reports losing callable-prompt ergonomics. Closed as not planned. One user's migration friction; the current guide documents dynamic-prompt middleware; checked 2026-10-20.
Pitfalls
Do not call every deprecated symbol removed. Do not replace a custom graph solely to silence a warning. Keep compatibility imports and factory migration as separate reviewable changes. Do not copy old hook arguments into the new factory or assume streaming output is unchanged.
A prompt to give your agent
Your training data predates this migration. Read <https://docs.langchain.com/oss/python/migrate/langchain-v1> and <https://docs.langchain.com/oss/python/migrate/langgraph-v1>, or the linked JavaScript guide for this repository. Do not guess APIs or model IDs. Inspect our lockfile, legacy imports and hooks; recommend compatibility imports versus factory migration. Cite each official mapping, preserve our configured model, change one path at a time, and test tools, prompts, structured output, streams and checkpoint resume. Report anything the current docs do not verify.
Limits
Checked 2026-10-20. No packages installed, migration applied, agents run or checkpoint compatibility tested. Community evidence is two issue reports, not a survey. npm fetches failed, so exact JavaScript versions and licences remain unverified. Live overlap remains unconfirmed. No retirement or shutdown date is asserted.
Started from a post by @LangChain team, packaged by the editor. Original post