📦 引入依赖
本系列使用 LiteFlow 2.16.3、JDK 17+ 和已有的 Spring Boot 项目。先创建一个能流式回复的对话 Agent,不需要 Docker 或数据库。
# 添加 Maven 依赖
在已有 Spring Boot 项目的 pom.xml 中添加:
<properties>
<liteflow.version>2.16.3</liteflow.version>
</properties>
<dependencies>
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>liteflow-spring-boot-starter</artifactId>
<version>${liteflow.version}</version>
</dependency>
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>liteflow-agent-core</artifactId>
<version>${liteflow.version}</version>
</dependency>
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>liteflow-agent-openai</artifactId>
<version>${liteflow.version}</version>
</dependency>
</dependencies>
Spring Boot 4 使用 liteflow-spring-boot4-starter。各 LiteFlow 模块版本保持一致,AgentScope 依赖会自动引入。如果所用 Maven 仓库还未提供该版本,可先从源码安装,步骤见演示项目。
模型平台可以替换为 liteflow-agent-anthropic、liteflow-agent-gemini 或 liteflow-agent-dashscope,具体对应关系见模型配置。
# 只需要 AI 选择分支时
如果需求是根据客户消息选择退款、换货等流程,可使用 liteflow-agent-jev:
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>liteflow-agent-jev</artifactId>
<version>${liteflow.version}</version>
</dependency>
保留对应的 LiteFlow starter 即可,不必为 Jev 额外引入 liteflow-agent-core 或聊天模型模块。Jev 使用独立的 liteflow.agent.jev.* 配置,组件继承 JevSwitchComponent,详见 Jev 依赖与配置。
对话 Agent 的下一步:基本配置。
帮助我们改善此文档 (opens new window)
上次更新: 2026/09/21, 16:34:59



