AgentScope Java

An agent-oriented programming framework for building LLM applications


What is AgentScope Java?

AgentScope Java is a powerful framework that enables developers to build LLM-powered applications using agent-oriented programming paradigms. It provides a comprehensive toolkit for creating intelligent agents with tool calling, memory management, multi-agent collaboration, and more.

Key Features

  • Multi-Model Support: DashScope (Qwen), OpenAI, and more LLM providers

  • Tool System: Annotation-based tool registration and execution with automatic schema generation

  • Reactive Architecture: Built on Project Reactor for efficient non-blocking operations

  • Memory Management: Short-term memory and long-term memory with external backends (Mem0)

  • Multi-Agent Pipelines: Sequential and parallel agent workflows for complex tasks

  • State Management: Session-based persistence and recovery with JSON storage

  • Hook System: Extensible event-driven customization for monitoring and control

  • MCP Support: Model Context Protocol integration for enhanced tool capabilities

Requirements

  • JDK 17 or higher

  • Maven or Gradle

Quick Start

Follow these steps to get started with AgentScope Java:

  1. Installation - Set up AgentScope Java in your project

  2. Key Concepts - Understand core concepts and architecture

  3. Build Your First Agent - Create a working agent

Quick Example

import io.agentscope.core.ReActAgent;
import io.agentscope.core.model.DashScopeChatModel;
import io.agentscope.core.message.Msg;

// Create an agent with inline model configuration
var agent = ReActAgent.builder()
    .name("Assistant")
    .model(DashScopeChatModel.builder()
        .apiKey(System.getenv("DASHSCOPE_API_KEY"))
        .modelName("qwen-plus")
        .build())
    .sysPrompt("You are a helpful assistant.")
    .build();

// Call the agent
Msg userMsg = Msg.builder()
    .textContent("Hello!")
    .build();

Msg response = agent.call(userMsg).block();
System.out.println(response.getTextContent());

Advanced Topics

Once you’re familiar with the basics, explore these advanced features:

Model Integration

Tools & Knowledge

  • Tool System - Create and use tools with annotation-based registration

  • MCP - Model Context Protocol support for advanced tool integration

  • RAG - Retrieval-Augmented Generation for knowledge-enhanced responses

Agent Customization

  • Hook System - Monitor and customize agent behavior with event hooks

  • Memory Management - Manage conversation history and long-term memory

  • Planning - Plan management for complex multi-step tasks

Multi-Agent Systems

  • Pipeline - Build multi-agent workflows with sequential and parallel execution

  • State Management - Persist and restore agent state across sessions

Community

Discord

DingTalk

WeChat

QR Code

QR Code

QR Code

License

AgentScope Java is released under the Apache License 2.0.


Ready to build intelligent agents? Start with the Installation Guide!