DEV Community

Harish S T
Harish S T

Posted on

QueriumAI — Bringing Hidden Data Stories to Life with an AI Data Analyst

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

👻 QueriumAI — Bringing Hidden Data Stories to Life with an AI Data Analyst

What I Built

Have you ever looked at a database full of tables and thousands of rows but struggled to find the story hidden inside the data?

That's the problem I wanted to solve with QueriumAI.

QueriumAI is an LLM-powered data analyst agent that transforms natural-language questions into SQL queries, interactive visualizations, diagrams, and structured insights.

Instead of manually writing SQL, switching between database tools, and building charts yourself, you can simply ask questions in plain English.

For example:

  • Which products generate the highest revenue?
  • How has monthly sales performance changed?
  • Which countries contribute the most revenue?
  • What trends can we discover in customer segments?

QueriumAI investigates the database, generates SQL, executes the query, visualizes the results, and explains the findings.

I like to think of it as uncovering the ghosts hidden inside data — the patterns, trends, and insights that aren't immediately visible when looking at raw database tables.

Key Features

  • 💬 Natural Language to SQL: Ask questions in plain English.
  • 🔍 SQL Transparency: Inspect generated SQL, row counts, and execution time.
  • 📊 Interactive Visualizations: Generate bar, line, area, pie, and scatter charts.
  • 🧩 Mermaid Diagrams: Generate ER diagrams, workflows, and decision trees.
  • 🧠 Structured Insights: Get findings, trends, and recommendations.
  • 🕵️ Reasoning Trace: Inspect the agent's reasoning trace.
  • 📚 Query History: Save, favorite, and rerun previous queries.
  • 📌 Pinned Dashboard: Keep important analyses organized.
  • 🎙️ Voice Input: Ask questions using speech.
  • 🛡️ SQL Safety: Read-only query validation and an optional SQL approval step.
  • 📥 Exports: Export tables as CSV and charts or diagrams as PNG.

Demo

🎬 Watch QueriumAI in action:

https://youtu.be/jYxZIr66gws

The demo walks through the application and demonstrates how natural-language questions can become database queries, visualizations, and useful insights.

Code

💻 GitHub Repository:

https://github.com/harishhardik/queriumai

🌐 Live Application:

https://queriumai.vercel.app

Feel free to explore the code, try the application, and share your feedback!

How I Built It

QueriumAI is built around an AI agent that can interact with a database through a set of specialized tools.

Tech Stack

  • TanStack Start: Application framework.
  • React 19 + Vite: Frontend and development tooling.
  • Vercel AI SDK: Agent runtime, streaming responses, and tool calling.
  • AI Gateway + OpenAI Responses API: Model integration.
  • PostgreSQL: Database and data persistence.
  • Recharts: Interactive charts.
  • Mermaid: Diagrams and flowcharts.
  • Tailwind CSS + shadcn/ui: User interface.

How the Agent Works

The agent uses five specialized tools:

  1. get_schema — Inspects database tables, columns, data types, and relationships.
  2. execute_query — Executes validated, read-only SQL queries.
  3. generate_chart — Selects appropriate chart types and visualizes query results.
  4. generate_flowchart — Creates Mermaid diagrams.
  5. explain_data — Turns query results into understandable insights and recommendations.

The workflow looks like this:

User Question → Schema Inspection → SQL Generation → Query Execution → Visualization → Insights

I also focused on database safety. QueriumAI uses multiple layers of SQL validation, restricts execution to read-only queries, applies a query timeout, and limits returned rows.

The goal is not just to generate answers, but to make the process transparent and safer to inspect.

Why Does Open Innovation Matter?

QueriumAI currently uses the OpenAI Responses API through AI Gateway for its model integration, rather than an open-weight model or local inference.

I want to be transparent about that because open innovation is an important part of this challenge.

The project uses technologies such as React, PostgreSQL, Recharts, Mermaid, and other open-source libraries. Their ecosystems make it possible to build, inspect, and extend complex applications without reinventing every component.

However, I recognize that using open-source libraries is not the same as having open-source AI at the core. Exploring open-weight model integration and local inference is a potential next step for QueriumAI.

I believe open innovation matters because developers should have the freedom to inspect systems, experiment with different models, adapt tools to their needs, and build beyond the limitations of a single provider.

My Agent Session

QueriumAI was developed through an iterative workflow involving application architecture, agent tool design, database integration, SQL validation, and visualization.

I haven't published a DevRelay agent session link for this project.

The Lazy Payoff

Imagine answering a business question without spending time writing SQL, exporting data, opening a spreadsheet, and manually building a chart.

That's the convenience QueriumAI aims to provide.

It brings database exploration, query execution, visualization, and explanations into one conversational interface.

Instead of spending time on repetitive analysis steps, users can focus more on understanding their data and making decisions.

I haven't measured a specific time-saving figure yet, but the goal is to reduce the friction between asking a question and discovering an answer.


Building QueriumAI taught me that an AI agent becomes much more useful when it can interact with real tools and data rather than simply generate text.

The interesting part isn't just asking AI a question. It's watching it investigate, query, visualize, and explain.

Turn questions into queries. Turn data into insights. 👻📊

Top comments (0)