Skip to content

create_agent in 1.0.3 dependency issue with langgraph-prebuilt 1.0.2 #33804

Description

@dhait

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Example Code

from langchain_anthropic import ChatAnthropic
from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
from langchain.agents import create_agent
from langchain_core.messages import HumanMessage

Error Message and Stack Trace (if applicable)

Traceback (most recent call last):
File "/Users/dhait/PycharmProjects/ivyinsight/backend/main.py", line 12, in
from langchain.agents import create_agent
File "/Users/dhait/PycharmProjects/ivyinsight/backend/.venv/lib/python3.13/site-packages/langchain/agents/init.py", line 9, in
from langchain.agents.factory import create_agent
File "/Users/dhait/PycharmProjects/ivyinsight/backend/.venv/lib/python3.13/site-packages/langchain/agents/factory.py", line 14, in
from langgraph.prebuilt.tool_node import ToolCallWithContext, ToolNode
ModuleNotFoundError: No module named 'langgraph.prebuilt.tool_node'

Description

For some reason I can't import the new create_agent function.

Problem: langchain.agents.create_agent (from langchain 1.0.3) is trying to import from langgraph.prebuilt.tool_node import ToolNode, but langgraph 1.0.2 doesn't have tool_node in the prebuilt module.

System Info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:28:17 PDT 2025; root:xnu-11417.140.69~1/RELEASE_X86_64
Python Version: 3.13.3 (main, Apr 8 2025, 13:54:08) [Clang 17.0.0 (clang-1700.0.13.3)]

Package Information

langchain_core: 1.0.3
langchain: 1.0.3
langsmith: 0.4.39
langchain_anthropic: 1.0.1
langchain_postgres: 0.0.16
langchain_text_splitters: 0.3.8
langgraph_sdk: 0.2.9

Optional packages not installed

langserve

Other Dependencies

anthropic: 0.72.0
asyncpg: 0.30.0
claude-agent-sdk: Installed. No version info available.
httpx: 0.28.1
jsonpatch: 1.33
langchain-aws: Installed. No version info available.
langchain-community: Installed. No version info available.
langchain-deepseek: Installed. No version info available.
langchain-fireworks: Installed. No version info available.
langchain-google-genai: Installed. No version info available.
langchain-google-vertexai: Installed. No version info available.
langchain-groq: Installed. No version info available.
langchain-huggingface: Installed. No version info available.
langchain-mistralai: Installed. No version info available.
langchain-ollama: Installed. No version info available.
langchain-openai: Installed. No version info available.
langchain-perplexity: Installed. No version info available.
langchain-together: Installed. No version info available.
langchain-xai: Installed. No version info available.
langgraph: 1.0.2
langsmith-pyo3: Installed. No version info available.
numpy: 2.3.4
openai-agents: Installed. No version info available.
opentelemetry-api: Installed. No version info available.
opentelemetry-exporter-otlp-proto-http: Installed. No version info available.
opentelemetry-sdk: Installed. No version info available.
orjson: 3.11.4
packaging: 24.2
pgvector: 0.3.6
psycopg: 3.2.3
psycopg-pool: 3.2.7
pydantic: 2.10.3
pytest: Installed. No version info available.
pyyaml: 6.0.3
requests: 2.32.5
requests-toolbelt: 1.0.0
rich: Installed. No version info available.
sqlalchemy: 2.0.44
tenacity: 9.1.2
typing-extensions: 4.15.0
vcrpy: Installed. No version info available.
zstandard: 0.25.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing featureexternal

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions