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.
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
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
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
+------------------------------------------------------------+ | 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 | +------------------------------------------------------------+
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
Full-stack capabilities, production-hardened
From reasoning core to enterprise deployment, AgentScope Java covers the full agent development lifecycle.
ReAct Reasoning
Autonomous planning, tool calling, and result integration. Built-in safe interruption, graceful cancellation, and hook-based human-in-the-loop oversight.
Quick start →Memory & RAG
Persistent cross-session memory with semantic search. Automatic background consolidation prevents context bloat. Multi-tenant isolation out of the box.
Learn about memory →MCP Protocol
Connect to any MCP-compatible server — file systems, databases, browsers, code interpreters — instantly extending agent tool capabilities without custom integration code.
View MCP →A2A Protocol
Register agents with Nacos or similar service registries. Other agents can discover and delegate tasks as naturally as calling a microservice.
View A2A →Sandbox Isolation
Tool execution in isolated environments (local Unix, Docker, E2B). Sandbox state is fully preserved across multi-turn conversations with cross-session snapshot restore.
Learn about sandboxes →Observability
Pluggable Tracer SPI with native OpenTelemetry support for distributed tracing. AgentScope Studio provides visual debugging and real-time monitoring dashboards.
View Studio →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.