SAG: 查询时动态超边的SQL检索增强生成
SAG: SQL-Retrieval Augmented Generation with Query-Time Dynamic Hyperedges
- Zleap AI
机构由 AI 辅助整理,请以论文原文为准。
AI总结:
提出SAG架构,通过SQL查询动态构建局部超边索引,避免全局图维护,在多跳推理基准上达到最优召回率,支持亿级数据生产部署。
AI中文摘要:
检索增强生成(RAG)为大语言模型访问外部知识提供了一种有效方法。然而,现有方法依赖密集相似性检索,在处理结构化约束和多跳推理方面存在固有限制。引入知识图谱可部分缓解这些问题,但代价是语义碎片化、高维护成本和难以增量更新。本文介绍了SAG(SQL检索增强生成),一种用于检索和代理系统的结构化架构。SAG不预先构建全局静态图,而是将每个块转换为一个语义完整的事件和一组索引实体,然后使用SQL连接查询动态地将共享实体的事件链接到局部超边中,在查询时构建动态实例化的局部索引结构。这种设计避免了全局图重建和持续维护的需要;该系统通过依赖标准数据库基础设施,自然支持增量写入、并发处理和持续扩展。在HotpotQA、2WikiMultiHop和MuSiQue这三个标准多跳基准上,SAG在9个Recall@K指标中的8个上取得了最佳结果,在MuSiQue(多跳推理需求最高的基准)上达到80.0%的Recall@5。SAG还已在数亿数据项的生产规模上部署,在线检索延迟保持在秒级。项目网站和代码见https://github.com/Zleap-AI/SAG-Benchmark。
英文摘要:
While retrieval-augmented generation (RAG) has proven effective at giving LLMs access to external knowledge, mainstream dense-retrieval implementations remain inherently limited in handling structured constraints and multi-hop reasoning. Graph-based methods address this by constructing knowledge graphs offline, but they often fragment semantics, incur high maintenance, and complicate incremental updates. We propose SAG (SQL-Retrieval Augmented Generation), a structured retrieval architecture that organizes documents into an event-entity index without building a global knowledge graph. SAG represents each chunk as a semantically complete event paired with its entities, forming a latent hyperedge that preserves n-ary relations without decomposing them into triples. At query time, SAG treats shared entities as join keys to connect related chunks. This dynamically yields a query-scoped neighborhood of events, and yet every piece of evidence remains the original chunk throughout. Experiments on HotpotQA, 2WikiMultiHopQA, and MuSiQue show that SAG achieves the best retrieval and end-to-end QA performance on every benchmark, with gains that widen as reasoning-chain complexity increases. On MuSiQue, where multi-hop evidence chaining is most demanding, SAG reaches 80.36% Recall@5, outperforming the strongest baseline by 11.52 points. This work paves the way for knowledge infrastructure that enables LLM agents to retrieve and reason over continually growing organizational knowledge.