SAG
SAG is a TypeScript-based document retrieval workbench that organizes knowledge into events and entities rather than storing raw chunks, enabling multi-hop question answering over uploaded documents. It includes a web UI for chat-based retrieval, graph exploration, and integration with external agents via MCP.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | Zleap-AI/SAG |
| Owner | Zleap-AI |
| Primary language | TypeScript |
| License | MIT — OSI-approved |
| Stars | 1.9k |
| Forks | 91 |
| Open issues | 6 |
| Latest release | Unknown |
| Last updated | 2026-06-26 |
| Source | https://github.com/Zleap-AI/SAG |
What SAG is
Built on TypeScript with React/Vite frontend and Fastify backend, SAG uses PostgreSQL with pgvector for storage and retrieval. It extracts events and entities from documents, builds relational indexes, and performs multi-hop SQL queries for retrieval, supporting OpenAI-compatible LLM and embedding APIs.
Get the SAG source
Clone the repository and explore it locally.
git clone https://github.com/Zleap-AI/SAG.gitcd SAG# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires operational knowledge of PostgreSQL and pgvector; Docker Compose setup is provided but manual Homebrew/local install requires database CLI commands.
- Depends entirely on external OpenAI-compatible LLM and embedding APIs; no local model option documented. Costs and latency scale with document volume and query complexity.
- Event and entity extraction quality depends on upstream LLM capability; weak models will degrade retrieval performance. Benchmarks use Qwen 3.6-flash; results may vary with other models.
- No multi-tenancy, role-based access control, or API authentication documented. Suitable for team/research use; hardening needed for multi-user production.
When to avoid it — and what to weigh
- Requires Zero Setup or Managed SaaS — SAG requires Docker, PostgreSQL, pgvector, Node.js 20+, and API keys (OpenAI-compatible endpoints). If your team cannot manage local deployments or prefers fully managed services, this is not a fit.
- Need for Real-time Structured Data Integration — SAG is optimized for static document upload and retrieval. If you need live feeds, streaming updates, or deep integration with operational databases, a full-featured knowledge graph or enterprise RAG platform is more suitable.
- Scale Beyond Moderate Document Volumes — Unknown performance at very large scale (millions of documents or entities). No benchmarks or tuning guidance provided for enterprise-scale deployments; requires testing before committing to production.
- Strict Compliance or Security Isolation — No security audit, access control, or data governance features documented. If data must be isolated by tenant, encrypted at rest, or comply with strict regulatory frameworks, additional hardening is required.
License & commercial use
MIT License. Permits commercial use, modification, and distribution with attribution. No patent or liability limitations beyond standard MIT terms.
MIT is a permissive OSI license and allows commercial use without restrictions. However, no warranty is provided. For production deployments, review your own compliance obligations and ensure any downstream API dependencies (OpenAI-compatible endpoints) have compatible commercial terms.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | Medium |
No security audit, secrets management, encryption at rest, or access control documented. API keys are configured via .env or WebUI settings (shown as 'Configured/Not Configured' but keys are plaintext in .env). In shared environments, ensure .env is protected. No mention of input validation, SQL injection prevention, or model poisoning safeguards. Suitable for research and internal team use; production deployments require additional security review and hardening.
Alternatives to consider
LangChain + LlamaIndex
Established Python/JS frameworks for RAG. Larger ecosystem, more integrations, and community examples, but require more custom code to build comparable multi-hop retrieval and visualization.
Anthropic Claude + Retrieval API
Fully managed SaaS for document retrieval with enterprise support. Eliminates infrastructure overhead but locks you into Anthropic's model and pricing; less transparent for debugging retrieval traces.
Neo4j + GraphRAG
Enterprise knowledge graph platform with GraphRAG patterns. More heavyweight, mature, and audited for compliance, but steeper learning curve and licensing costs; better for large-scale structured data.
Build on SAG with DEV.co software developers
Deploy SAG locally to test multi-hop retrieval over your documents, debug search pipelines, and integrate AI agents via MCP. Ideal for research, prototyping, and small-to-medium team deployments.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
SAG FAQ
Can I run SAG without external LLM APIs?
What happens if I upload very large documents?
How do I deploy SAG in production?
Can multiple projects share a PostgreSQL database?
Software developers & web developers for hire
DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If SAG is part of your vector databases roadmap, our team can implement, customize, migrate, and maintain it.
Evaluate SAG for Your RAG Prototype or Knowledge Base
Deploy SAG locally to test multi-hop retrieval over your documents, debug search pipelines, and integrate AI agents via MCP. Ideal for research, prototyping, and small-to-medium team deployments.