LangChain और LangGraph 1.0 रिलीज़ का सारांश
(blog.langchain.com)LangChain और LangGraph के पहले बड़े stable version 1.0 रिलीज़ की घोषणा की गई है। LangChain, AI agents को तेज़ी से डेवलप करने के लिए high-level abstractions देता है, जबकि LangGraph एक graph-based runtime के रूप में customizable production-grade agents को सपोर्ट करता है। यह रिलीज़ stability पर ज़ोर देती है, और 2.0 version तक बदलाव नहीं होने की योजना है। एकीकृत docs site (https://docs.langchain.com/) को नए डिज़ाइन के साथ पेश किया गया है, और इसका उपयोग Uber, LinkedIn, Klarna जैसी बड़ी कंपनियाँ वास्तविक रूप से कर रही हैं। यह प्रति माह 9 करोड़ downloads दर्ज कर रहा है.
प्रमुख घोषणाएँ
LangChain 1.0 और LangGraph 1.0 को community feedback को प्रतिबिंबित करने वाले stable versions के रूप में जारी किया गया है। LangChain ने agent loop को अधिक परिष्कृत बनाया है, middleware के ज़रिए customization को मज़बूत किया है, और model integration को आधुनिक content types के अनुरूप अपग्रेड किया है। LangGraph लंबे समय तक चलने वाले agents की persistence, observability, और human intervention control के लिए durable runtime प्रदान करता है। यह Python और JavaScript दोनों को सपोर्ट करता है, और backward compatibility की गारंटी देता है।
LangChain 1.0: नए फीचर्स और सुधार
LangChain 1.0 भारी abstractions और package scope से जुड़ी समस्याओं को हल करते हुए agent development को सरल बनाता है। इसका मुख्य फोकस create_agent abstraction, standard content blocks, और package simplification है।
create_agent abstraction
यह एक core feature है जो model provider की परवाह किए बिना agents को तेज़ी से बनाने में मदद करता है, और LangGraph पर आधारित होने के कारण stable execution सुनिश्चित करता है। Standard agent loop इस प्रकार है:
- सेटअप: model चुनें, tools दें, prompt परिभाषित करें।
- execution loop:
- model को request भेजें।
- model response: अगर tool call हो तो उसे execute करके conversation में जोड़ें, और अगर final answer हो तो result लौटाएँ।
- चरण 1 दोहराएँ।
उदाहरण कोड:
from langchain.agents import create_agent
weather_agent = create_agent(
model="openai:gpt-5",
tools=[get_weather],
system_prompt="Help the user by fetching the weather in their city.",
)
result = agent.invoke({"role": "user", "what's the weather in SF?"})
middleware: agent loop के विभिन्न बिंदुओं पर hooks जोड़कर customization किया जा सकता है, जैसे model call से पहले/बाद, tool execution आदि। built-in middleware:
- human-in-the-loop: tool call के समय user approval/edit/reject के लिए execution रोकना; sensitive interactions जैसे external systems access या transactions में उपयोगी।
- summarization: message history को compress करके context limit से बचना, जबकि recent messages को बनाए रखना।
- PII Redaction: email, phone number जैसी sensitive data की पहचान और masking करके privacy compliance में मदद।
custom middleware भी सपोर्ट किया जाता है।
structured output generation: agent loop में integrated होने के कारण latency और cost कम होती है। Pydantic models आदि से output को नियंत्रित किया जा सकता है। उदाहरण:
from langchain.agents import create_agent
from langchain.agents.structured_output import ToolStrategy
from pydantic import BaseModel
class WeatherReport(BaseModel):
temperature: float
condition: str
agent = create_agent(
"openai:gpt-4o-mini",
tools=[weather_tool],
response_format=ToolStrategy(WeatherReport),
prompt="Help the user by fetching the weather in their city.",
)
पहले का create_react_agent, LangGraph के langgraph.prebuilt में deprecated किया गया है।
standard content blocks
यह langchain-core 1.0 में promoted feature है, जो model outputs के लिए provider-neutral specification देता है। message की .content_blocks property के ज़रिए reasoning traces, citations, tool calls जैसे content types को लगातार और एकसमान तरीके से संभाला जा सकता है। यह OpenAI, Anthropic आदि के बीच model switching को आसान बनाता है, और streaming/UI/memory stores के साथ compatible है।
package simplification
केवल core abstractions को रखा गया है, जबकि legacy features को langchain-classic में स्थानांतरित किया गया है। Python 3.9 का support समाप्त कर दिया गया है (अब 3.10+ आवश्यक है)। installation: uv pip install --upgrade langchain और langchain-classic। migration guide: https://docs.langchain.com/oss/python/releases/langchain-v1.
LangGraph 1.0: नए फीचर्स और सुधार
LangGraph 1.0, highly customizable agents के लिए एक low-level framework है, जो production environments में लंबे समय तक चलने वाले systems के लिए उपयुक्त है। यह graph-based execution model का उपयोग करता है।
core features
- durable state: agent execution state अपने-आप persist होती है, इसलिए server restart के बाद भी resume किया जा सकता है।
- built-in persistence: database code के बिना workflow को store/resume किया जा सकता है, और multi-day processes या background jobs को सपोर्ट करता है।
- human intervention patterns: execution रोकने के बाद मानव review/modify/approve के लिए API support, high-risk scenarios के लिए उपयुक्त।
langgraph.prebuilt module को langchain.agents में स्थानांतरित किया गया है। installation: uv pip install --upgrade langgraph। migration: compatibility बनी रहती है।
कॉन्सेप्ट्स: stateful agents, multi-agent workflows, और LangChain integration
stateful agents
ये interactions के बीच persistent state बनाए रखते हैं। LangGraph runtime की मदद से conversation history, tool results, और workflow progress को सुरक्षित रखा जा सकता है। LangChain 1.0 में summarization middleware के ज़रिए context limits को manage किया जा सकता है। यह multi-session workflows, जैसे कई दिनों तक चलने वाली approval process, में उपयोगी है।
multi-agent workflows
LangGraph के graph model से multi-agent systems बनाए जा सकते हैं। इसमें deterministic nodes (fixed logic) और agent components (LLM-based decisions) को मिलाया जा सकता है। human intervention के ज़रिए supervision भी संभव है। LangChain agents को graph nodes के रूप में embed करके इसे आगे बढ़ाया जा सकता है। यह business automation, जैसे data retrieval, analysis, और approvals, के लिए उपयुक्त है।
LangChain के साथ integration
LangChain, high-level abstraction के रूप में LangGraph runtime पर आधारित है, जिससे agents durable बनते हैं। graph composability के कारण यह complex systems तक विकसित हो सकता है। इससे vendor lock-in से भी बचा जा सकता है। engineering details video: https://youtu.be/r5Z_gYZb4Ns.
use cases
- LangChain 1.0: weather queries या tool-based assistants जैसे standard patterns की तेज़ prototyping। middleware की मदद से privacy-focused chatbots या human-approved transaction agents बनाना।
- LangGraph 1.0: long-running automation (multi-day approvals), sensitive workflows में human oversight, hybrid systems (agents + deterministic logic)। Uber या Klarna जैसे enterprise processes।
- संयुक्त उपयोग: LangChain से शुरुआत करके LangGraph तक विस्तार, multi-agent business automation के लिए।
docs और resources
एकीकृत docs site (https://docs.langchain.com/) में intuitive navigation, guides, tutorials, और API references शामिल हैं। community feedback: LangChain forum (https://forum.langchain.com/). newsletter subscription भी उपलब्ध है.
3 टिप्पणियां
ओह, 1.0 आ गया है।
क्या 1.0 से API थोड़ा स्थिर होगा...
उम्मीद है कि जल्द ही फिर 2.0 न आ जाए और migration guide खंगालने की नौबत न पड़े।
LangChain की functionality से मुझे खुद कोई शिकायत नहीं है, लेकिन backward compatibility टूट जाना हमेशा असहज और झंझट भरा लगता है
हूँ.. AI वाली तरफ तो वैसे भी शुरू से फिर से बनाना ज़्यादा आसान लगता है, तो उसे लेकर तो चलो मान भी लेते हैं, लेकिन मेरी सबसे बड़ी शिकायत यही है कि LLM को नवीनतम syntax ठीक से पता नहीं होता lol (
MCPजैसी चीज़ें इस्तेमाल करें तो कुछ हद तक इसका समाधान हो जाता है)