Inspiration

We wanted to make data analysis accessible to everyone, not just people who know SQL or complex analytics tools. We were inspired by the idea of using AI to let users interact with their data naturally, ask questions in plain English, and instantly receive meaningful results, visualizations, and insights.

What it does

Querium is an AI-powered data analyst that converts natural-language questions into secure SQL queries and analyzes the results. Users can ask questions about their data without writing SQL. Querium understands the database schema, generates and validates read-only queries, executes them securely, and presents the results as tables, interactive charts, and concise insights. It also supports query history, dashboards, and human approval before executing generated SQL.

How we built it

We built Querium using React, TypeScript, TanStack Start, Vite, Tailwind CSS, Supabase/PostgreSQL, Clerk authentication, and the Vercel AI SDK.

The AI agent uses a tool-based architecture. It can inspect the database schema, generate and execute read-only SQL queries, create visualizations, generate diagrams, and explain the resulting data. SQL execution is protected through server-side validation and database-level restrictions to prevent destructive operations.

The frontend uses structured components to render tables, charts, diagrams, and insights generated by the agent. Streaming responses allow users to see the analysis progress in real time.

Challenges we ran into

One of our biggest challenges was making AI-generated SQL both useful and safe. LLMs can generate incorrect or potentially dangerous queries, so we implemented read-only SQL validation, restricted database access, query limits, and optional human approval before execution.

Another challenge was coordinating multiple AI tool calls while keeping the interface responsive. We solved this using a structured agent workflow and streaming responses.

Accomplishments that we're proud of

We are proud of building a complete AI data-analysis workflow rather than just a chatbot. Querium can go from a natural-language question to schema discovery, SQL generation, secure execution, visualization, and actionable insights in a single conversation.

We are also proud of implementing human-in-the-loop SQL approval, query history, authentication, dashboards, and structured visualization components.

What we learned

We learned how to build tool-using AI agents and integrate LLMs with real databases safely. We also gained practical experience with SQL validation, database security, streaming AI responses, structured outputs, authentication, and building responsive AI-powered interfaces.

Most importantly, we learned that reliable AI applications require more than a powerful model. Good tool design, validation, security, and clear data boundaries are equally important.

What's next for Querium

We plan to expand Querium to support more database types and allow users to securely connect their own data sources. Future improvements include stronger SQL verification, improved semantic understanding of datasets, automated data-quality checks, advanced dashboards, scheduled reports, and more powerful multi-dataset analysis.

Our long-term goal is to make Querium a reliable AI data analyst that allows anyone to explore and understand complex data through natural conversation.

Built With

Share this project:

Updates

Submission history