Overview of SAG Architecture and Capabilities
mainSAG (SQL-Retrieval Augmented Generation) is a retrieval architecture designed to replace traditional RAG and GraphRAG. It uses an event-entity indexing model with query-time dynamic hyperedges to provide both semantic retrieval and relational reasoning in a single system.
Core Capabilities
- Knowledge Ingestion: Supports file and web sources with document parsing, chunking, embedding, and event/entity extraction.
- Search: Offers global or source-scoped retrieval using two modes:
- Fast: Vector-based semantic retrieval.
- Precise: Multi-mode retrieval.
- Source Tracing: Every retrieval result and citation can be traced back to the exact original text chunk.
- Knowledge Graph: Allows inspection of events, entities, and their associations.
- Agent Chat: Multi-turn chat grounded in sources with clickable citations.
- Integration: Provides a self-hosted REST/OpenAPI, OpenAI-compatible chat, MCP, and a Python package (
zleap-sag).
Data Model
Instead of fragmented triples, SAG uses:
- Event: Carries the complete meaning of a chunk.
- Entity: A lightweight index and expansion point.
- Query-time dynamic hyperedge: Created locally via SQL joins when events share entities relevant to a query.