陈子默 735a840945 fix: 代码节点缺失引擎时抛出明确异常
- 在 CodeNode 执行前增加运行时引擎空值校验

- 避免空指针失败,错误信息包含 engine 标识
2026-03-01 20:01:31 +08:00
2026-02-22 18:55:40 +08:00
2026-02-22 18:55:40 +08:00
2026-02-22 18:55:40 +08:00
2026-02-22 18:55:40 +08:00
2026-02-22 18:55:40 +08:00
2026-02-22 18:55:40 +08:00

Easy-Agents

Easy-Agents 是一个轻量、可扩展的 Java AI 应用开发框架覆盖从模型调用到工具执行、MCP 集成、检索与工作流编排的完整链路。

主要能力

  • 多模型统一接入Chat / Embedding / Rerank / Image
  • Prompt 与消息上下文管理
  • Tool 定义、执行与拦截器机制
  • MCP 客户端能力(调用、拦截、缓存与管理)
  • 文档读取与切分、向量存储与检索
  • 工作流执行引擎Flow与 Easy-Agents 适配支持

模块说明

  • easy-agents-bom依赖版本管理BOM
  • easy-agents-core:核心抽象与基础能力。
  • easy-agents-chat:对话模型接入实现集合。
  • easy-agents-embedding:向量化模型实现集合。
  • easy-agents-rerank:重排模型实现集合。
  • easy-agents-image:图像模型能力。
  • easy-agents-store:向量存储实现。
  • easy-agents-search-engine:检索引擎实现。
  • easy-agents-tool:工具调用能力。
  • easy-agents-mcpMCP 集成。
  • easy-agents-flow:流程编排核心引擎。
  • easy-agents-supportFlow 与 Easy-Agents 适配模块。
  • easy-agents-spring-boot-starterSpring Boot 自动配置支持。
  • easy-agents-samples:示例工程。

环境要求

  • JDK 8+
  • Maven 3.8+

构建与安装

在项目根目录执行:

mvn -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true clean install

构建完成后,相关构件会安装到本地 Maven 仓库,可供 easyflow 等项目直接依赖。

快速示例

public static void main(String[] args) {
    OpenAIChatModel chatModel = OpenAIChatConfig.builder()
        .provider("GiteeAI")
        .endpoint("https://ai.gitee.com")
        .requestPath("/v1/chat/completions")
        .apiKey("your-api-key")
        .model("Qwen3-32B")
        .buildModel();

    String output = chatModel.chat("如何才能更幽默?");
    System.out.println(output);
}

在业务项目中引入(示例)

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.easyagents</groupId>
      <artifactId>easy-agents-bom</artifactId>
      <version>0.0.1</version>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependencies>
  <dependency>
    <groupId>com.easyagents</groupId>
    <artifactId>easy-agents-flow</artifactId>
  </dependency>
  <dependency>
    <groupId>com.easyagents</groupId>
    <artifactId>easy-agents-support</artifactId>
  </dependency>
</dependencies>
Description
Spring 构建的 Agent 底层封装
Readme 744 KiB
Languages
Java 100%