Skip to content

feat: add support for Langchain 1.0#11114

Merged
ogabrielluiz merged 66 commits into
release-1.9.0from
feat/langchain-1.0
Mar 19, 2026
Merged

feat: add support for Langchain 1.0#11114
ogabrielluiz merged 66 commits into
release-1.9.0from
feat/langchain-1.0

Conversation

@ogabrielluiz
Copy link
Copy Markdown
Contributor

@ogabrielluiz ogabrielluiz commented Dec 19, 2025

Summary

Upgrades to LangChain 1.0 ecosystem (langchain ~=1.2.0, langchain-core ~=1.2.3, langchain-community ~=0.4.1). All langchain-* integration packages updated to versions compatible with langchain-core 1.0+.

Previously Blocked Dependencies (All Resolved)

  • cuga (~=0.2.9) - Updated to 0.2.9 which supports langchain 1.0
  • mlx / mlx-vlm - Resolved: opencv-python 4.13+ supports numpy>=2
  • nv-ingest - Resolved in nv-ingest 26.1.1 (removed openai dependency)

Other Notable Changes

  • elasticsearch bumped to >=8.19.0 (required by langchain-elasticsearch 1.0.0)
  • google-api-python-client bumped to >=2.161.0 (required by langchain-google-community 3.0+)
  • pyarrow bumped to >=19.0.1 (required by langchain-google-vertexai 3.0+)

Closes #10734

- langchain ~=1.2.0
- langchain-core ~=1.2.3
- langchain-community ~=0.4.1

Updated all langchain-* integration packages to versions compatible with langchain-core 1.0+.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 19, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: caf020e5-c8c0-44b3-a1ee-8bd55d06517a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The pull request upgrades LangChain to v1.2.0 across the project. Core changes include updating pyproject.toml dependencies to v1.x with compatible version ranges, introducing langchain-classic v1.0.0 for backward compatibility, and updating all affected imports from langchain.* to langchain_classic.* modules. Additional dependencies are also updated to compatible ranges.

Changes

Cohort / File(s) Summary
Root dependency manifest
pyproject.toml
Upgrades langchain from 0.3.23 (exact) to =1.2.0; updates multiple langchain- packages from exact pins to compatible ranges (= or >=); updates elasticsearch 8.16.0 → >=8.19.0, google-api-python-client 2.154.0 → >=2.161.0, pyarrow 19.0.0 → >=19.0.1; removes cuga dependency; updates nv-ingest pairs to >=26.1.0; shifts version policy from exact pins to compatible ranges.
Backend base dependencies
src/backend/base/pyproject.toml
Upgrades langchain family packages: langchain ~=0.3.21 → ~=1.2.0, langchain-community >=0.3.0,<1.0.0 → ~=0.4.1, langchain-core >=0.3.45,<1.0.0 → ~=1.2.3, langchain-experimental >=0.3.0,<1.0.0 → ~=0.4.1, langchain-ibm >=0.3.8,<1.0.0 → ~=1.0.2, langchain-chroma >=0.1.4,<1.0.0 → ~=0.2.6.
LFX dependencies
src/lfx/pyproject.toml
Upgrades langchain ~=0.3.23 → ~=1.2.0, langchain-core >=0.3.66,<1.0.0 → =1.2.3; adds new dependency langchain-classic=1.0.0; updates langchain-openai >=0.3.0,<1.0.0 → >=1.1.6,<2.0.0, langchain-community >=0.3.0,<1.0.0 → >=0.4.1,<1.0.0.
Agent import updates
src/lfx/src/lfx/base/agents/agent.py, src/lfx/src/lfx/base/agents/altk_base_agent.py, src/lfx/src/lfx/base/agents/utils.py
Updates imports to use langchain_classic.* modules instead of langchain.* (e.g., langchain.agents → langchain_classic.agents, langchain.agents.agent_toolkits → langchain_classic.agents.agent_toolkits). No functional logic changes.
Component import updates
src/lfx/src/lfx/components/langchain_utilities/json_agent.py, src/lfx/src/lfx/components/langchain_utilities/openapi.py, src/lfx/src/lfx/components/langchain_utilities/runnable_executor.py, src/lfx/src/lfx/components/langchain_utilities/sql.py, src/lfx/src/lfx/components/langchain_utilities/vector_store_router.py
Updates AgentExecutor and related imports from langchain.agents to langchain_classic.agents; updates VectorStoreRouterToolkit imports to use langchain_classic paths. No control flow modifications.
Callback and typing updates
src/lfx/src/lfx/base/agents/callback.py, src/lfx/src/lfx/field_typing/constants.py
Moves AsyncCallbackHandler import from langchain.callbacks.base to langchain_core.callbacks.base; updates LANGCHAIN_IMPORT_STRING constant and safe imports to reference langchain_classic.* modules.
Service dependency optimization
src/lfx/src/lfx/services/deps.py
Moves InvalidRequestError import from top-level to conditional exception handling block inside session_scope(); preserves rollback behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 7 | ❌ 2
❌ Failed checks (1 error, 1 warning)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error PR modifies 16 source files for LangChain 1.0 upgrade using langchain_classic imports but lacks dedicated tests validating the import migration and compatibility. Add tests for langchain_classic import migration including unit tests for module imports, regression tests for agent components, integration tests for utilities, and field_typing validation.
Test File Naming And Structure ⚠️ Warning PR modifies 14 Python source files changing imports from langchain.* to langchain_classic.* or langchain_core.* but existing test files were not updated or validated to verify compatibility with new import paths. Run test suite with updated imports and update any failing tests to use new langchain_classic or langchain_core import paths to verify LangChain 1.0 migration compatibility.
✅ Passed checks (7 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The pull request successfully implements the core requirement from #10734 to upgrade langchain to version > 1.0 (upgraded to ~1.2.0) and ensures compatibility with LangChain 1.0 ecosystem.
Out of Scope Changes check ✅ Passed All changes are directly related to the LangChain 1.0 upgrade objective. Import refactoring (langchain → langchain_classic), dependency version updates, and integration compatibility adjustments are within scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Test Quality And Coverage ✅ Passed LangChain 1.0 migration PR with dependency updates and import refactoring, plus lazy import optimization in session_scope(). Existing test suite extensively covers affected code through async context manager tests in fixtures and agent component tests.
Excessive Mock Usage Warning ✅ Passed PR contains only dependency updates and import refactoring with no test file modifications, making mock usage check not applicable.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "feat: add support for Langchain 1.0" clearly and concisely describes the main objective of the changeset—upgrading the codebase to support LangChain 1.0 by updating dependencies and refactoring imports across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/langchain-1.0
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added community Pull Request from an external contributor enhancement New feature or request labels Dec 19, 2025
@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator

@ogabrielluiz I agree. Also will this have deprecated functions in Agent Execution?

LangChain 1.0 removed AgentExecutor and related classes to langchain-classic.
This adds the dependency to maintain backward compatibility.
- Move AgentExecutor, agent creators from langchain to langchain_classic
- Move AsyncCallbackHandler from langchain.callbacks to langchain_core.callbacks
- Move Chain, BaseChatMemory from langchain to langchain_classic
- Update LANGCHAIN_IMPORT_STRING for code generation
LangChain 1.0 no longer includes sqlalchemy as a transitive dependency.
Move the import inside the function where it's used to avoid import errors
when sqlalchemy is not installed.
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 19, 2025
@ogabrielluiz ogabrielluiz removed the community Pull Request from an external contributor label Dec 21, 2025
@ogabrielluiz
Copy link
Copy Markdown
Contributor Author

@ogabrielluiz I agree. Also will this have deprecated functions in Agent Execution?

I think we can keep them on this PR then start moving things to legacy and update the Agent to either use our agent or create_agent.

- Uncomment nv-ingest-api and nv-ingest-client, update to >=26.1.0
  (no longer has openai version conflict)
- Bump datasets from <4.0.0 to <5.0.0 to allow fsspec>=2025.5.1
  required by nv-ingest
- Update mlx-vlm TODO comment with accurate blocking reason
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 12, 2026
nv-ingest 26.1.1 removes the openai dependency, resolving the
conflict with langchain-openai>=1.0.0 (which requires openai>=1.109.1).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 19, 2026
opencv-python 4.13+ now supports numpy>=2, resolving the conflict
with langchain-aws>=1.0.0 (which requires numpy>=2.2 on Python 3.12+).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 19, 2026
Update lfx integration deps to langchain 1.0 compatible versions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ogabrielluiz and others added 5 commits March 9, 2026 14:41
# Conflicts:
#	src/backend/base/langflow/api/v1/knowledge_bases.py
#	src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json
#	src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json
#	src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json
#	src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json
#	src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json
#	src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json
#	src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json
#	src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json
#	src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json
#	src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json
#	src/backend/base/langflow/initial_setup/starter_projects/Knowledge Ingestion.json
#	src/backend/base/langflow/initial_setup/starter_projects/Knowledge Retrieval.json
#	src/backend/base/langflow/initial_setup/starter_projects/Market Research.json
#	src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json
#	src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
#	src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json
#	src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json
#	src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json
#	src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json
#	src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json
#	src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json
#	src/backend/base/langflow/initial_setup/starter_projects/Research Translation Loop.json
#	src/backend/base/langflow/initial_setup/starter_projects/SEO Keyword Generator.json
#	src/backend/base/langflow/initial_setup/starter_projects/SaaS Pricing.json
#	src/backend/base/langflow/initial_setup/starter_projects/Search agent.json
#	src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json
#	src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json
#	src/backend/base/langflow/initial_setup/starter_projects/Social Media Agent.json
#	src/backend/base/langflow/initial_setup/starter_projects/Text Sentiment Analysis.json
#	src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json
#	src/backend/base/langflow/initial_setup/starter_projects/Twitter Thread Generator.json
#	src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json
#	src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json
#	src/backend/base/pyproject.toml
#	src/lfx/src/lfx/_assets/component_index.json
#	src/lfx/src/lfx/_assets/stable_hash_history.json
#	src/lfx/src/lfx/components/langchain_utilities/openai_tools.py
#	src/lfx/src/lfx/components/langchain_utilities/tool_calling.py
#	src/lfx/src/lfx/components/langchain_utilities/xml_agent.py
#	uv.lock
Copy link
Copy Markdown
Collaborator

@jordanrfrazier jordanrfrazier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran a few flows fine. Probably just needs extensive QA to make sure everything functions as normal now

Comment thread src/backend/base/pyproject.toml
ogabrielluiz and others added 8 commits March 10, 2026 11:05
before it was attempting to pull release-notes as letters are alphanumerically after numbers when we sort -V then grab tail
now we only look at branch names that follow the pattern '^release-[0-9]+\.[0-9]+\.[0-9]+$'
…onents

Old flows using removed langchain imports (e.g. langchain.memory,
langchain.schema, langchain.chains) now resolve via langchain_classic
at two levels: module-level for entirely removed modules, and
attribute-level for removed attributes in modules that still exist
in langchain 1.0. New langchain 1.0 imports are never affected since
fallbacks only trigger on import failure.
Copy link
Copy Markdown
Collaborator

@erichare erichare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uplift Langchain version > 1.0

7 participants