This project constructs a dual‑retrieval‑driven RAG dialogue system of "structured knowledge graph + unstructured document repository". | 本项目构建了 “结构化知识图谱 + 非结构化文档库” 双检索驱动的 RAG 对话系统。
Python
2
26 commits
updated Sep 6, 2026
![]() | ![]() | ![]() |
| 问答(有 RAG) | 问答(无 RAG) | 知识图谱可视化 |
本项目提出一种"结构化知识图谱 + 非结构化文档库"双检索驱动的 RAG 对话系统,核心目标是解决大模型在事实性问答中的幻觉问题。系统以知识图谱和文档库为双重外部知识源,通过 Adaptive-RAG 智能路由、Self-RAG 结果评估和 CoT 思维链推理,将精准事实证据动态注入 ChatGLM-6B,实现有依据、可追溯、高准确的智能对话。
| 层 | 技术 |
|---|---|
| 后端 | Python · Flask · PyTorch · Transformers (ChatGLM-6B) · PaddleNLP (UIE) · ChromaDB |
| 前端 | Vue 3 · Ant Design Vue · ECharts · D3.js · Vite |
conda create -n KnowledgeGraph-RAG python=3.11
conda activate KnowledgeGraph-RAG
pip install -r requirements.txt
cd frontend && npm install && cd ..
python main.py --project project_v1 --gpu 0
# 从检查点恢复: python main.py --project project_v1 --resume data/project_v1/history/xxx.json --gpu 0
# 后端 (默认 http://localhost:5000)
cd backend && python main.py
# 前端开发服务器 (另开终端)
cd frontend && npm run server
KnowledgeGraph-RAG/
├── main.py # 主入口:知识图谱构建流程
├── config/settings.py # 项目配置
├── backend/
│ ├── main.py # 后端服务入口
│ └── app/
│ ├── rag/ # RAG 核心 (路由 → 检索 → 评估 → CoT → 引用)
│ ├── search/ # 检索适配器 (向量库 / Wiki / 图像)
│ ├── model/chat_glm.py # ChatGLM 调用
│ ├── nlp/ner.py # 命名实体识别
│ └── kg/graph_utils.py # 知识图谱工具
├── modules/ # 知识图谱构建、模型训练
├── frontend/src/ # Vue 3 前端
├── models/ # 预训练模型权重
└── data/ # 原始数据与项目迭代数据
本项目仅供学习和研究使用。
This project constructs a dual‑retrieval‑driven RAG dialogue system of "structured knowledge graph + unstructured document repository". | 本项目构建了 “结构化知识图谱 + 非结构化文档库” 双检索驱动的 RAG 对话系统。
Python
2
26 commits
updated Sep 6, 2026
![]() | ![]() | ![]() |
| 问答(有 RAG) | 问答(无 RAG) | 知识图谱可视化 |
本项目提出一种"结构化知识图谱 + 非结构化文档库"双检索驱动的 RAG 对话系统,核心目标是解决大模型在事实性问答中的幻觉问题。系统以知识图谱和文档库为双重外部知识源,通过 Adaptive-RAG 智能路由、Self-RAG 结果评估和 CoT 思维链推理,将精准事实证据动态注入 ChatGLM-6B,实现有依据、可追溯、高准确的智能对话。
| 层 | 技术 |
|---|---|
| 后端 | Python · Flask · PyTorch · Transformers (ChatGLM-6B) · PaddleNLP (UIE) · ChromaDB |
| 前端 | Vue 3 · Ant Design Vue · ECharts · D3.js · Vite |
conda create -n KnowledgeGraph-RAG python=3.11
conda activate KnowledgeGraph-RAG
pip install -r requirements.txt
cd frontend && npm install && cd ..
python main.py --project project_v1 --gpu 0
# 从检查点恢复: python main.py --project project_v1 --resume data/project_v1/history/xxx.json --gpu 0
# 后端 (默认 http://localhost:5000)
cd backend && python main.py
# 前端开发服务器 (另开终端)
cd frontend && npm run server
KnowledgeGraph-RAG/
├── main.py # 主入口:知识图谱构建流程
├── config/settings.py # 项目配置
├── backend/
│ ├── main.py # 后端服务入口
│ └── app/
│ ├── rag/ # RAG 核心 (路由 → 检索 → 评估 → CoT → 引用)
│ ├── search/ # 检索适配器 (向量库 / Wiki / 图像)
│ ├── model/chat_glm.py # ChatGLM 调用
│ ├── nlp/ner.py # 命名实体识别
│ └── kg/graph_utils.py # 知识图谱工具
├── modules/ # 知识图谱构建、模型训练
├── frontend/src/ # Vue 3 前端
├── models/ # 预训练模型权重
└── data/ # 原始数据与项目迭代数据
本项目仅供学习和研究使用。