कागज़ पर बना workflow डायग्राम और लक्ष्य, जैसे बैकग्राउंड subagents वाले orchestrator की योजना
Photo by Kelly Sikkema on Unsplash · source · credits

Deep Agents Async Subagents: बैकग्राउंड में वर्कर चलते रहें और एजेंट जवाब देता रहे

Also available in English: Read this article in English

LangChain ने 5 नवंबर 2026 को Deep Agents में async subagents जोड़े। Supervisor लंबे काम बैकग्राउंड वर्कर को देता है और यूज़र से बात करने के लिए खाली रहता है; काम पूरा होने पर नतीजे लौटते हैं। यह Python और JavaScript वाले Deep Agents और Managed Deep Agents में उपलब्ध है।

Async क्यों

सामान्य ReAct लूप में हर लंबी टूल कॉल लूप रोक देती है और बाकी टास्क पीछे कतार में लगते हैं। LangChain, async subagent की तुलना asyncio.create_task से शुरू किए टास्क या बिना await किए Promise से करता है: कॉल तुरंत लौटती है और नतीजा बाद में आता है। लंबे, समानांतर या बीच में दिशा बदलने वाले काम के लिए इसे इस्तेमाल करें; जब supervisor को इंतज़ार करना हो, सामान्य subagents रखें।

Supervisor बैकग्राउंड में researcher और coder subagents शुरू करता है और यूज़र से बात करता रहता है
LangChain के ब्लॉग और docs के आधार पर। इलस्ट्रेशन, स्क्रीनशॉट नहीं।

पाँच टूल

Task IDs एक अलग async_tasks state channel में रहते हैं, इसलिए supervisor के मैसेज हिस्ट्री छोटा करने पर भी बचे रहते हैं।

Interrupt या enqueue

Deep Agents में interrupt और enqueue update strategy की तुलना की तालिका
LangChain async subagents docs से। इलस्ट्रेशन, स्क्रीनशॉट नहीं।

update_strategy डिफ़ॉल्ट में "interrupt" है, जो नए निर्देश के साथ subagent दोबारा शुरू करता है, जैसे "use Postgres instead"। "enqueue" मौजूदा रन ख़त्म होने तक रुकता है, जैसे "run the tests when you're done"। इसके लिए deepagents>=0.7.30 चाहिए और यह beta में है।

नतीजे कैसे लौटते हैं

Agent Protocol सर्वर पर पूरे हुए subagents, supervisor को सूचना देते हैं। एक ही deployment में supervisor idle हो तो subagent उसे जगाता है; नहीं तो अगले रन की शुरुआत में अपडेट मिलता है। जिस subagent को मंज़ूरी चाहिए वह waiting दिखता है, और यूज़र उसी subagent के थ्रेड पर जवाब देता है, क्योंकि supervisor यूज़र की जगह मंज़ूरी नहीं दे सकता।

सेटअप

Self-hosted: name, description और graph_id के साथ AsyncSubAgent spec बनाएँ (रिमोट सर्वर के लिए url जोड़ें) और उन्हें create_deep_agent में दें। लोकल पर langgraph dev --n-jobs-per-worker 10 से वर्कर बढ़ाएँ। Managed Deep Agents में subagent पर "async": True लिखें। अगर supervisor शुरू करते ही बार-बार check करे, तो system prompt में लिखें कि launch के बाद कंट्रोल यूज़र को लौटाए।

एजेंट डिज़ाइन पर और: AI एजेंट कैसे बनाएँ, बेस्ट AI एजेंट बिल्डर और DeepSeek Super Agent।

स्रोत

FAQ

क्या यह सिर्फ़ LangSmith के लिए है?

नहीं। Async subagents, Agent Protocol लागू करने वाले किसी भी सर्वर से बात करते हैं, self-hosted भी।

क्या चलता subagent रद्द कर सकते हैं?

हाँ, cancel_async_task से।

क्या सूचनाएँ स्थिर हैं?

नहीं। Task notifications और waiting स्टेटस beta में हैं और बदल सकते हैं।

क्या यह JavaScript में चलता है?

हाँ। LangChain के अनुसार async subagents, Python और JavaScript दोनों में उपलब्ध हैं।

About the author

Suraj Kumar builds and edits AIUseFlow, a directory of AI tools for vibe coders, agent builders and creators. Guides like this one walk through a practical workflow with cited sources — not a news wire rewrite. How we rank tools.

Get the weekly stack

Rank movers and new AI tools for builders, once a week. Free, no spam, unsubscribe anytime.