AgentScope Java क्या है?
AgentScope Java events, permissions और sandboxes के साथ distributed, लंबे समय तक चलने वाले agents के लिए JVM framework. यह Agents & Automation टूल्स की Multi-Agent Systems श्रेणी में आता है; ओपन सोर्स है, Java में लिखा गया है और Apache-2.0 लाइसेंस के तहत है। शुरू करने के लिए: harness dependency जोड़ें.
सारांश
AgentScope Java, AgentScope family का JVM संस्करण है, जो लंबे समय तक चलने वाले और इस दौरान निगरानी में रहने वाले production agents के लिए बनाया गया है। संस्करण 2.0, जुलाई 2026 से generally available है, और यह dual-layer agent architecture पर आधारित है: `agentscope-core` आपको एक सादा ReAct agent देता है, और `agentscope-harness` उसके ऊपर workspace, persistence और sandbox की सुविधाएँ जोड़ता है। इसके लिए JDK 17 या उससे नया संस्करण चाहिए, और यह `io.agentscope` के तहत Maven Central पर प्रकाशित है।
फ़्रेमवर्क की ज़्यादातर ताकत चार abstractions पर टिकी है। एक unified event stream 31 typed events भेजता है, ताकि front end किसी run को रीयल-टाइम में रेंडर कर सके और इंसान loop के बीच में हस्तक्षेप कर सके। Permission system हर tool call को allow, require-approval या deny के रूप में नियंत्रित करता है। AOP-style middleware reasoning-acting loop में hooks को इंटरसेप्ट करता है, ताकि loop को खुद फ़ोर्क किए बिना व्यवहार बढ़ाया जा सके। और workspace abstraction tools को एक अलग-थलग वातावरण में चलाता है: local, Docker, Kubernetes या AgentRun cloud sandbox।
अलग-अलग मशीनों पर फैले कामों के लिए subagents को declarative तरीके से परिभाषित किया जाता है और `agent_spawn` व `agent_send` से coordinate किया जाता है, साथ ही events parent तक वापस forward होते हैं। Session और memory state Redis, MySQL, PostgreSQL, OSS या COS में स्टोर होती है, ताकि session replicas के बीच भी recover हो सके। 2.0 में model providers अलग extension modules के रूप में आते हैं: DashScope, OpenAI, Anthropic, Gemini और Ollama। एक companion AgentScope Service control plane और dashboard का काम करती है, जिससे agents को रजिस्टर, observe और orchestrate किया जा सके, जिनमें दूसरे frameworks पर बने agents भी शामिल हैं।
यह क्या करता है
- Dual-layer architecture: bare ReActAgent के लिए agentscope-core, workspace, persistence और sandbox के लिए agentscope-harness
- रीयल-टाइम रेंडरिंग और human-in-the-loop हस्तक्षेप के लिए 31 typed events वाली unified event stream
- Permission system जो हर tool call को allow, user approval की ज़रूरत, या deny के रूप में नियंत्रित करता है
- Reasoning-acting loop को बिना दोबारा लिखे उसे बढ़ाने के लिए AOP-style middleware hooks
- Local, Docker, Kubernetes और AgentRun cloud sandbox में workspace और sandbox execution
- agent_spawn / agent_send के साथ declarative subagents, cross-replica routing और parent तक event forwarding
- Redis, MySQL, PostgreSQL, OSS या COS पर distributed session और memory state, cross-replica session recovery के साथ
- Pluggable model provider modules (DashScope, OpenAI, Anthropic, Gemini, Ollama), A2A और AG-UI protocol support, और DingTalk, Feishu व WeCom के लिए IM channels
शुरू करें
AgentScope Java के लिए JDK 17 या उससे ऊपर चाहिए, और इसे Maven Central dependencies के रूप में इस्तेमाल किया जाता है। 2.0 में model provider फ़्रेमवर्क से अलग artifact है।
Harness dependency जोड़ें
पूरे runtime के लिए agentscope-harness पर निर्भर रहें। अगर आपको workspace, persistence या sandbox के बिना सिर्फ़ सादा ReActAgent चाहिए, तो अकेले agentscope-core पर निर्भर रहें।
<dependency>
<groupId>io.agentscope</groupId>
<artifactId>agentscope-harness</artifactId>
<version>2.0.1</version>
</dependency>Model provider module जोड़ें
अपने provider से मेल खाने वाला extension चुनें। बाकी विकल्प हैं agentscope-extensions-model-openai, -anthropic, -gemini और -ollama।
<dependency>
<groupId>io.agentscope</groupId>
<artifactId>agentscope-extensions-model-dashscope</artifactId>
<version>2.0.1</version>
</dependency>अपना पहला agent बनाएँ
HarnessAgent को एक नाम, एक system prompt और एक model string चाहिए। ModelRegistry model string को resolve करता है और मेल खाने वाला API-key environment variable, जैसे OPENAI_API_KEY या DEEPSEEK_API_KEY, अपने-आप पढ़ लेता है।
import io.agentscope.core.agent.RuntimeContext;
import io.agentscope.core.message.UserMessage;
import io.agentscope.harness.agent.HarnessAgent;
public class FirstAgent {
public static void main(String[] args) {
HarnessAgent agent = HarnessAgent.builder()
.name("assistant")
.sysPrompt("You are a helpful AI assistant.")
.model("dashscope:qwen-plus")
.build();
}
}Execution mode चुनें
call() agent को पूरा होने तक चलाता है; streamEvents() unified event stream देता है, ताकि UI tool calls, approvals और results को होते हुए रेंडर कर सके।
Distributed बनाएँ
Agent को stateless बनाएँ, session और memory storage के लिए DistributedBackend जोड़ें, और workspace को Docker, Kubernetes या AgentRun sandbox की ओर इंगित करें। java.agentscope.io पर production guide backend विकल्पों और cross-replica session recovery को कवर करती है।
कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।
कब इस्तेमाल करें
- इसे तब चुनें जब agent को Python sidecar के बजाय किसी मौजूदा JVM service के अंदर रहना हो
- इसे तब चुनें जब tool calls पर स्पष्ट approval gates चाहिए और agent ने क्या किया, उसका पूरा audit चाहिए
- इसे लंबे समय तक चलने वाले agents के लिए चुनें जिन्हें restart के बाद भी बचे रहना और किसी दूसरे replica पर फिर से शुरू होना हो
- इसे तब चुनें जब एक supervisor agent को मशीनों के पार subagents spawn और coordinate करने हों
How AgentScope Java compares
AgentScope Java alongside other open-source multi-agent systems tools AI/TLDR tracks, ranked by GitHub stars.
| टूल | स्टार | यह क्या करता है |
|---|---|---|
| Paperclip | ★ 119k | एक सेल्फ-होस्टेड कंट्रोल प्लेन, जो AI एजेंट्स की टीम को कंपनी की तरह चलाता है, जिसमें ऑर्गनाइज़ेशन चार्ट, टास्क, बजट और अप्रूवल शामिल हैं |
| Ruflo | ★ 82.8k | Claude Code और Codex के लिए एक एजेंट मेटा-हार्नेस |
| MetaGPT | ★ 71.6k | एक multi-agent framework जो एक ही prompt से पूरी LLM-आधारित software company का काम करता है |
| AutoGen | ★ 62k | ऐसे multi-agent AI apps बनाएं जिनमें agents एक-दूसरे, tools और इंसानों के साथ बातचीत करें |
| CrewAI | ★ 61.4k | Role-playing AI agents की टीमें बनाएं जो काम बांटें और एक लक्ष्य के लिए मिलकर काम करें |
| AgentScope | ★ 37.1k | प्रोडक्शन में चलने वाले मल्टी-एजेंट ऐप्स बनाने के लिए एक Python फ़्रेमवर्क |
| OpenAI Agents SDK | ★ 31k | Multi-agent workflows बनाने के लिए tools, handoffs और guardrails वाला हल्का Python SDK |
| AgentScope Java | ★ 6.6k | events, permissions और sandboxes के साथ distributed, लंबे समय तक चलने वाले agents के लिए JVM framework |
