返回顶部
热门问答 更多热门问答
技术文章 更多技术文章

RAG 进阶:新一代大模型知识服务框架 KAG

[复制链接]
链载Ai 显示全部楼层 发表于 昨天 17:03 |阅读模式 打印 上一主题 下一主题

ingFang SC";font-weight: bold;color: rgb(51, 51, 51);line-height: 22px;letter-spacing: 1px;">KAG 是什么

ingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">KAG(Knowledge Augmented Generation)是基于 OpenSPG 引擎和大型语言模型的逻辑推理问答框架,用于构建垂直领域知识库的逻辑推理问答解决方案。KAG 可以有效克服传统 RAG 向量相似度计算的歧义性和 OpenIE 引入的 GraphRAG 的噪声问题。KAG 支持逻辑推理、多跳事实问答等,并且明显优于目前的 SOTA 方法。

ingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">

ingFang SC";font-weight: bold;color: rgb(51, 51, 51);line-height: 22px;letter-spacing: 1px;">KAG 核心功能

ingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">LLM 友好的语义化知识管理

ingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">私域知识库场景,非结构化数据、结构化信息、业务专家经验 往往三者共存,KAG 提出了一种对大型语言模型(LLM)友好的知识表示框架,在 DIKW(数据、信息、知识和智慧)的层次结构基础上,将 SPG 升级为对 LLM 友好的版本,命名为 LLMFriSPG。

ingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">这使得它能够在同一知识类型(如实体类型、事件类型)上兼容无 schema 约束的信息提取和有 schema 约束的专业知识构建,并支持图结构与原始文本块之间的互索引表示。

ingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">这种互索引表示有助于基于图结构的倒排索引的构建,并促进了逻辑形式的统一表示、推理和检索。同时通过知识理解、语义对齐等进一步降低信息抽取的噪声,提升知识的准确率和一致性。


ingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">逻辑符号引导的混合推理引擎

ingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">KAG 提出了一种逻辑符号引导的混合求解和推理引擎。该引擎包括三种类型的运算符:规划、推理和检索,将自然语言问题转化为结合语言和符号的问题求解过程。

在这个过程中,每一步都可以利用不同的运算符,如精确匹配检索、文本检索、数值计算或语义推理,从而实现四种不同问题求解过程的集成:图谱推理、逻辑计算、Chunk 检索和 LLM 推理。


技术架构

KAG 框架包括 kg-builder、kg-solver、kag-model 三部分。本次发布只涉及前两部分,kag-model 将在后续逐步开源发布。

  • kg-builder: 负责知识表示和构建。它实现了一种对 LLM 友好的知识表示,基于 DIKW 层次结构升级 SPG 知识表示能力,兼容无模式和有模式的知识构建,并支持图结构和文本块的互索引表示,为后续推理问答阶段的高效检索提供支持。

  • kg-solver: 负责推理和求解。它采用逻辑形式引导的混合求解和推理引擎,包含规划、推理和检索三种运算符,能够集成检索、知识图谱推理、语言推理和数值计算四种问题求解过程,从而处理复杂的逻辑推理和问答任务。

  • kag-model: (未来逐步开源) 该部分的功能在当前版本中未详细说明,可能包含模型训练、优化或其他与模型相关的组件。


使用方法

推荐系统版本

macOSUser:macOSMonterey12.6orlaterLinuxUser:CentOS7/Ubuntu20.04orlaterWindowsUser:Windows10LTSC2021orlater

软件要求

macOS/LinuxUser:Docker,DockerComposeWindowsUser:WSL2/Hyper-V,Docker,DockerCompose

docker 镜像安装

使用以下命令下载 docker-compose.yml 文件并使用 Docker Compose 启动服务。

#setthe HOME environment variable (onlyWindows users needtoexecutethis command)#setHOME=%USERPROFILE%
curl-sSL https://raw.githubusercontent.com/OpenSPG/openspg/refs/heads/master/dev/release/docker-compose-west.yml-o docker-compose-west.ymldocker compose-f docker-compose-west.yml up-d

运行

浏览器运行http://127.0.0.1:8887


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

链载AI是专业的生成式人工智能教程平台。提供Stable Diffusion、Midjourney AI绘画教程,Suno AI音乐生成指南,以及Runway、Pika等AI视频制作与动画生成实战案例。从提示词编写到参数调整,手把手助您从入门到精通。
  • 官方手机版

  • 微信公众号

  • 商务合作

  • Powered by Discuz! X3.5 | Copyright © 2025-2025. | 链载Ai
  • 桂ICP备2024021734号 | 营业执照 | |广西笔趣文化传媒有限公司|| QQ