SAG

Find the evidence an agent needs across documents.

First page of SAG: SQL-Retrieval Augmented Generation with Query-Time Dynamic Hyperedges
arXiv:2606.15971v2

Find the facts an answer needs, across documents

An answer may depend on facts spread across several documents. SAG records each passage's events and the people, companies and projects involved. At query time, it follows those connections to retrieve the supporting text.

Keep each event intact
Record what a passage says happened, along with the people, companies and projects it mentions.
Follow connections across documents
Find a project's lead, then use that person's name to find team information missing from the first search.
Return the original text
Give agents the passages needed to answer, and let users check each source.
90.07%Evidence found in the top fiveThree-benchmark mean · Recall@5
72.96Answer match scoreThree-benchmark mean · F1 (0–100)
+11.52MuSiQue recall gainPoints vs strongest paper baseline

Results from the papers. Benchmarks, metrics and test conditions are explained below.

01 / HOW IT WORKS

Extract events and entities, then query their connections

SAG prepares separate event and entity records from each source passage, then stores their associations. A question activates shared-entity joins, and results map back to the original text.

EVENT–ENTITY ASSOCIATIONS1 / 6
Which team does Project Aurora's lead belong to?
PREPARATION

Source → parallel event and entity extraction → associations

Events and entities are two outputs extracted from the same source
SOURCE A · project.md · passage 3

Friday's review began with development progress on Aurora Enterprise. Only internal trials are complete, and single sign-on integration is still unfinished, so the product cannot be released publicly yet. The original May launch must therefore change. The meeting agreed to move the release to June, conditional on completing single sign-on integration and passing the security review. Lin Ran owns this release and coordinates testing, acceptance and launch arrangements. Zhou Ning remains responsible for performance testing and does not make release decisions. External notices will be sent after acceptance. The April demo was for internal use only and did not constitute a public release.

LLM extracts both from the source
EVENT

Waiting to extract the complete event

Keep roles, schedule changes and conditions together for retrieval judgments
ENTITIES

Waiting to extract source entities

Extract from the source to index events and connect passages mentioning the same entities

Event A ↔ Aurora Enterprise, Lin Ran, Zhou Ning, April, May, June, single sign-on, security acceptance

One source passage maps to one complete event, associated with the entities extracted from that source

Keep the source passages

The source mixes progress, a delay, two people's roles and several dates. Retain the passage and its location so answers can be checked against it.

A fictional example illustrating the retrieval process. Select any step to inspect it; autoplay stops after one pass.

VIDEO / SAG

SAG explained

Follow SAG from event and entity extraction to retrieving connected evidence across documents.

Video and resources on GitHub
Play on demand · Full screen available

02 / BENCHMARKS

Find more evidence and give better answers

Recall@5 measures how much required evidence appears in the first five results. F1 measures how closely the answer matches the reference. Switch benchmarks to compare retrieval and answers separately.

MuSiQueRecall@5 · Higher is better

+11.52 points vs NV-Embed-v2

SAG
80.36%
NV-Embed-v2
68.84%
GritLM-7B
66.22%
HippoRAG 2
65.13%
GTE-Qwen2-7B
61.92%
BGE-Large-EN-v1.5
56.32%
Contriever
45.32%
BM25
42.11%

1,000 development questions per benchmark. All methods use Qwen3.6-Flash to answer; structure-augmented methods use BGE-Large-EN-v1.5 for retrieval. Methods with no reported Recall are omitted from that chart.

Full benchmark dataRecall@5
SAG paper · Recall@5 (%)
MethodMuSiQue2WikiMultiHopQAHotpotQA
BM2542.1163.7873.05
Contriever45.3259.2574.85
BGE-Large-EN-v1.556.3269.8389.20
GTE-Qwen2-7B61.9274.1888.45
GritLM-7B66.2275.6293.40
NV-Embed-v268.8477.0095.25
GraphRAG———
LightRAG———
HyperGraphRAG———
HyperRAG———
HippoRAG 265.1390.3594.35
SAG80.3693.3496.50
Source: paper, Table 1

03 / ABLATION STUDY

The design choices that help find more evidence

Change one step at a time under the same test conditions and measure how much evidence is lost. These comparisons are called ablations.

MuSiQue · Recall@5

Full SAG80.36%
Triple indexing77.61%
No expansion69.41%
Pointwise reranker67.11%
+10.95 points

Follow connections to recover missing facts

Searching for the same person or project adds facts missed by the first retrieval. This raises Recall@5 from 69.41% to 80.36%.

+13.25 points

Judge the passages together

Each passage may supply only part of an answer. Considering them together helps select the combination needed, rather than scoring each passage alone.

Source: Table 6 and §5.2

04 / ARCHITECTURE

Keep the full event and its connections

01 / DATA STRUCTURE

Two records from the same passage

Source passageKeep the text and its source
EventMeaning, relations and conditions
EntitiesPeople, companies and projects

Events preserve meaning; entities support indexing and expansion. Both come from the same passage and are then linked.

02

One person can connect several documents

An event linked to several entities forms a hyperedge. At query time, shared names connect it to other events relevant to the question.

Find connections at query time without a prebuilt global knowledge graph
03

Keep adding new documents

Process new documents passage by passage and append their records. Combine direct retrieval with connected events, then return the original sources.

Process additions passage by passage and retain source references

05 / DEPLOYMENT

Deployment and use

Reproduction and configuration

Preparation

Use models to summarize events, extract entities and generate embeddings. Process new documents and append their records.

Use cases

Knowledge bases and agents that need facts across documents. Retrieve connected events, then return their original sources.

Limitations

Manage entity aliases and update stale events separately. The current implementation does not do this automatically.

06 / PERSONAL APPLICATION

SAG

Turn personal files into a local knowledge base for search, cited answers and agent access. Check an answer against its cited sources.

  1. Add personal files

    Organize material in a local knowledge base

    01
  2. Search or ask

    Find relevant content, also accessible to agents

    02
  3. Check the source

    Follow result links and answer citations to the text

    03