Skip to content

Conversation

Copy link

Copilot AI commented Oct 26, 2025

Migrates all notebooks in agent-architectures/ from Langchain 0.3.x to 1.x and Langgraph 0.6.x to 1.x per the official migration guide.

Import Updates

Tool decorator (3 notebooks):

# Before
from langchain.tools import tool

# After
from langchain_core.tools import tool

Send class (1 notebook):

# Before
from langgraph.constants import Send

# After
from langgraph.types import Send

END constant: No change required - still valid from langgraph.graph in v1.

Dependency Updates

Updated requirements.txt with v1 constraints and proper upper bounds:

langchain>=1.0.0,<2.0.0
langgraph>=1.0.0,<2.0.0
langchain-core>=1.0.0,<2.0.0
langchain-openai>=0.3.0,<1.0.0
langgraph-supervisor>=0.0.29,<1.0.0
langgraph-swarm>=0.0.14,<1.0.0
langchain-tavily>=0.2.0,<1.0.0

Files Changed

  • 2_1_tool_call.ipynb - tool import
  • 2_2_react_agent.ipynb - tool import
  • 3_routing.ipynb - tool import
  • 5_parallelism.ipynb - Send import
  • requirements.txt - package versions

Notebooks 1, 4, 6, 7, 8 already use v1-compatible imports.

Original prompt

This section details on the original issue you should resolve

<issue_title>Upgrade to Langchain v1</issue_title>
<issue_description>All the notebooks in the architecture folder are making use of a previous person of Langchain/langgraph

They need to be migrated to v1

Migration Guide:

https://docs.langchain.com/oss/python/migrate/langchain-v1</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 26, 2025 04:36
Co-authored-by: sammydeprez <14163485+sammydeprez@users.noreply.github.com>
Co-authored-by: sammydeprez <14163485+sammydeprez@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade architecture notebooks to Langchain v1 Migrate agent-architectures notebooks to Langchain v1 Oct 26, 2025
Copilot AI requested a review from sammydeprez October 26, 2025 04:45
@sammydeprez
Copy link
Owner

Make use of the new create_agent

Copy link
Owner

@sammydeprez sammydeprez left a comment

Choose a reason for hiding this comment

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

Make use of the new create_agent , I want all the new methods that were made available in v1

@sammydeprez sammydeprez requested a review from Copilot October 26, 2025 05:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the agent-architectures notebooks from Langchain 0.3.x to 1.x and Langgraph 0.6.x to 1.x following the official migration guide. The changes primarily involve updating import statements and package version constraints.

  • Updated tool decorator imports from langchain.tools to langchain_core.tools in 3 notebooks
  • Updated Send class import from langgraph.constants to langgraph.types in 1 notebook
  • Updated requirements.txt with v1 constraints using range specifiers instead of pinned versions

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
requirements.txt Updated package versions to use v1 constraints with range specifiers
2_1_tool_call.ipynb Updated tool import to langchain_core.tools and Unicode degree symbol normalization
2_2_react_agent.ipynb Updated tool import to langchain_core.tools and Unicode degree symbol normalization
3_routing.ipynb Updated tool import to langchain_core.tools and Unicode degree symbol normalization
5_parallelism.ipynb Updated Send import from langgraph.constants to langgraph.types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Added error handling for missing TAVILY_API_KEY in the planner notebook.
- Updated execution counts for code cells to reflect changes in execution order.
- Fixed undefined 'tools' error by ensuring proper imports and usage in the agent creation.
- Updated image rendering method in the notebook for better visualization.
- Updated package versions in requirements.txt for langchain and related libraries to ensure compatibility and access to new features.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to Langchain v1

2 participants