From e9f514e4068413a463b8128723c938310dec1bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Tue, 21 Oct 2025 18:32:47 +0800 Subject: [PATCH] modify readme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3f4d654..9a4a7c4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Qwen Agent - 智能数据检索专家系统 +# Catalog Agent - 智能数据检索专家系统 [![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://python.org) [![FastAPI](https://img.shields.io/badge/FastAPI-0.100+-green.svg)](https://fastapi.tiangolo.com) @@ -6,7 +6,7 @@ ## 📋 项目概述 -Qwen Agent 是一个基于 FastAPI 构建的智能数据检索专家系统,专门用于处理和分析结构化数据集。系统通过无状态的 ZIP 项目加载机制,支持动态加载多种数据集,并提供类似 OpenAI 的聊天接口,便于与现有 AI 应用集成。 +Catalog Agent 是一个基于 FastAPI 构建的智能数据检索专家系统,专门用于处理和分析结构化数据集。系统通过无状态的 ZIP 项目加载机制,支持动态加载多种数据集,并提供类似 OpenAI 的聊天接口,便于与现有 AI 应用集成。 ### 🌟 核心特性 @@ -16,6 +16,7 @@ Qwen Agent 是一个基于 FastAPI 构建的智能数据检索专家系统,专 - **🚀 异步文件处理队列** - 基于 huey 和 SQLite 的高性能异步任务队列 - **📊 任务状态管理** - 实时任务状态查询和 SQLite 数据持久化 - **🤖 兼容 OpenAI API** - 完全兼容 OpenAI chat/completions 接口 +- **🔧 MCP 工具集成** - 集成多种 Model Context Protocol 工具,支持语义搜索、关键词搜索、Excel/CSV 操作等 --- @@ -23,7 +24,7 @@ Qwen Agent 是一个基于 FastAPI 构建的智能数据检索专家系统,专 ### 环境要求 -- Python 3.8+ +- Python 3.12+ - Poetry (推荐) 或 pip - 足够的磁盘空间用于缓存 @@ -37,6 +38,9 @@ poetry run python fastapi_app.py # 或使用 pip pip install -r requirements.txt python fastapi_app.py + +# 启动队列消费者(另一个终端) +poetry run python task_queue/consumer.py --workers 2 ``` ### Docker 部署 @@ -71,7 +75,7 @@ curl -X POST "http://localhost:8001/api/v1/chat/completions" \ } ], "model": "qwen3-next", - "zip_url": "http://127.0.0.1:8080/all_hp_product_spec_book2506.zip", + "unique_id": "xxxx", "stream": false }' ``` @@ -96,10 +100,10 @@ curl -X POST "http://localhost:8001/api/v1/files/process/async" \ -d '{ "unique_id": "my_project_123", "files": { - "documents": ["public/document.txt"], - "reports": ["public/data.zip"] - }, - "system_prompt": "处理这些文档" + "public/document.txt", + "public/data.zip", + "public/goods.xlsx" + } }' ``` @@ -221,6 +225,7 @@ dataset_name/ - **document.txt**: 原始 Markdown 文本,提供完整上下文 - **serialization.txt**: 格式化结构数据,每行 `字段1:值1;字段2:值2` - **schema.json**: 字段定义、枚举值映射和文件关联关系 +- **mcp_settings.json**: MCP 工具配置,定义可用的数据处理工具 --- @@ -286,6 +291,7 @@ curl -X POST "http://localhost:8001/api/v1/tasks/cleanup?older_than_days=7" - `GET /api/v1/tasks` - 列出任务(支持筛选) - `GET /api/v1/tasks/statistics` - 获取统计信息 - `DELETE /api/v1/task/{task_id}` - 删除任务记录 +- `POST /api/v1/project/cleanup` - 清理项目数据 ### 系统管理接口 - `GET /api/health` - 健康检查 @@ -363,10 +369,26 @@ qwen-agent/ │ ├── task_status.py # 任务状态存储 │ └── consumer.py # 队列消费者 ├── utils/ # 工具模块 +│ ├── agent_pool.py # 助手池管理 +│ ├── api_models.py # API 数据模型 +│ ├── dataset_manager.py # 数据集管理 +│ ├── excel_csv_processor.py # Excel/CSV 处理器 +│ ├── file_utils.py # 文件操作工具 +│ ├── project_manager.py # 项目管理器 +│ └── prompt_loader.py # 提示词加载器 +├── mcp/ # MCP 工具服务器 +│ ├── semantic_search_server.py # 语义搜索服务 +│ ├── multi_keyword_search_server.py # 多关键词搜索服务 +│ ├── excel_csv_operator_server.py # Excel/CSV 操作服务 +│ ├── json_reader_server.py # JSON 读取服务 +│ ├── mcp_settings.json # MCP 配置文件 +│ └── tools/ # 工具定义文件 ├── models/ # 模型文件 ├── projects/ # 项目目录 ├── queue_data/ # 队列数据 ├── public/ # 静态文件 +├── embedding/ # 嵌入模型模块 +├── prompt/ # 系统提示词 ├── db_manager.py # 数据库管理工具 ├── requirements.txt # 依赖列表 ├── pyproject.toml # Poetry 配置 @@ -393,6 +415,13 @@ qwen-agent/ - Poly 通信设备 - HyperX 游戏配件 +### MCP 工具支持 +系统集成了以下 MCP 工具: +- **语义搜索工具** - 基于句子嵌入的语义相似度搜索 +- **多关键词搜索工具** - 支持多字段、多条件的组合搜索 +- **Excel/CSV 操作工具** - 读取、搜索、分析 Excel 和 CSV 文件 +- **JSON 读取工具** - 解析和查询 JSON 格式数据 + --- ## 🤝 贡献指南 @@ -443,8 +472,13 @@ qwen-agent/ 4. **测试接口** ```bash - # 运行测试脚本 - poetry run python test_simple_task.py + # 测试聊天接口 + curl -X POST "http://localhost:8001/api/v1/chat/completions" \ + -H "Content-Type: application/json" \ + -d '{"messages": [{"role": "user", "content": "你好"}], "model": "qwen3-next"}' + + # 测试任务状态查询 + curl "http://localhost:8001/api/v1/tasks/statistics" ``` -现在您可以开始使用 Qwen Agent 进行智能数据检索了!🚀 \ No newline at end of file +现在您可以开始使用 Catalog Agent 进行智能数据检索了!🚀