Overview
SABI is a business assistant. Employees ask questions in chat and receive text, audio, tables, and charts. A question about sales, for example, produces a chart and then an explanation of it. Each company supplies its own instructions for how calculations should be done, and the assistant follows those definitions instead of inventing business rules.
What shipped
- Chat-based report builder that keeps the thread and updates the current report.
- Report generator for tables, charts, and written analysis.
- Permission control and a knowledge graph of company documents.
- Calendar management, file upload, and multiple languages.
- Personal reports that a user can save and pin to a dashboard.
Model and tools
The assistant runs Llama 4 Maverick, chosen because the model had to be small enough to download and run locally. LangChain and LangGraph decide whether the user is permitted to ask and whether the question is in scope. The shipped flow uses tools for database queries, notifications, and report creation. Every step returns structured output. Retrieval-augmented generation covers entity search and knowledge-graph search. An agent loop was designed and left for a later iteration.
Querying data
A question moves from the model to a scope, then to the tables in that scope, then through schema understanding, SQL generation, validation, execution, and visualization. A rules table stores how each source table should be queried, and the user chooses the database. Safety was enforced with those rules and by rewriting filters to the row IDs each user can access. The next step is to have the model emit a pivot specification, using the report builder already in production, instead of free-form SQL.
Knowledge graph
Uploaded PDF, Word, and text files are split into paragraphs. A prompt extracts nodes and relations from each paragraph. Node types are concept, definition, formula, entity, and purpose. Purposes are context, query, visualization, and analysis. Relations are includes, excludes, dependent, same as, related to, and mapped to. The graph is stored locally and consulted in an early LangGraph step. In testing it supplied the accounting definitions the model did not already have. The planned follow-up is to expose the graph as a tool in an agent flow.
Access control
The system reads the database schema, and an administrator marks tables as permission-bearing. Those tables appear on the user form. Every later query checks both the allowed tables and the allowed rows.