SAG: The New State-of-the-Art for RAG Knowledge Bases
Discover SAG — the original retrieval architecture that replaces both traditional RAG and GraphRAG. Learn about its event-entity indexing, query-time dynamic hyperedges, and state-of-the-art performance across multi-hop QA benchmarks.
What is SAG?
SAG (SQL-Retrieval Augmented Generation) is not just another RAG wrapper — it's an original retrieval architecture that replaces both traditional dense RAG and GraphRAG with a single, unified system. Developed by Zleap AI, SAG introduces a novel approach based on event-entity indexing and query-time dynamic hyperedges, delivering both semantic retrieval and relational reasoning without maintaining two separate pipelines.
With 2259+ GitHub stars and a published paper on arXiv, SAG has quickly established itself as a new state of the art for knowledge retrieval. It achieves the best results on 8 of 9 Recall@1/2/5 metrics across HotpotQA, 2WikiMultiHopQA, and MuSiQue — outperforming HippoRAG 2 and other leading approaches.
🚀 Want to deploy SAG yourself?
Docker configs, system requirements, and installation guides — all on one page.
View SAG Tool Page →Why SAG Changes the RAG Landscape
Traditional RAG retrieves chunks mainly by semantic similarity — it's fast but misses relational connections. GraphRAG adds offline graph construction with triple extraction, entity merging, and global maintenance — but it's slow, difficult to update incrementally, and computationally expensive.
SAG introduces a third architecture that combines the best of both worlds:
| Feature | Traditional RAG | GraphRAG | SAG |
|---|---|---|---|
| Retrieval | Semantic only | Graph traversal | Both semantic + relational |
| Incremental updates | ✓ Natural | ✗ Expensive | ✓ Natural |
| Source tracing | Partial | Complex | ✓ Full |
| Avg Recall@5 | ~78% | ~83% | 88.18% |
Architecture Deep Dive
SAG's pipeline works in two phases:
Offline Indexing: Documents are parsed into semantically coherent chunks. For each chunk, SAG extracts one event (carrying the complete meaning) and multiple entities (lightweight indexes). These are persisted to relational storage alongside vector representations — no triple extraction, no entity merging, no global graph maintenance.
Online Retrieval: When a query arrives, SAG finds seed entities and events using semantic and lexical signals. SQL joins over shared entities expand from seed events into a local candidate space. Query-time dynamic hyperedges are created locally — SAG does not pre-build or globally maintain hyperedges. The strongest candidates are selected, deduplicated, and returned with direct links to the original source chunks.
Key Capabilities
- Knowledge Ingestion: Upload files or web sources — SAG handles parsing, chunking, embedding, and event/entity extraction.
- Hybrid Search: Fast (vector) and Precise (multi) retrieval modes for different accuracy/latency trade-offs.
- Source Tracing: Every result and citation links back to the exact original document chunk.
- Knowledge Graph: Inspect events, entities, and their queryable associations.
- Agent Chat: Multi-turn conversations grounded in selected sources with clickable citations.
- Multiple Integrations: REST/OpenAPI, OpenAI-compatible chat, MCP protocol, and the zleap-sag Python package.
🚀 Want to deploy SAG yourself?
Docker configs, system requirements, and installation guides — all on one page.
View SAG Tool Page →