Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
easy-agent是Agent组件,零改造接入,为存量系统赋予智能体(Agent)能力。
| Date | Stars |
|---|---|
| 2026-07-31 | 358 |
| 2026-08-06 | 358 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Easy Agent
<p align="center">
<strong> Java 应用打造的 Agent 开发组件</strong>
</p>
<p align="center">
<img src="https://img.shields.io/badge/JDK-17%2B-green" alt="JDK 17+">
<img src="https://img.shields.io/badge/Spring%20Boot-3.5%2B-brightgreen" alt="Spring Boot 3.5+">
<img src="https://img.shields.io/badge/Spring%20AI-1.0%2B-blue" alt="Spring AI 1.0+">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue" alt="License">
</p>
---
## 项目简介
Easy Agent 是一个面向 Java 应用的智能体(Agent)开发组件,深度拥抱 Spring 生态,旨在让基于 Spring Boot 的应用快速暴露业务工具、接入大模型、提供 MCP 工具服务,并使用本地文档做基础 RAG 检索。开发者引入 Starter 后,可以通过配置开关启用注解式工具注册、MCP HTTP 接口、Skill 文件生成、RAG 检索和 OpenAI 兼容 LLM 客户端。
### 核心理念
- **零侵入**:通过 `@EasyTool` 注解自动发现和注册工具,无需修改业务代码结构
- **即插即用**:引入 Starter 依赖即可自动装配,通过配置开关控制各模块
- **灵活组合**:未配置 LLM 时也可以仅提供 MCP 工具调用能力
- **领域友好**:Skill 生成器通过对话式引导,生成你的专属业务 Skill Markdown 文件
### MCP 治理说明
- 默认情况下,MCP 会暴露所有已启用工具,保持现有行为不变
- 如果你希望收敛暴露范围,可以开启 `easy-agent.mcp.tool-exposure.enabled`
- 支持按工具名、来源、分类做允许/屏蔽控制
- 所有 MCP 错误现在统一使用错误枚举和错误工厂生成,便于客户端稳定识别
其中:
- `allowed-tools` / `blocked-tools` 填工具名,例如 `queryUserPermission`、`createOrder`
- `allowed-sources` / `blocked-sources` 填工具来源,例如 `annotation`、`skill`、`BusinessToolProvider`
- `allowed-categories` / `blocked-categories` 填工具分类,例如 `user`、`order`、`report`
- `category` 是你在 `@EasyTool(category = "...")` 中自定义的业务分组名
- `source` 是工具来源标签,注解工具默认是 `annotation`,SPI 工具默认是提供者类名
示例:
- 只暴露用户相关工具:`allowed-categories: [user]`
- 屏蔽报表类工具:`blocked-categories: [report]`
- 只允许注解式工具:`allowed-sources: [annotation]`
- 只允许 Skill 元工具:`allowed-sources: [skill]`
- 屏蔽某个具体工具:`blocked-tools: [deleteUser, exportReport]`
---
## 技术栈
| 类别 | 技术 | 版本 |
|------|------|------|
| 基础框架 | Spring Boot | 3.5+ |
| AI 框架 | Spring AI | 1.0+ |
| JDK | OpenJDK / Oracle JDK | 17+ |
| 向量存储 | 内存存储(当前默认)/ PGVector 占位实现 | - |
| PDF 解析 | Apache PDFBox | 3.0.5 |
| JSON | Jackson | Spring Boot 内置 |
| 构建工具 | Maven | 3.9+ |
### 支持的大模型
| Provider | 说明 | 接入方式 |
|----------|------|----------|
| **DashScope(通义千问)** | 阿里云通义千问系列模型 | OpenAI 兼容 API |
| **DeepSeek** | DeepSeek 系列模型 | OpenAI 兼容 API |
| **Ollama** | 本地私有化部署模型 | OpenAI 兼容 API |
| **OpenAI** | GPT 系列模型 | OpenAI API |
---
## 模块架构
```
easy-agent
├── easy-agent-core # 核心模块:注解、注册中心、执行器
├── easy-agent-rag # RAG 模块:PDF/Excel 加载、内存检索、多搜索策略
├── easy-agent-mcp # MCP 模块:HTTP JSON-RPC 工具服务
├── easy-agent-skill # Skill 模块:业务 Skill Markdown 文件生成服务
├── easy-agent-llm # LLM 模块:多模型适配、OpenAI 兼容客户端
├── easy-agent-spring-boot-starter # Starter:自动装配、配置元数据
```
---
## 功能详解
### 1. @EasyTool 注解式工具注册
在任意 Spring Bean 的方法上添加 `@EasyTool` 注解,该方法便会自动注册到 `ToolRegistry`,可以通过 `ToolExecutor` 执行,也可以通过 MCP 的 `tools/list` 和 `tools/call` 暴露给客户端调用。
```java
@Service
public class OrderService {
@EasyTool(name = "queryOrder", description = "根据订单号查询订单详情")
public OrderResult queryOrder(
@ToolParam(name = "orderId", description = "订单号") String orderId) {
return orderRepository.findById(orderId);
}
@EasyTool(name = "cancelOrder", description = "取消指定订单", category = "order")
public CancelResult cancelOrder(
@ToolParam(name = "orderId", description = "订单号") String orderId,
@ToolParam(name = "reason", description = "取消原因", required = false) String reason) {
return orderService.cancel(orderId, reason);
}
}
```
**核心组件:**
| 组件 | 说明 |
|------|------|
| `@EasyTool` | 方法级注解,声明工具名称、描述、分类、启用状态 |
| `@ToolParam` | 参数级注解,声明参数名称、描述、是否必填 |
| `ToolRegistry` | 工具注册中心,管理所有已注册的工具定义 |
| `ToolExecutor` | 工具执行器,负责参数解析、反射调用、结果序列化 |
| `EasyToolBeanPostProcessor` | Bean 后置处理器,自动扫描并注册 @EasyTool 方法 |
**SPI 接口:**
- `ToolProvider`:自定义工具提供者,可编程式注册工具
- `ToolExecutionListener`:工具执行监听器,支持 before/after/error 钩子
业务系统引入 Starter 后,只需要把 `ToolProvider` 声明为 Spring Bean,easy-agent 会自动收集并注册其返回的工具定义。`priority()` 数值越小越先注册;如果工具名称重复,按 `ToolRegistry` 的现有规则覆盖。
```java
@Component
public class BusinessToolProvider impleExcerpt of 27,788 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:0a5c5c7344754578, llm:Repository description: 'easy-agent是Agent组件,零改造接入,为存量系统赋予智能体(Agent)能力.' (Agent component to add agent capabilities to existing systems). Language: Java. No topics provided.