According to the LangChain blog, LangChain has announced the release of version 0.3, which brings significant upgrades and improvements to both the Python and JavaScript ecosystems.
What has changed?
Python
All packages are internally upgraded from Pydantic 1 to Pydantic 2, providing full support for using Pydantic 2 in user code without the need for a bridge. langchain_core.pydantic_v1
or pydantic.v1
. Pydantic 1, which reached end-of-life in June 2024, is no longer supported. Additionally, Python 3.8, which reached end-of-life in October 2024, is no longer supported.
JavaScript
All LangChain packages are now listed. @langchain/core
Use it as a peer dependency instead of a direct dependency to avoid type errors related to core version conflicts. Users must install it explicitly. @langchain/core
Rather than relying on internally resolved versions of other packages. Other changes include making callbacks background and non-blocking by default, and removing the deprecated document loader and its own query entry point. langchain
In favor of the entry point @langchain/community
and integrated packages. The deprecated Google PaLM entry point has also been removed, and the following entry points have been added: @langchain/google-vertexai
and @langchain/google-genai
. also, "type"
as BaseMessageLike
Deprecated in favor of similar features to OpenAI. MessageWithRole
.
What’s new
LangChain v0.3 introduces several new features and improvements.
- More integrations have been moved.
langchain-community
To themselveslangchain-name
Allows better dependency management, testing and versioning with packages. Legacy implementation remains intact.langchain-community
However, it is marked as deprecated. - The documentation and API reference have been revamped.
- Simplified tool definition and use.
- New utilities for interacting with chat models include a general-purpose model constructor, message trimming, filtering and merging utilities, and a rate limiter.
- Ability to send custom events
How to update your code
To help users migrate to LangChain v0.3, detailed how-to guides for Python and JavaScript are provided.
documentation
The LangChain documentation is version controlled, and previous versions are still accessible at this URL.
Langgraph
LangGraph is a library for building stateful multi-actor applications using LLM. As of LangChain v0.2, LangGraph is the recommended way to build agents. It includes a pre-built LangGraph object equivalent to LangChain AgentExecutor, simplifying the use of the built-in agent solution.
What is coming
The LangChain team plans to further improve LangChain’s multimodal capabilities and continues to work on improving documentation and integration stability.
Image source: Shutterstock