DEV.co
Vector Databases · Zleap-AI

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.

Source: GitHub — github.com/Zleap-AI/SAG
1.9k
GitHub stars
91
Forks
TypeScript
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryZleap-AI/SAG
OwnerZleap-AI
Primary languageTypeScript
LicenseMIT — OSI-approved
Stars1.9k
Forks91
Open issues6
Latest releaseUnknown
Last updated2026-06-26
Sourcehttps://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.

Quickstart

Get the SAG source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/Zleap-AI/SAG.gitcd SAG# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Multi-hop Question Answering over Internal Docs

Organizations with complex project documentation or knowledge bases requiring multi-step reasoning can deploy SAG locally to answer questions that depend on connecting information across multiple documents without heavy knowledge graph overhead.

RAG Prototype Validation and Pipeline Debugging

Teams building RAG systems can use SAG's transparent logging, search trace visualization, and raw model inspection to debug retrieval quality, compare fast vs. standard search modes, and validate improvements before production deployment.

Agent Tool Integration and MCP Testing

Developers building AI agents can run SAG as an MCP server to expose project-specific document retrieval as a tool, test agent-tool interactions, and validate that multi-turn reasoning picks up correct evidence from document graphs.

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.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceMedium
Security considerations

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.

Software development agency

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.co

Related 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?
Partially. SAG includes a local deterministic fallback for testing and UI inspection, but real retrieval quality requires remote OpenAI-compatible LLM and embedding APIs. No local model integration documented.
What happens if I upload very large documents?
Unknown. No guidance on chunk size limits, memory usage, or performance thresholds. Document processing includes chunking and vectorization stages; scale testing is needed before committing to large uploads.
How do I deploy SAG in production?
Use `npm run build` and `npm start` for production builds. Host on Node.js infrastructure (VM, container, Heroku, etc.). Database must be PostgreSQL with pgvector. No Kubernetes manifests or load-balancer setup documented.
Can multiple projects share a PostgreSQL database?
Yes, each project has its own documents, conversations, graph, and MCP config within the same database. Multi-tenancy or fine-grained access control is not documented; row-level security would require custom implementation.

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.