Aureka: A Self-Hosted Chat BI Tool That Turns Natural Language Into SQL and Charts
During my entrepreneurial journey (daily business operations), business personnel (sales, operations, finance, etc.) generate large amounts of data every day, but due to technical barriers, they cannot explore data and gain insights as efficiently as data analysts.
Traditional BI tools are complex to operate and have high learning costs, while having technicians write SQL for each data request is extremely inefficient.
So I spent a week, with the help of Vibe Coding, building an open-source visual data analysis tool — Aureka (灵析).
It allows users to analyze data "as if chatting," using natural language to complete data analysis that originally required SQL and Python.
Simply put, we don't need to hire a data analyst or a professional to help us analyze and organize data. With just one command, AI can automatically analyze Excel data content and generate professional data insight reports.
I previously mentioned I would open-source a version, so today I'm fulfilling that promise:
github: https://github.com/MrXujiang/opne-aureka
Below, I will introduce in detail the features and technical implementation of this AI open-source project that are worth referencing.
Core Feature Introduction
Aureka is an out-of-the-box conversational intelligent data analysis platform (Chat BI). To complete a data analysis report, we only need to follow these steps:
- Upload an Excel / CSV dataset
- Ask questions in natural language, for example, "Compare sales by channel for the last three months, which channel declined the most?"
- The AI Agent automatically completes Intent Recognition → SQL Generation → DuckDB Query → Data Analysis → Chart Recommendation
- Real-time streaming output of analysis conclusions, data tables, and ECharts visual charts
- One-click save as an analysis report, with the ability to review historical conversations at any time
The entire process requires no coding. All data is stored locally on the user's machine (based on SQLite + DuckDB storage), ensuring privacy control and supporting local private deployment.
Core features are as follows:
- Natural Language Query
We can ask questions as if chatting, and Aureka will automatically translate them into executable SQL and perform data query and analysis.
Here is a complete conversation process:
We can see that through the Agent I designed, the AI can automatically write SQL for data query and analysis, and automatically generate visual charts.
2. Multi-Intent Intelligent Routing
Aureka has built-in analysis intents such as data query, comparative analysis, attribution analysis, anomaly detection, trend prediction, and statistical summary, which can help us perform professional data analysis.
If you are a team manager, you can import a task management sheet, and it can help you analyze team project progress, risk assessment, and team KOI / KPI with one click;
If you are a business operator, you can let Aureka help you analyze operational data and provide more scientific insights and suggestions.
Below is an analysis report generated by Aureka based on an Excel spreadsheet for your reference:
3. Multi-Format Data Access
Currently, Aureka supports parsing and importing file formats such as CSV, XLSX, and XLS, and also allows direct online editing of the data in these files for real-time AI analysis.
On the other hand, for data from enterprise business systems, I also provided a data source connection module:
Supports connecting to databases such as MySQL and PostgreSQL. Users can also extend it based on existing solutions.
4. High-Performance Analysis Engine
Aureka uses the DuckDB columnar engine design, supporting sub-second aggregation on millions of rows of data and enabling efficient chart generation services.
5. Custom Visual Reports
We can pin generated charts from historical conversations to a specified dashboard to create the visual large screen shown above, allowing data to continuously generate insight value.
For example, in the AI analysis conversation above, we can hover over the top right corner of a chart and click a button to "pin" the current analysis chart to a specified dashboard:
Technical Implementation
The above is the Aureka Agent workflow I designed. The complete tech stack is as follows:
| Layer | Technology Selection |
|---|---|
| Frontend | Vue 3 · Vite · Pinia · Vue Router · UnoCSS · ECharts · vue-i18n, JitWord SDK |
| Backend | NestJS 10 · Passport JWT · SSE Streaming Push |
| AI Orchestration | LangGraph · LangChain · Multi LLM Provider (OpenAI / DeepSeek / Qwen / Kimi) |
| Data Engine | DuckDB (Analytical Queries) · SQLite (Metadata) · Keyv (Cache) |
| Engineering | pnpm workspace · Turborepo · TypeScript Full-Stack Shared Types |
I will analyze and summarize the implementation logic of each node in detail below:
- 1. Intent Router
Input: User's natural language conversation + current dataset table structure metadata
Implementation: LLM classifies multiple analysis intents (statistical summary, channel comparison, anomaly detection, trend prediction, multi-dimensional attribution, etc.)
Function: Distinguishes analysis types, provides targeted prompts for subsequent SQL generation, reducing invalid SQL
2. SQL Generator
Context Injection: Automatically concatenates dataset field names, data types, and sample data to avoid risks like field name spelling errors
Constraints: Forces generation of DuckDB-compatible standard SQL, prohibits DDL table modification statements, only supports SELECT queries
Fault Tolerance Mechanism: When LLM generates SQL syntax errors, it automatically carries error logs for a second correction
3. DuckDB Query Execution Layer
Batch imports Excel/CSV to local columnar storage, no external database dependency required
Columnar engine naturally adapts to aggregation, grouping, and sorting, returning results for millions of rows in seconds
Isolation Mechanism: Each user dataset has an independent logical table, data only exists in the local file
./data/analysis.duckdb4. Data Analysis Module Analysis
Receives SQL query results, LLM automatically outputs business interpretations based on numerical values: fluctuation amplitude, proportion, anomalies, potential causes
Structured output of text conclusions, distinguishing objective data descriptions from subjective business analysis
5. Chart Advisor
Rule + LLM dual-layer judgment: Automatically matches ECharts charts (line, bar, pie, table) based on the number of dimensions and indicator types
Outputs standardized ECharts configuration JSON, directly rendered by the frontend without secondary adaptation
6. SSE Streaming Output
Uses Server-Sent Events long connections, replacing polling / WebSocket, lightweight with no connection disconnection overhead
Chunked push: Outputs thinking text first → SQL statement → Data table JSON → Chart configuration → Complete analysis conclusion
Frontend
useSSEhook incremental rendering, achieving a typewriter real-time output experience
Data Storage Layer Dual-Engine Design
The project adopts dual-database separated storage, achieving decoupling of metadata and analysis data. All files are stored on local disk, no cloud upload required, improving data security:
- SQLite (Metadata Storage)
Storage Content: User accounts, JWT sessions, dataset basic information, historical conversations, analysis reports, system configuration
File Path:
./data/metadata.dbCache Support: Keyv supports memory/sqlite dual cache drivers, caching LLM configurations and dataset table structures to reduce repeated parsing
DuckDB (Columnar Analysis Engine)
Storage Content: User-uploaded Excel/CSV raw data, all imported into the local file
./data/analysis.duckdbTechnical Advantages: Embedded OLAP engine, no independent service process required, NodeJS direct local read/write; batch aggregation query performance far superior to SQLite; supports direct CSV/Excel import syntax
File Storage: Uploaded files are saved locally in the
./uploadsdirectory, with customizable storage drivers, defaulting to local disk
The entire project adopts a Monorepo full-stack layered architecture, divided into four layers: frontend application layer, backend service layer, AI intelligent orchestration layer, and data storage engine layer, supported by an engineering base, authentication, and internationalization infrastructure. It is very valuable for reference and study for AI projects.
Multi-Model Configuration
On the backend, I abstracted a unified LLM Provider interface, compatible with mainstream large models. Users can connect their own model AI online, or use an OpenAPI-compatible URL address (such as DIFY). The specific model compatibility and technical design are as follows:
- Supported Providers: OpenAI, DeepSeek, Tongyi Qianwen (Qwen), Kimi
- Unified Configuration Fields:
LLM_PROVIDER,LLM_API_KEY,LLM_BASE_URL,LLM_MODEL, Temperature ControlLLM_TEMPERATURE=0.1(low temperature ensures SQL stability) - Adapter Encapsulation: Uniformly formats Prompts, processes streaming chunks, captures API exceptions, allowing upper-layer Agents to switch models without perception
User System Fully Integrated with JitWord
Users can directly register and log in with a JitWord account, and also use its open API to automatically obtain Tokens via API:
github: https://github.com/MrXujiang/opne-aureka
If you are interested in this tool, welcome to exchange feedback + co-build.
Open source is not easy, please give it a star~