SAG is an open-source knowledge-base app built on a novel retrieval architecture for semantic search and relational reasoning, delivered as a desktop app or Docker-deployed service.
Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).
What it is
SAG is a complete knowledge base application built on an original retrieval architecture that replaces traditional RAG and GraphRAG approaches. It ingests documents, chunks them, embeds, extracts events and entities, and stores data in relational storage with vector indices. It provides search, source tracing, a knowledge graph, agent chat with citations, and integrations via REST/OpenAPI and an MCP. The project is local-first and starts with SQLite and LanceDB, with paths to PostgreSQL/pgvector backends.
How it works
Offline indexing parses documents into chunks, extracts one event and multiple entities per chunk, and persists chunks, events, entities, and their associations to relational storage, plus representations to vector/full-text indexes. Online retrieval seeds with entities/events, uses SQL joins over shared entities to expand the candidate space, instantiates only needed hyperedges, selects the strongest event and direct-chunk candidates, deduplicates, and returns original evidence chunks. A query-time dynamic hyperedge model underpins retrieval.
Getting started
Desktop and Docker-based setups are described:
- Desktop: access through GitHub Releases with platform-specific installers for macOS Apple Silicon and Windows x64.
- Quick start (Docker, self-hosted):
Open Web app at http://localhost:3000 and API docs at http://localhost:8000/docs. Initial steps include creating/restoring a local identity, configuring an OpenAI-compatible LLM and embedding endpoint, creating a source, uploading documents, and waiting for Ready status. Embeddings are required for indexing/vector retrieval; the LLM is required for extraction, understanding, and generated answers.git clone https://github.com/Zleap-AI/SAG.git cd SAG docker compose up -d --build
Manual commands and config
- Use SAG CLI to mount MCP and wire into Codex or Claude Code:
npm install --global @zleap-ai/sag-clisag mcp test sag agent connect codex sag agent connect claude-code sag agent status - To use SAG as an OpenAI-compatible endpoint:
curl -s http://localhost:8000/api/v1/openai/<AGENT_ID>/chat/completions \ -H "Authorization: Bearer <SAG_JWT>" \ -H "Content-Type: application/json" \ -d '{"messages":[{"role":"user","content":"What is this material about?"}]}'
Recent releases
Latest releases include v1.5.1 SAG v1.5.1 (2026-08-05) with macOS dmg and Windows Setup.exe installers, and v1.5.0 (2026-08-04) with similar installers. Other entries include 1.4.0 (2026-07-23) and 1.3.0 (2026-07-22) with corresponding macOS and Windows installers. The FnOS package fnos-1.5.0-fnos.1 is also listed (2026-08-05).
Traction
Stars: 2292
Behind the repo
Not provided in the README excerpt.
Caveats
License: MIT. Desktop installers are provided via releases; Windows Setup.exe is noted as unsigned, which may prompt warnings. The project inception is 2025-11-07, last push 2026-08-04. The README mentions dependencies on Docker, Node.js (20+), and Python, with a local-first architecture.






