Docs/Project

Project

Paper and benchmarks

SAG's original architecture, query-time dynamic hyperedges, and public multi-hop results.
Updated 2026-07-22Applies to SAG v1.2.2

The SAG paper is titled SAG: SQL-Retrieval Augmented Generation with Query-Time Dynamic Hyperedges and was written by Yuchao Wu, Junqin Li, XingCheng Liang, Yongjie Chen, Yinghao Liang, Linyuan Mo, and Guanxian Li.

First page of the SAG paperFirst page of the SAG paper

An original third architecture

Traditional dense RAG retrieves chunks primarily by semantic similarity. GraphRAG extracts triples offline, merges entities, normalizes relationships, and maintains a global graph; incremental updates can require additional graph maintenance.

SAG replaces the combination of two systems with event-entity indexing and query-time dynamic hyperedges:

  • one chunk corresponds to one semantically complete event;
  • one chunk can contain multiple indexing entities;
  • SQL connects events that share entities around the current query;
  • only locally necessary hyperedges are instantiated;
  • final output still maps back to source chunks.

Public results

With the same BGE-Large-EN-v1.5 Embedding and Qwen3.6-Flash LLM configuration, SAG reports the best result in 8 of 9 Recall@1/2/5 metrics across HotpotQA, 2WikiMultiHopQA, and MuSiQue.

DatasetMethodRecall@1Recall@2Recall@5
HotpotQASAG47.80%91.55%96.50%
HotpotQAHippoRAG 244.40%78.35%94.35%
2WikiMultiHopQASAG43.53%82.30%88.00%
2WikiMultiHopQAHippoRAG 242.38%76.55%90.35%
MuSiQueSAG36.17%64.05%80.04%
MuSiQueHippoRAG 230.65%49.52%65.13%
AverageSAG42.50%79.30%88.18%
AverageHippoRAG 239.14%68.14%83.28%

Interpreting the metrics

Recall@k measures whether the target evidence appears within the top k results. Multi-hop questions often need multiple critical pieces of evidence in a very small candidate set, making Recall@2 and Recall@5 especially relevant to Agent context cost.

Read benchmark results together with the paper settings and reproduction scripts. Changes in models, preprocessing, indexing parameters, or evaluation code affect the numbers. Do not combine results from different settings as a direct comparison.

From paper to product

Beyond the research architecture, the public SAG application adds document parsing, background jobs, users and JWT, cited generation, MCP, an OpenAI-compatible API, desktop applications, and multiple production storage backends.

The paper explains the retrieval method. The product repository shows how that method becomes an operational, verifiable knowledge base.

Found an issue? Treat the public repository as the source of truth.View SAG source