Harness framework for distributed, enterprise-grade agents.

AgentScope Java is the open-source agent framework for the JVM. ReAct reasoning, Harness engineering infrastructure, multi-agent orchestration, and MCP/A2A protocol support — from local prototype to enterprise-scale deployment.

JDK 17+ Maven Central Apache 2.0
HarnessAgent
ReActAgent
import io.agentscope.harness.*;
var agent = HarnessAgent.builder()
    .name("coder")
    .model(new QwenConfig("qwen-plus"))
    .filesystem(new LocalFilesystemSpec("./workspace"))
    .session(new RedisSession(jedisPool))
    .build();
// Stateful · resumable · memory-persistent
agent.call(messages, RuntimeContext.builder()
    .sessionId("user-123").build()).block();
io.agentscope:agentscope-harness
JDK 17+ minimum Java version
Reactive built on Project Reactor
MCP · A2A open protocol support
Apache 2.0 open-source license
Harness Engineering

Enterprise patterns, zero boilerplate.

The Harness module injects workspace management, memory persistence, and context compression into the reasoning loop via hooks — without modifying core inference logic.

  • Structured workspace as the single source of truth
  • Cross-session long-term memory with automatic consolidation
  • Context overflow protection with auto-compaction
  • Local disk → Docker sandbox → object storage, one line to switch
Learn about Harness →
workspace/
workspace/
├── AGENTS.md          # persona + system instructions
├── MEMORY.md         # long-term memory (auto-managed)
├── knowledge/        # domain knowledge + RAG index
├── skills/           # reusable skill files
├── subagents/        # sub-agent specifications
└── agents/coder/session-user-123/
    ├── chat-history.jsonl
    └── scratchpad/
$ each call → load → reason → write back memory
multi-agent runtime architecture
+------------------------------------------------------------+
|                 Supervisor (HarnessAgent)                  |
|  - plans tasks / dispatches agents / aggregates results    |
+---------------------------+--------------------------------+
                            |
          +-----------------+------------------+
          |                                    |
+---------v---------+                +---------v---------+
| researcher Agent  |                |   coder Agent     |
| - web_search      |                | - filesystem/tool |
| - read_file       |                | - code execution  |
+---------+---------+                +---------+---------+
          |                                    |
          +-----------------+------------------+
                            |
+---------------------------v--------------------------------+
|           Shared Runtime Infrastructure                    |
|  Session (Redis) · Workspace · Memory · MCP · A2A         |
+------------------------------------------------------------+
Multi-Agent

Orchestrate agents like microservices.

Declare sub-agent specs in Markdown files. The supervisor spawns sub-agents on demand at runtime, supporting both blocking and non-blocking delegation modes.

  • Declarative sub-agent definitions — no code changes needed
  • Synchronous blocking and async non-blocking delegation
  • A2A protocol for cross-process and cross-machine agent calls
  • Sub-agents can independently inherit or override Harness config
Learn about multi-agent →

Ready to build?

Run your first agent in minutes. Start with a basic ReActAgent, then layer in Harness engineering, multi-agent orchestration, and enterprise capabilities as you need them — the same API scales with you.

Start building →

Frequently Asked Questions

Still have questions? Ask on GitHub Discussions.

What Java version is required?

AgentScope Java requires JDK 17 or higher. The framework uses modern Java features such as Records and Sealed Classes, and is built on Project Reactor for a non-blocking reactive execution model. For ultra-low cold-start latency, native image compilation via Quarkus and GraalVM is supported.

Which LLM providers are supported?

Any model compatible with the OpenAI Chat Completions API is supported out of the box, including Alibaba Cloud Qwen, OpenAI GPT series, Anthropic Claude, and local Ollama instances. The framework provides a standard ModelConfig SPI for adding custom model providers via plugins.

What is the difference between Harness and a plain ReActAgent?

A ReActAgent is the core reasoning–tool–response loop. HarnessAgent injects workspace loading, memory persistence, context compaction, and sandbox lifecycle management on top of the same reasoning core via the Hook system. You can start with ReActAgent and migrate seamlessly to HarnessAgent when you need production engineering capabilities — no business logic changes required.

Can I use AgentScope Java with Spring Boot or Quarkus?

Yes. AgentScope Java's core modules are framework-agnostic Java libraries that can be added as dependencies to any JVM application — Spring Boot, Quarkus, Micronaut, or plain Java. Quarkus further supports GraalVM native image compilation for sub-100ms cold starts, making it ideal for serverless environments.

How do I scale horizontally in production?

AgentScope Java is designed for stateless horizontal scaling. Move session state to RedisSession and workspace files to object storage (OssFilesystemSpec); any replica can then fully restore a user's context. Combined with Kubernetes HPA, this enables elastic scaling with no sticky sessions required.