█

AI/TLDR

AgentScope Java

JVM framework for distributed, long-running agents with events, permissions and sandboxes

Multi-Agent SystemsOpen source
Latest
v2.0.0
Updated
10 Jul 2026
Language
Java
License
Apache-2.0

What's new

v2.0.010 Jul 2026

First production-ready release: dual-layer agent architecture, 31-event stream, permission system, middleware, workspace sandbox, multi-agent orchestration and distributed deployment.

Overview

AgentScope Java is the JVM sibling of the AgentScope family, aimed at production agents that run for a long time and are supervised while they do it. Version 2.0, generally available since July 2026, is built around a dual-layer agent architecture: `agentscope-core` gives you a bare ReAct agent, and `agentscope-harness` adds the workspace, persistence and sandbox machinery on top. It requires JDK 17 or newer and is published to Maven Central under `io.agentscope`.

Four abstractions carry most of the framework's weight. A unified event stream emits 31 typed events so a front end can render a run in real time and a human can step in mid-loop. A permission system gates every tool call as allow, require-approval or deny. AOP-style middleware intercepts hooks in the reasoning-acting loop so behaviour can be extended without forking the loop itself. And a workspace abstraction runs tools in an isolated environment — local, Docker, Kubernetes or the AgentRun cloud sandbox.

For work that spans machines, subagents are defined declaratively and coordinated with `agent_spawn` and `agent_send`, with events forwarded back up to the parent, and session plus memory state is stored in Redis, MySQL, PostgreSQL, OSS or COS so a session recovers across replicas. Model providers ship as separate extension modules in 2.0 — DashScope, OpenAI, Anthropic, Gemini and Ollama — and a companion AgentScope Service acts as a control plane and dashboard for registering, observing and orchestrating agents, including ones built on other frameworks.

What it does

  • Dual-layer architecture — agentscope-core for a bare ReActAgent, agentscope-harness for workspace, persistence and sandbox
  • Unified event stream with 31 typed events for real-time rendering and human-in-the-loop intervention
  • Permission system gating each tool call as allow, require user approval, or deny
  • AOP-style middleware hooks for extending the reasoning-acting loop without rewriting it
  • Workspace and sandbox execution across local, Docker, Kubernetes and the AgentRun cloud sandbox
  • Declarative subagents with agent_spawn / agent_send, cross-replica routing and event forwarding to the parent
  • Distributed session and memory state over Redis, MySQL, PostgreSQL, OSS or COS with cross-replica session recovery
  • Pluggable model provider modules (DashScope, OpenAI, Anthropic, Gemini, Ollama), A2A and AG-UI protocol support, and IM channels for DingTalk, Feishu and WeCom

Getting started

AgentScope Java requires JDK 17 or higher and is consumed as Maven Central dependencies. In 2.0 the model provider is a separate artifact from the framework itself.

Add the harness dependency

Depend on agentscope-harness for the full runtime. If you only want a bare ReActAgent without workspace, persistence or sandbox, depend on agentscope-core alone.

xmlxml
<dependency>
    <groupId>io.agentscope</groupId>
    <artifactId>agentscope-harness</artifactId>
    <version>2.0.1</version>
</dependency>

Add a model provider module

Pick the extension matching your provider. The other options are agentscope-extensions-model-openai, -anthropic, -gemini and -ollama.

xmlxml
<dependency>
    <groupId>io.agentscope</groupId>
    <artifactId>agentscope-extensions-model-dashscope</artifactId>
    <version>2.0.1</version>
</dependency>

Build your first agent

HarnessAgent takes a name, a system prompt and a model string. ModelRegistry resolves the string and reads the matching API-key environment variable — for example OPENAI_API_KEY or DEEPSEEK_API_KEY — automatically.

javajava
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();
    }
}

Choose an execution mode

call() runs the agent to completion; streamEvents() exposes the unified event stream so a UI can render tool calls, approvals and results as they happen.

Go distributed

Make the agent stateless, attach a DistributedBackend for session and memory storage, and point the workspace at Docker, Kubernetes or the AgentRun sandbox. The production guide on java.agentscope.io covers the backend options and cross-replica session recovery.

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Reach for it when the agent has to live inside an existing JVM service rather than a Python sidecar
  • Reach for it when tool calls need explicit approval gates and a full audit of what the agent did
  • Reach for it for long-running agents that must survive a restart and resume on a different replica
  • Reach for it when one supervisor agent needs to spawn and coordinate subagents across machines

How AgentScope Java compares

AgentScope Java alongside other open-source multi-agent systems tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Ruflo★ 73.4kAgent meta-harness that wraps Claude Code and Codex with 100+ specialized agents, swarm coordination, vector memory, background workers and cross-machine agent federation.
MetaGPT★ 70.7kA multi-agent framework that models a software company, assigning roles like product manager, architect, and engineer to generate code from a single prompt.
AutoGen★ 61.2kMicrosoft Research's framework for building applications where multiple agents converse with each other and with tools to solve tasks.
CrewAI★ 59.1kA framework for assembling teams ('crews') of role-playing agents that divide tasks and collaborate to complete a goal.
AgentScope★ 32.5kA framework for building multi-agent applications with message passing, visual debugging tools, and distributed execution.
OpenAI Agents SDK★ 29.7kOpenAI's lightweight Python SDK for building multi-agent workflows using explicit handoffs, tools, and guardrails.
A2A★ 26kOpen Agent2Agent protocol from Google (now in the Linux Foundation) that lets agents from different frameworks discover each other and collaborate over JSON-RPC.
AgentScope Java★ 5.8kJVM framework for distributed, long-running agents with events, permissions and sandboxes