Inside Zleap: How SAG Redefines AI Search Beyond Traditional RAG

Jomy explains SAG’s SQL-driven retrieval, event structures and natural-language attributes, and their applications in enterprise knowledge, personal knowledge bases and agent memory.

Hi, I am Jomy, CEO of Zleap and the principal designer of its products and technology. In earlier coverage, I briefly introduced Zleap: an intelligent agent that helps CEOs organize and summarize large volumes of internal business information automatically. Today, I would like to introduce the technology powering that agent: SAG.

The product attracted considerable attention. Recent conversations with friends, customers and investors have also changed my perspective. SAG's potential extends well beyond an agent appliance for managers. It could become underlying technology for enterprises, individuals and the broader agent ecosystem, helping move the AI industry forward.

Here is a closer look at its principles and applications.

SQL-Driven Retrieval

SAG stands for SQL-Retrieval Augmented Generation: retrieval is primarily driven by SQL.

Traditional RAG is vector-driven. It embeds a question, approximately matches its meaning against vectors representing source text, finds similar chunks and passes them to an LLM. This is efficient, but it relies heavily on similarity to the source and cannot retrieve deeply enough.

Traditional vector-driven RAG

GraphRAG introduced knowledge-graph retrieval. It first asks an LLM to analyze source material and generate entities and relationships, then retrieves from that structure. In effect, the LLM deeply analyzes and extracts information into an intermediate layer connecting questions and answers. The method works well, but it is slow and expensive, and incremental data requires regenerating the graph.

Knowledge graph retrieval

SAG takes these approaches further. It combines precise SQL retrieval with approximate vector matching and constructs data relationships during retrieval. This addresses the three-way trade-off in RAG: speed, accuracy and completeness.

Natural-Language Vectors

Initial data processing is an important part of SAG. Like GraphRAG, it creates an intermediate layer, which I call “events.” Complex information is distilled into atomic events, similar to breaking a complex matter into simpler parts. Unlike GraphRAG, SAG does not generate relationships between events during processing. It calculates them at query time, addressing incremental updates.

Connecting different events is the core of SAG. During processing, SAG extracts not only events, but also multidimensional attributes for each event. I call these “natural-language vectors.”

Events and natural-language attributes

Ordinary vectors represent meaning with numbers across dimensions. Natural-language vectors use attributes as dimensions and attribute values as their coordinates. Events share dimensions such as time, location, action and people. An LLM structures and generalizes the key tokens in an event. A natural-language vector can thus represent most of the event's meaning.

Natural-language vector dimensions

Small models can extract events and attributes, greatly reducing compute costs. Dimensions are configurable, so industries can add specialized attributes for their own data.

Six Degrees of Separation

Why can natural-language vectors construct relationships between events at query time? The inspiration comes from the idea of six degrees of separation.

Simply put, the idea says that no more than six people separate you from any stranger. If A knows B and B knows C, A and C may have no direct connection, but B connects them.

Six degrees of separation

In SAG, people correspond to events and shared connections correspond to common attributes. In principle, any events can become connected through attributes shared by intermediate events.

Connecting events through shared attributes

Events and attributes are extracted during processing. At query time, only SQL retrieval is needed, without LLM involvement. Constructing relationships in real time is therefore extremely fast.

Controlling Uncertainty

SQL uses exact matching. How can it handle the many ways people phrase a question? For example, a Chinese query for the name of Apple does not directly match “Apple Inc.” in SQL. Vector semantic matching addresses this.

SAG stores every attribute in both vector and SQL databases. A search for Apple's Chinese name can semantically match “Apple Inc.” or even “iPhone.” These terms can then be used in SQL queries to avoid omissions.

Combining semantic matching with precise SQL queries

Vector retrieval is good at approximate semantic matching, but carries substantial uncertainty. SAG combines the strengths of vectors and SQL, using SQL as the primary mechanism and constraining vector uncertainty.

Once uncertainty is controlled, SQL's advantages become clear. We can retrieve precisely and completely by selected attributes, or count events associated with an attribute. SAG's table structure is simple enough for an LLM's text-to-SQL capabilities.

Compounding Gains

Making each retrieval more accurate produces a compounding effect. Multi-hop RAG often underperforms because of “garbage in, garbage out”: if the first retrieval is poor, adding rounds does not help much. SAG improves each atomic retrieval and supplies more connected events, so multi-step reasoning can improve substantially.

Accuracy gains across retrieval steps

Enterprise Applications

SAG uses AI to turn unstructured data into structured data, with considerable potential in enterprises.

First, it can support intelligent decision assistants.

In our first product, the Zleap-D1 agent appliance, SAG makes historical business data useful and connects live operational data. Reports, search and question answering provide managers with decision support and new business insights.

Enterprise decision support

Second, SAG can work as a general-purpose data processing engine.

As an independent processor, it can restructure existing enterprise data. E-commerce recommendations, financial risk control and advertising can all benefit from more informative data that improves existing algorithms.

General-purpose enterprise data processing

Third, it offers a lower-cost path to AI transformation.

SAG can help traditional enterprises move directly into AI-enabled operations. It converts complex unstructured information into a consistent format, laying a foundation for deeper applications and potentially accelerating the enterprise application ecosystem. Processing is asynchronous: it can use small models and idle overnight compute, lowering the cost of processing large historical collections.

Personal Applications

SAG also has considerable potential for individuals.

First, it can underpin a personal knowledge base. Notes, documents and bookmarks become searchable, interconnected knowledge, rather than information sitting in folders.

Second, it can serve as the memory for a personal AI, helping it remember preferences, habits and earlier conversations.

SAG is also lightweight. Its low compute requirements mean a streamlined system can run completely offline on a phone while delivering strong results. Your data remains under your control.

Personal knowledge and AI memory

Agent Applications

Context engineering has become central to agent development, but current retrieval is often crude. For example, Claude Code's grep search matches patterns without deeper structured understanding.

Context retrieval for agents

SAG could provide a memory and data foundation for future agents, quickly delivering more precise context. As with the compounding gains above, better context may reduce a task from ten steps to three, improving efficiency and success rates.

Open Source

SAG is a new generation of RAG technology combining SQL and vector strengths for fast, accurate and comprehensive AI retrieval. It provides a stronger data foundation for enterprises, individuals and agents.

To make this technology available to enterprises and contribute to the industry, we are open-sourcing it:

https://github.com/Zleap-AI/SAG

Space prevents us from covering every detail, including the algorithms that dynamically connect events and attributes, and dynamic pruning across retrieval rounds. Please consult the source code for the algorithms and principles. We welcome collaboration with interested enterprises and universities.

Conclusion

We believe SAG's value extends beyond replacing RAG. More fundamentally, it efficiently turns many types of information into a unified, multidimensional knowledge graph.

Imagine a simple data format connecting every information source, making data an interconnected, potentially tradable asset rather than an isolated collection.

AI could then fully retrieve and use this structured information to improve productivity. That is Zleap's vision:

Connect all information. Turn all data into assets.

To help people experience the technology, we have also built a consumer product that combines public and private information, generates scheduled reports and supports search and question answering.

The product is in beta and uses invitation codes.

Codes will be published periodically through Zleap's official WeChat account. Thank you for following us.

Web: https://app.zleap.com.cn

App: Search for Zleap in the iOS App Store.

All illustrations in this article were generated with AI. Please excuse any inaccuracies.