Files
rag/requirements.txt
lacerate551 100d1a06eb init: RAG 知识库服务初始提交
- 后端 API(Flask + Gunicorn)
- RAG 引擎(混合检索 + 云端 Reranker + 引用溯源)
- 文档解析(MinerU + 多格式支持)
- Docker 生产部署配置
- 排除前端项目、敏感配置、模型文件
2026-06-04 17:35:27 +08:00

65 lines
2.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# RAG 服务依赖库
# 安装命令: pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
#
# ==================== 环境说明 ====================
# 生产环境:通过后端网关注入认证,提供 API 服务
# 开发环境本地模拟用户支持个人知识库使用DEV_MODE=true
#
# ==================== 部署注意事项 ====================
# 1. 服务器无 GPU使用 CPU 版本 PyTorch
# 2. 首次部署需单独安装 PyTorch CPU 版:
# pip install torch --index-url https://download.pytorch.org/whl/cpu
# 3. 开发前端dev-ui/)依赖 Node.js需单独安装
# cd dev-ui && npm install
# ==================== PyTorch (CPU) ====================
# 注意PyTorch 需要单独安装 CPU 版本,此处不固定版本
# pip install torch --index-url https://download.pytorch.org/whl/cpu
# ==================== 核心依赖 ====================
chromadb>=0.4.0 # 向量数据库
sentence-transformers>=2.2.0 # 向量嵌入模型
openai>=1.0.0 # LLM API 客户端
numpy>=1.24.0 # 数值计算
# ==================== Web 服务 ====================
flask>=2.0.0 # Web 框架
flask-cors>=4.0.0 # CORS 支持
werkzeug>=2.0.0 # WSGI 工具
python-dotenv>=1.0.0 # 环境变量管理
# ==================== 检索相关 ====================
rank-bm25>=0.2.2 # BM25 关键词检索
jieba>=0.42.1 # 中文分词
# ==================== Rerank 加速 ====================
optimum[onnxruntime]>=1.14.0 # ONNX Runtime 优化CPU 推理 2-3x 提速)
# ==================== 文档解析 ====================
# PDF/DOCX/PPTX 解析 - MinerU (主要)
mineru>=3.0.0 # 文档解析核心PDF/Word/PPT/图片)
# Excel 解析
pandas>=2.0.0 # 数据处理
openpyxl>=3.1.0 # Excel 文件读取
# Word/PDF 备用解析
pdfplumber>=0.10.0 # PDF 解析(备用)
python-docx>=0.8.11 # Word 解析(备用)
# ==================== 文本分块 ====================
langchain-text-splitters>=0.3.0 # 语义分块器
# ==================== 文件监控 ====================
watchdog>=3.0.0 # 文件变更监控sync 服务)
# ==================== 图谱功能(可选) ====================
# Neo4j 图数据库 - 仅启用图谱功能时需要
# neo4j>=5.0.0
# ==================== HTTP 请求 ====================
requests>=2.28.0 # HTTP 客户端
# ==================== 生产部署 ====================
gunicorn>=21.0.0 # WSGI 服务器Linux/Mac