Skip to main content

Build distributed, enterprise-grade agents.

AgentScope Java 2.0 is a production-ready framework for building distributed, enterprise-grade agents, providing essential abstractions that work with rising model capability and built-in support for long-running, safely-controlled agent execution.

io.agentscope:agentscope-harness:${agentscope.version}
Battle-tested in Production
Alibaba Groupthe most widely used agent framework in-house (Java & Python), in production across 13+ business units
Open Source Communityadopted by industry leaders across 10+ sectors via open source & Alibaba Cloud
Alibaba Group
FliggyTaobao Instant CommerceWhale EntertainmentAIDCAlibaba HoldingTaotian TradeTaobao App1688Qwen AppAmapAlibaba CloudAnt InternationalAnt Global Payments
Open Source · Cloud
FinanceTransportation & LogisticsRetailManufacturingEnergyHealthcareEducation & Gov MediaInternetSaaSConsultingand more industry leaders
Harness Engineering

The engineering scaffolding for agents that stay up.

A bare ReActAgent only solves “one inference turn.” HarnessAgent uses the two extension channels — Middleware and Toolkit — to package workspace, memory, sandbox, sub-agents, skills, and Plan Mode into a complete infrastructure for long-running agents. The reasoning loop is left intact; the harness layers on, never replaces.

  • Identity persists — the workspace is the agent’s persona + long-term memory + domain knowledge, re-injected every turn
  • Context stays bounded — auto-compaction, large tool-result offloading, plus context-overflow retry as last-resort
  • State is recoverable — same sessionId across processes resumes the full conversation; sandboxes snapshot too
  • Capabilities accrue — four-layer Skill composition with curation gate; declarative sub-agent orchestration
Learn about Harness →
agent runtime core · module map
AgentScope 2.0 agent runtime core: Agent Service · Workspace · Middleware · Permission · Context · Model · Messages & Events
unified content blocks → event stream → live UI
Unified message blocks (text/file/tool-result/model thinking) flow as an event stream (text delta / tool execution / user confirmation) that drives the UI in real time
Events · Permissions

Make execution observable and interruptible.

Messages flow as typed ContentBlocks — text, files, images, model thinking, tool results. A single call() no longer just returns the final text; it streams typed events: model calls, text deltas, tool invocations, tool results, user confirmations. Human-in-the-loop and permission approvals are first-class framework concerns.

  • Typed eventsstreamEvents() emits step-by-step; no manual diffing on the frontend
  • Multi-modal messagesDataBlock accepts both base64 and URL data sources
  • Three-state permission — static rules + tool category + input analysis → allow / approve / deny
  • External execution loop — tools can pause for an outside system to complete, then resume the task
Learn about events & permissions →

The building blocks of a dependable agent system

From model fault-tolerance to sandboxed execution, AgentScope Java 2.0 ships every engineering piece needed to keep an agent stable.

Model fault-tolerance

Unified Credential + ChatModel abstraction across Qwen / OpenAI / Anthropic / Gemini / DeepSeek / Ollama through model extension modules. Configure max retries and a fallback model — the framework auto-switches when the primary is unavailable.

Learn about models →

Context engineering

Structured compaction preserves goals / state / key findings / next steps; oversized tool results offload to disk with a placeholder in context; file IO enforces “read-before-edit” to cut redundant reads.

Learn about memory →

Middleware

Four onion hooks (onAgent / onReasoning / onActing / onModelCall) plus the onSystemPrompt transformer. Plug in logging, tracing, permission checks, context injection, business policy — all without forking the core.

Learn about middleware →

Workspace abstraction

Decouples “what the agent does” from “where it runs.” WorkspaceBase unifies identity, lifecycle, resource discovery, and context offload. Switch local disk, Docker, and E2B cloud sandbox with one line; built-in warm-pool fits RL rollouts.

Learn about workspace →

Multi-agent

Declare sub-agent specs in Markdown; the parent spawns them on demand with agent_spawn / agent_send in either synchronous or background mode. Background-task completion is pushed back via a system-reminder — no polling required.

Learn about multi-agent →

Tools & MCP

Annotation-driven tool registration with automatic batch / sequential / concurrent dispatch by tool attributes. Plug in any MCP-compatible server (filesystem, database, browser, code interpreter) with a central workspace/tools.json allowlist.

Learn about tools →

Ready to build?

Follow the quickstart and run a ReActAgent in minutes. When you need the long-running engineering layer, swap to HarnessAgent — same reasoning core, capabilities layered in as needed, business code untouched.

Start building →

Frequently asked

Full Q&A in the FAQ, or ask on GitHub Discussions.