Repolode
agentscope-ai

agentscope-ai/agentscope-java

A Java framework for building long-running, distributed agents with event streaming, tool permissions, middleware and sandboxed execution.

Stars
6,276
Forks
1,575
Open issues
972
Last commit
11 hours ago

What is it?

AgentScope Java is a framework for building LLM-based agents in Java, targeting agents that run for a long time, serve many users and survive restarts. It provides a ReAct reasoning-and-acting core, plus a HarnessAgent layer that adds memory, skills, plan mode and subagent delegation on top of it.

The framework covers the runtime concerns that come up in production. Tool calls can be allowed, held for user approval or denied, and a unified event stream exposes model output, text deltas and tool execution in real time. Tools can run in local subprocesses, Docker, Kubernetes or an E2B cloud sandbox, and session state can be persisted to in-memory stores, JSON files, MySQL, Redis or PostgreSQL so that rolling deployments do not drop conversations.

Model providers ship as separate extension modules, including DashScope, OpenAI, Anthropic, Gemini and Ollama. Requires JDK 17 or higher and is distributed through Maven Central.

Key features

  • 01Unified event stream with typed events for real-time rendering and human-in-the-loop.
  • 02Tool-call permissions with allow, require approval, or deny states.
  • 03Middleware hooks to extend the reasoning-acting loop.
  • 04Tool execution in local, Docker, Kubernetes or E2B sandboxes.
  • 05Session and memory persistence to Redis, MySQL, PostgreSQL and other stores for cross-replica recovery.
  • 06Subagent spawning and messaging via agent_spawn and agent_send.

Use cases

  • Backend services in Java that need agents handling multi-turn, long-running tasks.
  • Enterprise applications requiring tool approval and audit of sensitive agent actions.
  • Multi-tenant SaaS deployments that need isolated sessions and sandboxed code execution.
  • Embedding agent workflows into existing Java systems with rolling deployments.

Quick start

  1. 1

    Add the Maven dependency for agentscope-harness (JDK 17+)

  2. 2

    Add a model provider extension, e.g. DashScope

  3. 3

    Set DASHSCOPE_API_KEY and run the Hello AgentScope example

Things to know

  • Requires JDK 17 or higher.
  • Model providers are separate extension modules that must be added individually.
  • Hello example needs a DashScope API key to run.

In collections

Topics

FAQ

What is agentscope-java?
A Java framework for building long-running, distributed agents with event streaming, tool permissions, middleware and sandboxed execution. AgentScope Java is a framework for building LLM-based agents in Java, targeting agents that run for a long time, serve many users and survive restarts. It provides a ReAct reasoning-and-acting core, plus a HarnessAgent layer that adds memory, skills, plan mode and subagent delegation on top of it.
Is agentscope-java free to use? What license does it have?
agentscope-java is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is agentscope-java still maintained?
Actively maintained. The last commit to agentscope-java was on Nov 6, 2026.
What can I use agentscope-java for?
Backend services in Java that need agents handling multi-turn, long-running tasks. Enterprise applications requiring tool approval and audit of sensitive agent actions. Multi-tenant SaaS deployments that need isolated sessions and sandboxed code execution. Embedding agent workflows into existing Java systems with rolling deployments.
How do I install agentscope-java?
Add the Maven dependency for agentscope-harness (JDK 17+) Add a model provider extension, e.g. DashScope Set DASHSCOPE_API_KEY and run the Hello AgentScope example
Where can I get agentscope-java?
The source code and installation instructions are on GitHub: https://github.com/agentscope-ai/agentscope-java

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects