SAG logo

SAG

Zleap-AI/SAG

Document retrieval system built on SAG

GraphCanon updated today · GitHub synced today

2.4k stars148 forksLast push today TypeScript MIT

Decision brief

SAG is a document retrieval project built with TypeScript to aid in efficient search and retrieval within knowledge bases.

Good fit when

  • When you need graph and vector-based techniques for retrieving documents
  • If your application requires integration capabilities within a knowledge base environment using TypeScript

Avoid when

  • Avoid if the project requires features not supported by TypeScript, favoring alternative languages or environments instead
  • Do not use SAG when the architecture of your system cannot benefit from graph and vector-based retrieval methods, as it may lead to underutilization of its capabilities

Observed Jul 14, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Very active (0d since push)
As of today
Provenance
Not a fork · Organization account
As of today
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

npm install SAG
npm

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

A document retrieval project developed using TypeScript to enable efficient search and retrieval of information within a knowledge base utilizing graph and vector-based techniques.

Capability facts

Languages
typescript

Source: github.language · Aug 23, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Aug 23, 2026)

No API key, Python runtime, Node runtime, or external database is required to boot the application.
Source link

Tags

README

Quick start (Docker, self-hosted)

Requirements: Docker Desktop, or Docker Engine with Compose v2.

git clone https://github.com/Zleap-AI/SAG.git
cd SAG
docker compose up -d --build

No API key, Python runtime, Node runtime, or external database is required to boot the application. When both services are healthy, open:

On first launch:

  1. Enter your name to create or restore the local identity.
  2. Use the 302.AI quick setup, or open Settings → Models and configure any OpenAI-compatible LLM and embedding endpoint.
  3. Create a source, upload documents, and wait until their status is Ready.
  4. Search, open the original source, or start a cited conversation.

The UI and services still start without model credentials. Embeddings are required for indexing/vector retrieval; the LLM is required for event extraction, query understanding, and generated answers.

Model settings precedence

SAG_LLM_* values in Docker Compose or .env provide the initial model configuration. After an administrator saves model settings in the web UI, the persisted Settings value is used for subsequent extraction and generation jobs without a restart.

To make the deployment configuration mandatory, set SAG_LOCK_LLM_CONFIG=true. SAG then shows the generation fields as locked in Settings and continues to use the SAG_LLM_* values. Change Docker Compose or .env and restart the API container to update a locked configuration. API keys remain deployment-managed and are never returned by the Settings API.


PostgreSQL/pgvector deployment

The optional production override moves application metadata and engine storage to PostgreSQL/pgvector:

cp .env.example .env
openssl rand -hex 32   # set SAG_SECRET_KEY
openssl rand -hex 24   # set POSTGRES_PASSWORD

docker compose -f compose.yaml -f compose.postgres.yaml config
docker compose -f compose.yaml -f compose.postgres.yaml up -d --build

Set real SAG_CORS_ORIGINS and NEXT_PUBLIC_API_BASE values before server deployment. Back up both pgdata and sagdata before upgrades.



Contributing and License

SAG is released under the MIT License.


For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.