Zleap-AI/SAG

A new SOTA for RAG — an original retrieval architecture and an open-source knowledge base for humans and agents.

What it solves

SAG is a knowledge base application designed to replace traditional RAG (Retrieval-Augmented Generation) and GraphRAG. It addresses the limitations of semantic-only retrieval (dense RAG) and the high maintenance overhead of offline graph construction (GraphRAG) by introducing a new retrieval architecture that combines semantic search and relational reasoning into a single system.

How it works

SAG uses a unique data model where documents are parsed into semantically complete "events" and lightweight "entities". Instead of pre-building a global knowledge graph, it creates "query-time dynamic hyperedges" using SQL joins over shared entities when a query is made.

The process follows two main phases:

  1. Offline Indexing: Documents are split into chunks, and for each chunk, one event and multiple entities are extracted and stored in relational and vector indexes.
  2. Online Retrieval: The system finds seed events and entities via semantic/lexical signals, expands the candidate space using SQL joins, and returns the original evidence chunks for the LLM to generate cited answers.

Who it’s for

SAG is built for individuals and AI Agents who need a local-first, searchable, and traceable knowledge base. It is particularly useful for those who want to integrate their private data into AI tools like Claude Code or Codex via the Model Context Protocol (MCP).

Highlights

  • SOTA Performance: Outperforms baselines on HotpotQA, 2WikiMultiHopQA, and MuSiQue benchmarks.
  • Local-First: Uses SQLite and LanceDB by default, requiring no external database installation.
  • Source Tracing: Every retrieval result and citation maps directly back to the original source chunk.
  • Agent Integration: Includes a dedicated CLI for mounting knowledge as an MCP server into AI agents.
  • Interactive Exploration: Features an "Explore mode" to visualize the knowledge base as an interactive universe or 3D graph.

Related

  • Project
  • Project
  • Project
  • Project
  • Project