Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
- 🚀 **Code-as-Action**: Agent generates and executes code to complete tasks, rather than just calling predefined tools
- 🔒 **Secure Sandbox**: AI-generated code runs safely in GraalVM polyglot sandbox with resource isolation
- 📊 **Multi-dimensional Evaluation**: Multi-layer intent recognition through Evaluation Graph, precisely guiding Agent behavior
- 🔄 **Dynamic Prompt Builder**: Dynamically inject context (experiences, knowledge, etc.) into prompts based on scenarios and evaluation results
- 🧠 **Experience Learning**: Automatically accumulates successful experiences to continuously improve performance on subsequent tasks
- 🔄 **Dynamic Prompt Builder**: Dynamically inject runtime context, prefetched experience candidates, and stable guidance into prompts based on scenarios and evaluation results
- 🧠 **Unified Experience System**: Manage COMMON / REACT / TOOL experiences in one model, support conversion to and from the Skills model, and improve experience efficiency and quality through progressive disclosure
- 🗂️ **Management Console**: Provide a dedicated management module for experience search, CRUD, statistics, and SKILL preview / import / export, so reusable experience and skill assets can be maintained in one place
- ⚡ **Fast Response**: For familiar scenarios, skip LLM reasoning process and respond quickly based on experience

## 📖 Introduction
Expand All @@ -29,9 +30,10 @@
Assistant Agent is a fully-featured intelligent assistant with the following core capabilities:

- 🔍 **Intelligent Q&A**: Supports unified retrieval architecture across multiple data sources (extensible via SPI for knowledge base, Web, etc.), providing accurate, traceable answers
- 🛠️ **Tool Invocation**: Supports MCP, HTTP API (OpenAPI) and other protocols, flexibly access massive tools, combine multiple tools to implement complex business workflows
- 🛠️ **Tool Invocation**: Supports MCP, HTTP API (OpenAPI) and other protocols, can invoke tools directly in the React loop or orchestrate multiple tools in generated code for more complex workflows
- ⏰ **Proactive Service**: Supports scheduled tasks, delayed execution, event callbacks, letting the assistant proactively serve you
- 📬 **Multi-channel Delivery**: Built-in IDE reply, extensible to DingTalk, Feishu, WeCom, Webhook and other channels via SPI
- 🧩 **Experience and Operations Management**: Supports experience management, tenant-aware retrieval, and bidirectional conversion between the experience model and SKILL packages, making it easier to accumulate and reuse business capabilities

### Why Choose Assistant Agent?

Expand Down Expand Up @@ -69,14 +71,15 @@ AssistantAgent/
├── assistant-agent-core # Core engine: GraalVM executor, tool registry
├── assistant-agent-extensions # Extension modules:
│ ├── dynamic/ # - Dynamic tools (MCP, HTTP API)
│ ├── experience/ # - Experience management and FastIntent configuration
│ ├── experience/ # - Unified experience runtime, disclosure, and FastIntent configuration
│ ├── learning/ # - Learning extraction and storage
│ ├── search/ # - Unified search capability
│ ├── reply/ # - Multi-channel reply
│ ├── trigger/ # - Trigger mechanism
│ └── evaluation/ # - Evaluation integration
├── assistant-agent-prompt-builder # Prompt dynamic assembly
├── assistant-agent-evaluation # Evaluation engine
├── assistant-agent-management # Experience management and SKILL conversion APIs
├── assistant-agent-autoconfigure # Spring Boot auto-configuration
└── assistant-agent-start # Startup module
```
Expand Down Expand Up @@ -228,8 +231,8 @@ For detailed documentation on each module, please visit our [Documentation Site]

| Module | Description | Documentation |
|--------|-------------|---------------|
| **Experience** | Accumulate and reuse historical successful execution experiences with FastIntent support | [Quick Start](https://java2ai.com/agents/assistantagent/features/experience/quickstart) | [Advanced](https://java2ai.com/agents/assistantagent/features/experience/advanced) |
| **Learning** | Automatically extract valuable experiences from Agent execution history | [Quick Start](https://java2ai.com/agents/assistantagent/features/learning/quickstart) | [Advanced](https://java2ai.com/agents/assistantagent/features/learning/advanced) |
| **Experience** | Unified COMMON / REACT / TOOL experience model with FastIntent support, conversion to and from Skills, progressive disclosure, and runtime retrieval via `search_exp` / `read_exp` | [Quick Start](https://java2ai.com/agents/assistantagent/features/experience/quickstart) | [Advanced](https://java2ai.com/agents/assistantagent/features/experience/advanced) |
| **Learning** | Automatically extract valuable COMMON / REACT / TOOL experiences from Agent execution history | [Quick Start](https://java2ai.com/agents/assistantagent/features/learning/quickstart) | [Advanced](https://java2ai.com/agents/assistantagent/features/learning/advanced) |
| **Search** | Multi-source unified search engine for knowledge-based Q&A | [Quick Start](https://java2ai.com/agents/assistantagent/features/search/quickstart) | [Advanced](https://java2ai.com/agents/assistantagent/features/search/advanced) |

### Interaction Capabilities
Expand All @@ -239,6 +242,13 @@ For detailed documentation on each module, please visit our [Documentation Site]
| **Reply Channel** | Multi-channel message reply with routing support | [Quick Start](https://java2ai.com/agents/assistantagent/features/reply/quickstart) | [Advanced](https://java2ai.com/agents/assistantagent/features/reply/advanced) |
| **Trigger** | Scheduled tasks, delayed execution, and event callback triggers | [Quick Start](https://java2ai.com/agents/assistantagent/features/trigger/quickstart) | [Advanced](https://java2ai.com/agents/assistantagent/features/trigger/advanced) |

### Management Capabilities

| Capability | Description | Entry |
|--------|-------------|-------|
| **Experience Management API** | Tenant-aware listing, search, stats, and CRUD for runtime experiences | [ExperienceManagementController](assistant-agent-management/src/main/java/com/alibaba/assistant/agent/management/controller/ExperienceManagementController.java) |
| **SKILL Conversion API** | Convert to and from SKILL content, enabling bidirectional conversion between the Skills model and the unified experience model | [SkillExchangeController](assistant-agent-management/src/main/java/com/alibaba/assistant/agent/management/controller/SkillExchangeController.java) |

### Additional Resources

| Resource | Link |
Expand Down
22 changes: 16 additions & 6 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
- 🚀 **代码即行动(Code-as-Action)**:Agent 通过生成并执行代码来完成任务,而非仅仅调用预定义工具,可以在代码中灵活组合多个工具,实现复杂流程
- 🔒 **安全沙箱**:AI 生成的代码在 GraalVM 多语言沙箱中安全运行,具备资源隔离能力
- 📊 **多维评估**:通过评估图(Graph)进行多层次意图识别,精准指导 Agent 行为
- 🔄 **Prompt 动态组装**:根据场景及前置评估结果动态注入上下文(经验、知识等)到 Prompt 中,灵活处理不同任务
- 🧠 **经验学习**:自动积累成功经验,持续提升后续任务的表现
- 🔄 **Prompt 动态组装**:根据场景及前置评估结果,动态注入运行时上下文、预取经验候选和稳定指导信息到 Prompt 中,灵活处理不同任务
- 🧠 **统一经验体系**:以统一模型管理 COMMON / REACT / TOOL 三类经验,支持与 Skills 模型互相转化,并通过渐进式披露思想提高经验使用效率与效果
- 🗂️ **管理后台**:通过独立管理模块提供经验检索、CRUD、统计,以及 SKILL 预览 / 导入 / 导出等能力,便于统一维护可复用经验与技能资产
- ⚡ **快速响应**:熟悉场景下,跳过 LLM 推理过程,基于经验快速响应

## 📖 简介
Expand All @@ -26,9 +27,10 @@
Assistant Agent 是一个功能完整的智能助手,具备以下核心能力:

- 🔍 **智能问答**:支持多数据源统一检索架构(通过 SPI 可扩展知识库、Web 等数据源),提供准确、可溯源的答案
- 🛠️ **工具调用**:支持 MCP、HTTP API(OpenAPI)等协议,灵活接入海量工具,可组合调用实现复杂业务流程
- 🛠️ **工具调用**:支持 MCP、HTTP API(OpenAPI)等协议,既可在 React 阶段直接调用工具,也可在生成代码中组合多个工具完成复杂业务流程
- ⏰ **主动服务**:支持定时任务、延迟执行、事件回调,让助手主动为你服务
- 📬 **多渠道触达**:内置 IDE 回复,通过 SPI 可扩展钉钉、飞书、企微、Webhook 等渠道
- 🧩 **运维与经验管理**:支持经验管理、租户维度检索,以及经验模型与 SKILL 包之间的双向转换,方便沉淀并复用业务能力

### 为什么选择 Assistant Agent?

Expand Down Expand Up @@ -64,14 +66,15 @@ AssistantAgent/
├── assistant-agent-core # 核心引擎:GraalVM 执行器、工具注册表
├── assistant-agent-extensions # 扩展模块:
│ ├── dynamic/ # - 动态工具(MCP、HTTP API)
│ ├── experience/ # - 经验管理与快速意图配置
│ ├── experience/ # - 统一经验运行时、经验披露与快速意图配置
│ ├── learning/ # - 学习提取与存储
│ ├── search/ # - 统一搜索能力
│ ├── reply/ # - 多渠道回复
│ ├── trigger/ # - 触发器机制
│ └── evaluation/ # - 评估集成
├── assistant-agent-prompt-builder # Prompt 动态组装
├── assistant-agent-evaluation # 评估引擎
├── assistant-agent-management # 经验管理与 SKILL 转换 API
├── assistant-agent-autoconfigure # Spring Boot 自动配置
└── assistant-agent-start # 启动模块
```
Expand Down Expand Up @@ -223,8 +226,8 @@ public class MyKnowledgeSearchProvider implements SearchProvider {

| 模块 | 说明 | 文档 |
|------|------|------|
| **经验模块** | 积累和复用历史成功执行经验,支持快速意图响应 | [快速开始](https://java2ai.com/agents/assistantagent/features/experience/quickstart) | [高级特性](https://java2ai.com/agents/assistantagent/features/experience/advanced) |
| **学习模块** | 从 Agent 执行历史中自动提取有价值的经验 | [快速开始](https://java2ai.com/agents/assistantagent/features/learning/quickstart) | [高级特性](https://java2ai.com/agents/assistantagent/features/learning/advanced) |
| **经验模块** | 基于统一 COMMON / REACT / TOOL 模型管理经验,支持快速意图、与 Skills 模型互转、渐进式披露,以及通过 `search_exp` / `read_exp` 进行运行时检索 | [快速开始](https://java2ai.com/agents/assistantagent/features/experience/quickstart) | [高级特性](https://java2ai.com/agents/assistantagent/features/experience/advanced) |
| **学习模块** | 从 Agent 执行历史中自动提取有价值的 COMMON / REACT / TOOL 经验 | [快速开始](https://java2ai.com/agents/assistantagent/features/learning/quickstart) | [高级特性](https://java2ai.com/agents/assistantagent/features/learning/advanced) |
| **搜索模块** | 多数据源统一检索引擎,支持知识问答 | [快速开始](https://java2ai.com/agents/assistantagent/features/search/quickstart) | [高级特性](https://java2ai.com/agents/assistantagent/features/search/advanced) |

### 交互能力
Expand All @@ -234,6 +237,13 @@ public class MyKnowledgeSearchProvider implements SearchProvider {
| **回复渠道** | 多渠道消息回复,支持渠道路由 | [快速开始](https://java2ai.com/agents/assistantagent/features/reply/quickstart) | [高级特性](https://java2ai.com/agents/assistantagent/features/reply/advanced) |
| **触发器** | 定时任务、延迟执行、事件回调触发 | [快速开始](https://java2ai.com/agents/assistantagent/features/trigger/quickstart) | [高级特性](https://java2ai.com/agents/assistantagent/features/trigger/advanced) |

### 管理能力

| 能力 | 说明 | 入口 |
|------------------|--------------------------------------------|------|
| **经验管理 API** | 提供面向租户的经验列表、搜索、统计与 CRUD 能力 | [ExperienceManagementController](assistant-agent-management/src/main/java/com/alibaba/assistant/agent/management/controller/ExperienceManagementController.java) |
| **SKILL 转换 API** | 提供与 SKILL 的转换能力,支撑 Skills 模型与统一经验模型之间的双向转换 | [SkillExchangeController](assistant-agent-management/src/main/java/com/alibaba/assistant/agent/management/controller/SkillExchangeController.java) |

### 更多资源

| 资源 | 链接 |
Expand Down
2 changes: 1 addition & 1 deletion assistant-agent-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.agent.assistant</groupId>
<artifactId>assistant-agent</artifactId>
<version>0.2.4</version>
<version>0.2.5</version>
</parent>

<artifactId>assistant-agent-autoconfigure</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import com.alibaba.assistant.agent.core.tool.ToolRegistryBridgeFactory;
import com.alibaba.assistant.agent.core.tool.schema.ReturnSchemaRegistry;
import com.alibaba.assistant.agent.extension.experience.config.ExperienceExtensionProperties;
import com.alibaba.assistant.agent.extension.experience.fastintent.CodeFastIntentSupport;
import com.alibaba.assistant.agent.extension.experience.fastintent.FastIntentService;
import com.alibaba.assistant.agent.extension.experience.spi.ExperienceProvider;
import com.alibaba.assistant.agent.autoconfigure.tools.ExecuteCodeTool;
Expand Down Expand Up @@ -627,11 +626,6 @@ public CodeactAgent build() {
this.executionTimeoutMs
);

CodeFastIntentSupport codeFastIntentSupport =
(experienceProvider != null && experienceExtensionProperties != null && fastIntentService != null)
? new CodeFastIntentSupport(experienceProvider, experienceExtensionProperties, fastIntentService)
: null;

ExecuteCodeTool executeCodeTool = new ExecuteCodeTool(this.executor, this.codeContext, this.variableProvider);

// Manually create the components like DefaultBuilder does
Expand Down Expand Up @@ -706,10 +700,10 @@ public CodeactAgent build() {
}

allTools.add(WriteCodeTool.createWriteCodeToolCallback(
this.codeContext, this.environmentManager, codeFastIntentSupport));
this.codeContext, this.environmentManager));

allTools.add(WriteConditionCodeTool.createWriteConditionCodeToolCallback(
this.codeContext, this.environmentManager, codeFastIntentSupport));
this.codeContext, this.environmentManager));

allTools.add(
FunctionToolCallback.builder("execute_code", executeCodeTool)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
import com.alibaba.assistant.agent.evaluation.DefaultEvaluationService;
import com.alibaba.assistant.agent.evaluation.EvaluationService;
import com.alibaba.assistant.agent.evaluation.builder.EvaluationSuiteBuilder;
import com.alibaba.assistant.agent.evaluation.evaluator.Evaluator;
import com.alibaba.assistant.agent.evaluation.evaluator.EvaluatorRegistry;
import com.alibaba.assistant.agent.evaluation.evaluator.LLMBasedEvaluator;
import com.alibaba.assistant.agent.evaluation.evaluator.RuleBasedEvaluator;
import com.alibaba.assistant.agent.evaluation.model.EvaluationCriterion;
import com.alibaba.assistant.agent.evaluation.model.EvaluationSuite;
import com.alibaba.assistant.agent.extension.evaluation.config.CodeactEvaluationContextFactory;
import com.alibaba.assistant.agent.extension.evaluation.experience.ExperienceRetrievalEvaluatorFactory;
import com.alibaba.assistant.agent.extension.evaluation.hook.ReactBeforeModelEvaluationHook;
import com.alibaba.assistant.agent.extension.experience.spi.ExperienceProvider;
import com.alibaba.assistant.agent.extension.prompt.ReactPromptContributorModelHook;
import com.alibaba.assistant.agent.prompt.PromptContributorManager;
import com.alibaba.cloud.ai.graph.agent.hook.Hook;
Expand Down Expand Up @@ -74,18 +72,18 @@ public class DefaultEvaluationSuiteConfig {
private final DefaultEvaluationProperties properties;
private final ChatModel chatModel;
private final List<EvaluationCriterionProvider> criterionProviders;
private final ExperienceProvider experienceProvider;
private final List<Evaluator> customEvaluators;

public DefaultEvaluationSuiteConfig(
DefaultEvaluationProperties properties,
ChatModel chatModel,
@Autowired(required = false) List<EvaluationCriterionProvider> criterionProviders,
@Autowired(required = false) ExperienceProvider experienceProvider) {
@Autowired(required = false) List<Evaluator> customEvaluators) {
this.properties = properties;
this.chatModel = chatModel;
this.criterionProviders = criterionProviders;
this.experienceProvider = experienceProvider;
log.info("DefaultEvaluationSuiteConfig#<init> - reason=初始化默认评估套件配置, experienceProviderAvailable={}", experienceProvider != null);
this.customEvaluators = customEvaluators;
log.info("DefaultEvaluationSuiteConfig#<init> - reason=初始化默认评估套件配置");
}

/**
Expand Down Expand Up @@ -178,9 +176,7 @@ private EvaluationSuite createDefaultSuite() {
/**
* 创建默认的评估器注册表
*
* <p>Starter 层自动装配:
* - LLM 评估器
* - 经验检索评估器(如果 ExperienceProvider 可用)
* <p>Starter 层自动装配 LLM 评估器。
*/
private EvaluatorRegistry createDefaultEvaluatorRegistry() {
EvaluatorRegistry registry = new EvaluatorRegistry();
Expand All @@ -189,14 +185,15 @@ private EvaluatorRegistry createDefaultEvaluatorRegistry() {
LLMBasedEvaluator llmEvaluator = new LLMBasedEvaluator(chatModel, "llm-based");
registry.registerEvaluator(llmEvaluator);


// 自动注册经验检索评估器(如果 ExperienceProvider 可用)
if (experienceProvider != null && properties.getExperience().isEnabled()) {
int maxExperiences = properties.getExperience().getMaxExperiencesPerType();
RuleBasedEvaluator expEvaluator = ExperienceRetrievalEvaluatorFactory.createExperienceEvaluator(
experienceProvider, maxExperiences);
registry.registerEvaluator(expEvaluator);
log.info("DefaultEvaluationSuiteConfig#createDefaultEvaluatorRegistry - reason=注册经验检索评估器");
if (customEvaluators != null) {
for (Evaluator evaluator : customEvaluators) {
if (evaluator == null || "llm-based".equals(evaluator.getEvaluatorId())) {
continue;
}
registry.registerEvaluator(evaluator);
log.info("DefaultEvaluationSuiteConfig#createDefaultEvaluatorRegistry - reason=注册自定义评估器, evaluatorId={}",
evaluator.getEvaluatorId());
}
}

return registry;
Expand All @@ -216,4 +213,3 @@ public EvaluatorRegistry evaluatorRegistry() {
return createDefaultEvaluatorRegistry();
}
}

Loading
Loading