Files
gangyan/README.md

95 lines
3.5 KiB
Markdown
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.

# 钢研院智能问答平台gangyan
面向冶金行业的 LLM 智能问答系统,提供智能对话、文档撰写、知识库管理、文献检索、翻译等功能。
## 系统架构
```
Vue前端(:3000/metalinfo)
│ proxy /chat_web_backend
Java后端(:8099/chat_web_backend) ──→ Python RAG(:7861)
│ │
├── MySQL(:33306) ├── Milvus(:19530)
├── Redis(:6379) ├── Embedding API(bge-m3)
└── 科协SSO └── LLM API(deepseek-v3等)
```
## 模块说明
| 模块 | 路径 | 技术栈 | 说明 |
|------|------|--------|------|
| 前端 | `chat_web_front/` | Vue 3 + TypeScript + Element Plus + Vite | 用户界面 |
| Java 后端 | `chat_web_backend/` | Spring Boot 2.3.7 + MyBatis-Plus + JDK 11 | 业务 API |
| Python RAG | `langchain-chat/` | Python 3.11 + FastAPI + LangChain | LLM 推理 + 知识库检索 |
## 功能模块
- **智能对话** — 多模型对话DeepSeek、Qwen 等),支持流式响应、知识库增强问答
- **文档撰写** — AI 生成大纲与正文,支持改写、润色、扩写、续写
- **知识库管理** — 个人知识库,文件上传、文章综述、章节速览、文件对话
- **文献检索** — 政策库、报告库、期刊论文库、冶金行业系列知识库
- **翻译** — 文档翻译、文本翻译,多语种支持
- **应用广场** — 智慧场景、助手收藏
## 基础设施
| 服务 | 端口 | 部署方式 |
|------|------|----------|
| MySQL 8.4.4 | 33306 | Docker Compose (`mysql/docker-compose.yml`) |
| Redis | 6379 | 宿主机 / Docker |
| Milvus 2.6.4 | 19530 | Docker Compose (`milvus/docker-compose.yml`) |
| MinIO | 9002/9003 | DockerMilvus 依赖) |
## 快速启动
```bash
cd /opt/download/oss_files/gangyan-deploy/gangyan
# 1. 启动数据层
cd mysql/mysql-8.4.4 && docker compose up -d && cd ../..
docker start redis-server 2>/dev/null || docker run -d --name redis-server -p 6379:6379 redis:7-alpine
cd milvus && docker compose up -d && cd ..
# 2. 启动 Java 后端
sudo bash backend/start_local.sh
# 3. 启动 Python RAG
source /opt/software/miniconda3/etc/profile.d/conda.sh && conda activate langchain-chat
cd langchain-chat && nohup python startup.py --all-api > langchain.log 2>&1 &
# 4. 启动前端
cd chat_web_front && npm run dev
```
或一键启动:`bash start_all.sh`
## 健康检查
```bash
curl -s -o /dev/null -w "Java %{http_code}\n" http://127.0.0.1:8099/chat_web_backend/app/user
curl -s -o /dev/null -w "Langchain %{http_code}\n" http://127.0.0.1:7861/docs
curl -s -o /dev/null -w "Frontend %{http_code}\n" http://127.0.0.1:3000/
```
## 项目结构
```
gangyan/
├── chat_web_front/ # Vue 3 前端
├── chat_web_backend/ # Java Spring Boot 后端
├── langchain-chat/ # Python RAG 服务
├── backend/ # 后端部署jar + 启动脚本)
├── mysql/ # MySQL Docker Compose + 数据
├── milvus/ # Milvus Docker Compose + 数据
├── scripts/ # 各服务运维脚本
├── docs/ # 项目文档
├── logs/ # 运行日志
├── .harness/ # Agent 协同开发上下文
└── start_all.sh # 一键启动脚本
```
## Agent 协同开发
`.harness/` 目录包含 Agent 协同开发所需的项目上下文文件,详见 [.harness/CLAUDE.md](.harness/CLAUDE.md)。