
LANGCHAIN — What Is the New Langchain Architecture and Community Path to Langchain v0.1?
Technology’s future is in the hands of the dreamers, not the regulators. — Robin Chase
LangChain has undergone significant growth and is now re-architecting its package into multiple packages to improve the developer experience and support a thriving ecosystem. The new LangChain architecture consists of three separate packages: langchain-core, langchain-community, and langchain. By splitting the old langchain package, LangChain aims to introduce stability, scalability, and a path towards a stable 0.1 release for langchain. Let's delve into the details of the new LangChain architecture and the community path to LangChain v0.1.
LangChain Core
The langchain-core package encapsulates simple, core abstractions and a runtime to join these components together. It includes modular abstractions for language models, document loaders, embedding models, vectorstores, and retrievers. These abstractions have become the standard for how providers and partners expose their services to the whole GenAI ecosystem. Moreover, LangChain Expression Language, a composable runtime, has been added to compose arbitrary sequences together, providing multiple benefits when building LLM applications.
from langchain_core.messages import AIMessage, HumanMessage
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.tools import toolLangChain Community
The langchain-community package contains all third-party integrations, now separated from the core package. Over the next few weeks, LangChain will work on splitting out integrations with large audiences and critical functionalities into standalone packages, such as langchain-openai and langchain-anthropic. This separation aims to version these packages independently and simplify the testing process.
from langchain_community.chat_models import ChatOpenAI
from langchain_community.tools.gmail import (
GmailCreateDraft,
GmailGetMessage,
GmailGetThread,
GmailSearch,
GmailSendMessage,
)LangChain
The langchain package contains higher-level chains, agents, retrieval algorithms, and generalizable orchestration pieces that constitute an application’s cognitive architecture. While some legacy chains will remain, LangChain is moving towards constructing chains with LangChain Expression Language, allowing for ease of creating new chains, transparency of steps involved, and more.
from langchain.agents import AgentExecutor
from langchain.agents.format_scratchpad import format_to_openai_function_messages
from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser
from langchain.tools.render import format_tool_to_openai_functionConclusion
The re-architecture of LangChain into multiple packages sets a solid foundation for a flourishing GenAI ecosystem. It enables the development of applications, libraries, and frameworks on top of or integrated with LangChain. With stability, scalability, and improved developer experience, LangChain is poised for further growth and innovation.
LangChain’s new architecture has opened up a world of possibilities for developers and integration partners, laying the groundwork for a vibrant and evolving GenAI space.
The future of technology is in constant evolution, and LangChain is at the forefront, shaping the landscape of GenAI applications.






