{"id":17626485,"url":"https://github.com/xerrors/yuxi-know","last_synced_at":"2025-05-15T04:04:25.716Z","repository":{"id":258516836,"uuid":"824541776","full_name":"xerrors/Yuxi-Know","owner":"xerrors","description":"基于智能体 RAG 知识库的知识图谱问答系统。Langgraph + VueJS + Flask + Neo4j。大模型适配 OpenAI、Ollama、vLLM、国内主流大模型平台的模型调用。支持推理模型DeepSeek-R1、联网检索、工具调用。","archived":false,"fork":false,"pushed_at":"2025-05-13T11:50:00.000Z","size":26685,"stargazers_count":1347,"open_issues_count":21,"forks_count":122,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-05-15T04:04:09.739Z","etag":null,"topics":["docker","flask","kbqa","kgqa","llms","neo4j","rag","vue"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xerrors.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-05T10:57:35.000Z","updated_at":"2025-05-15T03:54:27.000Z","dependencies_parsed_at":"2024-10-19T11:20:49.568Z","dependency_job_id":"c728858c-c810-4c08-b7e1-2d59abc3e1ae","html_url":"https://github.com/xerrors/Yuxi-Know","commit_stats":null,"previous_names":["xerrors/yuxi-know"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xerrors%2FYuxi-Know","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xerrors%2FYuxi-Know/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xerrors%2FYuxi-Know/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xerrors%2FYuxi-Know/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xerrors","download_url":"https://codeload.github.com/xerrors/Yuxi-Know/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270641,"owners_count":22042858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","flask","kbqa","kgqa","llms","neo4j","rag","vue"],"created_at":"2024-10-22T23:05:35.869Z","updated_at":"2025-05-15T04:04:25.693Z","avatar_url":"https://github.com/xerrors.png","language":"Vue","funding_links":[],"categories":["Langchain"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e语析 - 基于大模型的知识库与知识图谱问答系统\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n\n![](https://img.shields.io/badge/Docker-2496ED?style=flat\u0026logo=docker\u0026logoColor=ffffff)\n![Vue.js](https://img.shields.io/badge/vuejs-%2335495e.svg?style=flat\u0026logo=vuedotjs\u0026logoColor=%234FC08D)\n![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=flat\u0026logo=fastapi)\n![](https://img.shields.io/github/issues/xerrors/Yuxi-Know?color=F48D73)\n![](https://img.shields.io/github/license/bitcookies/winrar-keygen.svg?logo=github)\n![](https://img.shields.io/github/stars/xerrors/Yuxi-Know)\n\n\u003c/div\u003e\n\n## 📝 项目概述\n\n语析是一个强大的问答平台，结合了大模型 RAG 知识库与知识图谱技术，基于 Llamaindex + VueJS + FastAPI + Neo4j 构建。\n\n**核心特点：**\n\n- 🤖 多模型支持：适配 OpenAI、各大国内主流大模型平台，以及本地 vllm、ollama 部署\n- 📚 灵活知识库：支持 PDF、TXT、MD 等多种格式文档\n- 🕸️ 知识图谱集成：基于 Neo4j 的知识图谱问答能力\n- 🚀 简单配置：只需配置对应服务平台的 `API_KEY` 即可使用\n- 🤖 智能体拓展：可以编写自己的智能体代码（Dev过程，非正式版）\n- ⚒️ 适合二次开发：更多的开发自定义项\n\n![系统界面预览](https://github.com/user-attachments/assets/75010511-4ac5-4924-8268-fea9a589839c)\n\n## 📋 更新日志\n\n- **2025.03.30** - 系统中集成智能体（WIP， [PR#96](https://github.com/xerrors/Yuxi-Know/pull/96)）\n- **2025.02.24** - 新增网页检索以及内容展示，需配置 `TAVILY_API_KEY`，感谢 [littlewwwhite](https://github.com/littlewwwhite)\n- **2025.02.23** - SiliconFlow 的 Rerank 和 Embedding model 支持，现默认使用 SiliconFlow\n- **2025.02.20** - DeepSeek-R1 支持，需配置 `DEEPSEEK_API_KEY` 或 `SILICONFLOW_API_KEY`\n- **2024.10.12** - 后端修改为 [FastAPI](https://github.com/fastapi)，添加 [Milvus-Standalone](https://github.com/milvus-io) 独立部署\n\n![功能展示](https://github.com/user-attachments/assets/8416a933-cc43-45d0-bf06-00df0ba6c4fb)\n\n| PC 网页                                                                                 | 小屏设备                                                                                |\n| :-------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- |\n| ![image](https://github.com/user-attachments/assets/5f3d7e69-baa8-4c59-90fc-391343e59af6) | ![image](https://github.com/user-attachments/assets/51efabce-a097-47fd-9fca-d3b0943af86a) |\n\n### 环境配置\n\n在启动前，您需要提供 API 服务商的 API_KEY，并放置在 `src/.env` 文件中（此文件项目中没有，需要自行参考 [src/.env.template](src/.env.template) 创建）。更多可配置项，可参考 后面**对话模型**部分。\n\n默认使用硅基流动的服务，因此**必须**配置：\n\n```\nSILICONFLOW_API_KEY=sk-270ea********8bfa97.e3XOMd****Q1Sk\nOPENAI_API_KEY=\u003cAPI_KEY\u003e # 如果需要配置 openai 则添加此行，并替换 API_KEY\nDEEPSEEK_API_KEY=\u003cAPI_KEY\u003e  # 如果配置 DeepSeek 添加此行，并替换 API_KEY\nZHIPUAI_API_KEY=\u003cAPI_KEY\u003e  # 如果配置 智谱清言 添加此行，并替换 API_KEY\n```\n\n需要确保账户有一点点额度供调用，或使用这个链接注册[SiliconFlow 注册（含邀请码）](https://cloud.siliconflow.cn/i/Eo5yTHGJ)获得 14 元的赠送额度。\n\n\u003e 本项目的基础对话服务可在不含显卡的设备上运行，大模型使用在线服务商的接口。\n\n### 启动服务\n\n**开发环境启动**（源代码修改会自动更新）：\n\n```bash\ndocker compose -f docker/docker-compose.dev.yml --env-file src/.env up --build\n```\n\n\u003e 添加 `-d` 参数可在后台运行\n\n\n成功启动后，会看到以下容器：\n\n```\n[+] Running 7/7\n ✔ Network docker_app-network       Created\n ✔ Container graph-dev              Started\n ✔ Container milvus-etcd-dev        Started\n ✔ Container milvus-minio-dev       Started\n ✔ Container milvus-standalone-dev  Started\n ✔ Container api-dev                Started\n ✔ Container web-dev                Started\n```\n\n访问 [http://localhost:5173/](http://localhost:5173/) 即可使用系统。\n\n### 系统预览\n\n![系统演示](./images/demo.gif)\n\n问答支持 Deepseek-R1 等推理模型、知识图谱检索、知识库检索、网页检索\n\n![Image](https://github.com/user-attachments/assets/97ad6771-e4a2-4324-a001-ecb0abe40fdd)\n\n网页检索结果：\n\n![Image](https://github.com/user-attachments/assets/20d51700-78d5-48a8-ab16-00bc98a1df37)\n\n知识图谱检索结果：\n\n![Image](https://github.com/user-attachments/assets/61b4e06f-4e6e-4a75-bfcb-b1a424523bb6)\n\n知识库检索结果\n\n![Image](https://github.com/user-attachments/assets/53e786f4-08d7-45c1-bcec-df46d0c3c49b)\n\n知识库管理：\n\n\n![Image](https://github.com/user-attachments/assets/55a6de55-59a0-4636-9c00-e4bfd6573c1b)\n\n![Image](https://github.com/user-attachments/assets/0f4f39ba-e6b7-4f18-a3c3-147477922f58)\n\n\n知识图谱\n\n![Image](https://github.com/user-attachments/assets/5849d875-801c-4d29-9d38-9245685e9d73)\n\n可视化配置：\n\n![Image](https://github.com/user-attachments/assets/5faac8bc-7968-42d0-a77d-5f8881a24de1)\n\n丰富的模型支持：\n\n![Image](https://github.com/user-attachments/assets/7a54ca07-78da-4aef-b0a0-47aa539dae8e)\n\n\n### 服务管理\n\n**关闭服务**：\n\n```bash\ndocker compose -f docker/docker-compose.dev.yml --env-file src/.env down\n```\n\n**查看日志**：\n\n```bash\ndocker logs \u003c容器名称\u003e  # 例如：docker logs api-dev\n```\n\n## 💻 模型支持\n\n### 1. 对话模型\n\n本项目支持通过 API 调用的模型，本地模型需使用 vllm、ollama 转成 API 服务后使用。\n\n| 模型供应商             | 默认模型                            | 配置项目                                       |\n| :--------------------- | :---------------------------------- | :--------------------------------------------- |\n| `siliconflow` (默认) | `Qwen/Qwen2.5-7B-Instruct` (免费) | `SILICONFLOW_API_KEY`                        |\n| `openai`             | `gpt-4o`                          | `OPENAI_API_KEY`                             |\n| `deepseek`           | `deepseek-chat`                   | `DEEPSEEK_API_KEY`                           |\n| `arc`（豆包方舟）    | `doubao-1-5-pro-32k-250115`       | `ARK_API_KEY`                                |\n| `zhipu`（智谱清言）  | `glm-4-flash`                     | `ZHIPUAI_API_KEY`                            |\n| `dashscope`（阿里）  | `qwen-max-latest`                 | `DASHSCOPE_API_KEY`                          |\n\n#### 添加新模型供应商\n\n如需添加供应商模型，了解 OpenAI 调用方法后，只需在 [src/static/models.yaml](src/static/models.yaml) 中添加对应配置：\n\n```yaml\nark:\n  name: 豆包（Ark）\n  url: https://console.volcengine.com/ark/region:ark+cn-beijing/model # 模型列表\n  default: doubao-1-5-pro-32k-250115 # 默认模型\n  base_url: https://ark.cn-beijing.volces.com/api/v3\n  env:  # 需要配置的环境变量，仅限API key\n    - ARK_API_KEY\n  models:\n    - doubao-1-5-pro-32k-250115\n    - doubao-1-5-lite-32k-250115\n    - deepseek-r1-250120\n```\n\n#### 本地模型部署\n\n支持添加以 OpenAI 兼容模式运行的本地模型，可在 Web 设置中直接添加（适用于 vllm 和 Ollama 等）。\n\n\u003e [!注意]\n\u003e 使用 docker 运行此项目时，ollama 或 vllm 需监听 `0.0.0.0`\n\n![本地模型配置](./images/custom_models.png)\n\n### 2. 向量模型与重排序模型\n\n建议使用硅基流动部署的 bge-m3（免费且无需修改）。其他模型配置参考 [src/static/models.yaml](src/static/models.yaml)。\n\n对于**向量模型**和**重排序模型**，选择 `local` 前缀的模型会自动下载。如遇下载问题，请参考 [HF-Mirror](https://hf-mirror.com/) 配置。\n\n要使用已下载的本地模型，可在 models.yaml 或者网页设置中映射。\n\n![image](https://github.com/user-attachments/assets/ab62ea17-c7d0-4f94-84af-c4bab26865ad)\n\n\n**添加向量模型**\n\n```yaml\n# src/static/models.yaml\n  # 添加本地向量模型（所有 FlagEmbedding 支持的模型）\n  local/BAAI/bge-m3:\n    name: BAAI/bge-m3\n    dimension: 1024\n    # local_path: /models/BAAI/bge-m3，也可以在这里配置\n\n  # 添加 OpenAI 兼容的向量模型\n  siliconflow/BAAI/bge-m3:\n    name: BAAI/bge-m3\n    dimension: 1024\n    url: https://api.siliconflow.cn/v1/embeddings\n    api_key: SILICONFLOW_API_KEY\n\n  # 添加 Ollama 模型\n  ollama/nomic-embed-text:\n    name: nomic-embed-text\n    dimension: 768\n```\n\n## 📚 知识库支持\n\n本项目支持多种格式的知识库文件：\n\n- PDF\n- Txt\n- Markdown\n- Docx\n\n文件上传后，系统会：\n\n1. 将文件转换为纯文本\n2. 使用向量模型将文本转换为向量\n3. 存储到向量数据库中\n\n\u003e 此过程可能需要一定时间，请耐心等待。\n\n## 🕸️ 知识图谱支持\n\n本项目使用 Neo4j 作为知识图谱存储。您需要将图谱整理成 jsonl 格式，每行格式为：\n\n```\n{\"h\": \"北京\", \"t\": \"中国\", \"r\": \"首都\"}\n```\n\n然后在网页的图谱管理中添加此文件。\n\n\u003e [!说明]\n\u003e 现阶段项目使用的 OneKE 自动创建知识图谱效果不佳，已暂时移除，建议在项目外创建知识图谱\n\n系统启动后会自动启动 neo4j 服务：\n\n- 访问地址：[http://localhost:7474/](http://localhost:7474/)\n- 默认账户：`neo4j`\n- 默认密码：`0123456789`\n\n可在 `docker/docker-compose.yml` 和 `docker/docker-compose.dev.yml` 中修改配置（注意同时修改 `api.environment` 和 `graph.environment`）。\n\n目前项目暂不支持同时查询多个知识图谱。如已有基于 neo4j 的知识图谱，可删除 `docker-compose.yml` 中的 `graph` 配置项，并修改 `api.environment` 中的 `NEO4J_URI` 为您的 neo4j 服务地址。同时，需要确保节点的标签中包含 Entity 标签，才能正常触发索引。\n\n## 贡献者名单\n\n感谢以下贡献者的支持！\n\n\u003ca href=\"https://github.com/xerrors/Yuxi-Know/contributors\"\u003e\n    \u003cimg src=\"https://contributors.nn.ci/api?repo=xerrors/Yuxi-Know\" alt=\"贡献者名单\"\u003e\n\u003c/a\u003e\n\n## ❓ 常见问题\n\n### 镜像下载问题\n\n如无法直接下载相关镜像，可参考 [DaoCloud/public-image-mirror](https://github.com/DaoCloud/public-image-mirror?tab=readme-ov-file#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)，尝试替换前缀：\n\n```bash\n# 以 neo4j 为例，其余类似\ndocker pull m.daocloud.io/docker.io/library/neo4j:latest\n\n# 然后重命名镜像\ndocker tag m.daocloud.io/docker.io/library/neo4j:latest neo4j:latest\n```\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=xerrors/Yuxi-Know)](https://star-history.com/#xerrors/Yuxi-Know)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxerrors%2Fyuxi-know","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxerrors%2Fyuxi-know","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxerrors%2Fyuxi-know/lists"}