跪拜 Guibai
← All articles
Frontend · GitHub · Algorithm

Aureka: A Self-Hosted Chat BI Tool That Turns Natural Language Into SQL and Charts

By 徐小夕 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Self-hosted Chat BI sidesteps the data-privacy and cost concerns that keep small teams from adopting cloud analytics. A local DuckDB engine means million-row queries run in seconds without a server, and the pluggable LLM layer lets operators swap models as pricing and performance shift.

Summary

Aureka combines a chat interface with a local DuckDB-powered analytics engine to let non-technical teams query data as easily as sending a message. Users upload CSV or Excel files, ask questions like "which channel declined the most last quarter," and watch an AI agent generate SQL, run the query, and produce ECharts visualizations in a streaming, typewriter-style output. All data stays on the user's machine via SQLite and DuckDB, with no cloud uploads.

The agent pipeline routes natural language through intent classification, SQL generation with automatic error correction, and a chart advisor that picks the right visualization based on the data shape. A dual-database design separates metadata (SQLite) from analytical data (DuckDB), keeping queries fast on millions of rows while user accounts and session history remain isolated.

Built with Vue 3, NestJS, LangGraph, and a pluggable LLM provider layer that supports OpenAI, DeepSeek, Qwen, and Kimi, the project ships as a monorepo ready for local deployment. Historical conversations can be pinned into dashboards, turning one-off questions into persistent reports.

Takeaways
Upload CSV or Excel files and query them with natural language; the agent translates intent to SQL and executes it locally.
Intent routing classifies questions into analysis types — comparison, anomaly detection, trend forecasting — to guide SQL generation.
SQL generation includes automatic error correction: if DuckDB rejects a query, the agent retries with the error log as context.
DuckDB handles analytical queries on millions of rows in under a second, while SQLite stores metadata, sessions, and reports.
Charts are recommended by a rule-plus-LLM layer that outputs ECharts JSON configs, rendered directly in the frontend.
SSE streaming pushes results in chunks — thinking text, SQL, data table, chart config, and final analysis — for a real-time feel.
Users can pin charts from any conversation into dashboards, building persistent visual reports without extra tooling.
LLM provider is swappable via environment variables; supported models include OpenAI, DeepSeek, Qwen, and Kimi.
Authentication integrates with JitWord for one-click login and API-based token retrieval.
Conclusions

Pairing DuckDB with SQLite is a pragmatic pattern for local-first analytics tools: DuckDB crunches the numbers, SQLite handles everything else, and neither requires a separate service process.

Automatic SQL retry with error feedback turns LLM weaknesses into a self-correcting loop, which matters more for non-technical users who can't debug a failed query.

Pinning analysis results into dashboards closes the gap between ad-hoc Q&A and ongoing reporting, a workflow traditional BI tools handle poorly without heavy configuration.

Concepts & terms
Chat BI
A conversational interface for business intelligence where users ask data questions in natural language and receive answers, charts, and reports without writing SQL or code.
DuckDB
An embedded, columnar OLAP database that runs in-process. It excels at analytical queries on large local datasets and can import CSV/Excel directly, often outperforming SQLite for aggregation workloads.
Intent Router
An LLM-based classifier that determines the type of analysis a user wants — such as trend prediction or anomaly detection — and routes the request to the appropriate prompt and logic chain.
SSE (Server-Sent Events)
A lightweight HTTP-based protocol for pushing real-time updates from server to client over a single long-lived connection, used here to stream AI analysis results incrementally.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗