# Ai-agent开发 **Repository Path**: ClickOne/ai-agent-development ## Basic Information - **Project Name**: Ai-agent开发 - **Description**: 基于spring ai框架 springboot3 +pgsql向量数据库,自定义advisor工厂、MCP工具、RAG文档划分等等开发的一款agent项目 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-07-06 - **Last Updated**: 2026-07-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AI Agent 开发框架 一个基于 Spring Boot 和 Spring AI 构建的智能 Agent 开发框架,支持 RAG(检索增强生成)、工具调用、MCP 协议集成等多种 AI 应用场景。 ## 功能特性 ### 🤖 智能 Agent - **ReAct Agent**: 基于 ReAct 推理模式的 Agent - **Tool Call Agent**: 支持工具调用的 Agent - **Manus Agent**: 多功能智能 Agent ### 🛠️ 工具集 - **邮件发送**: 支持 HTML 邮件、附件、CC - **文件操作**: 读写文件 - **PDF 生成**: 根据内容生成 PDF 文件 - **资源下载**: 从 URL 下载资源 - **终端命令**: 执行终端命令 - **网页抓取**: 抓取网页内容 - **网页搜索**: 百度搜索引擎搜索 ### 📚 RAG 向量检索 - 基于 Spring AI VectorStore - 支持多种文档加载和分词 - 查询重写增强 - 关键词 enrichment ### 💬 对话能力 - 持久化对话记忆 - 流式响应 (SSE) - MCP 协议集成 - 多模型支持 (DashScope) ## 技术栈 - Java 17+ - Spring Boot 3.x - Spring AI - 阿里云 DashScope - PostgreSQL (向量存储) - Maven ## 快速开始 ### 配置要求 在 `application.yml` 中配置必要的 API 密钥: ```yaml spring: ai: dashscope: chat: options: model: qwen-max api-key: your-api-key mail: username: your-email@example.com datasource: url: jdbc:postgresql://localhost:5432/yourdb username: yourusername password: yourpassword search-api: api-key: your-search-api-key ``` ### 构建运行 ```bash ./mvnw clean install ./mvnw spring-boot:run ``` ### API 接口 - `GET /health` - 健康检查 - `GET /ai/love_app/chat` - 情感应用对话 - `GET /ai/manus/chat` - Manus Agent 对话 ## 项目结构 ``` ai-agent-development/ ├── src/main/java/com/anzai/aiagent/ │ ├── agent/model/ # Agent 模型 │ ├── app/ # 业务应用 │ ├── chatmemory/ # 对话记忆 │ ├── common/ # 通用响应 │ ├── config/ # 配置类 │ ├── controllor/ # 控制器 │ ├── exception/ # 异常处理 │ ├── rag/ # RAG 向量检索 │ └── tools/ # 工具类 ├── ai-agent-image-search-mcp/ # MCP 图像搜索模块 └── pom.xml ``` ## 示例代码 ### 使用工具进行对话 ```java @Resource private ToolCallback[] allTools; public String doChatWithTools(String message, String chatId) { // 使用注册的工具进行对话 } ``` ### RAG 向量检索 ```java @Resource private VectorStore loveAppVectorStore; public String doChatWithRag(String message, String chatId) { // 使用向量存储进行检索增强对话 } ``` ### MCP 集成 ```java @Resource private ToolCallbackProvider toolCallbackProvider; public String doChatWithMCP(String message, String chatId) { // 使用 MCP 协议进行对话 } ``` ## 许可证 MIT License