Personal Project · Applied AI / Data Analysis
DataPilot
A tool that lets you upload a CSV or Excel file and ask questions about it in plain language. LangChain handles the analysis, DuckDB runs the queries, and you can see the SQL and data behind every answer.
You choose the model: use the OpenAI API or connect a self-hosted model through Ollama, on your own computer or a remote server.
Why I built this
I wanted to explore datasets without writing a new query for every question. The idea was to upload a file, ask what I wanted to know, and get an answer I could check against the actual data.
It was also a way to work with LangChain across the whole process, from planning the analysis to explaining the results.
Start with the file
Upload a CSV or an Excel workbook with several sheets. You get a preview, column types, missing values, and distinct counts. You can also add a note to explain things like units or column names.
Ask a question
Each question gets its own page with the answer, the rows used to produce it, and the SQL that ran. An activity log shows what the app is doing as it works through the analysis.
Demo Video
This recording shows the Ollama option, using Qwen3-Coder:30B on a RunPod server with a rented NVIDIA RTX 5090. All model calls in this demo went to that self-hosted setup.
The recording uses the Zomato market analysis dataset from Kaggle. You can download it and try the same data yourself.
Download the demo dataset from KaggleHow It Works
The frontend is built with React and TypeScript, with FastAPI on the backend. LangChain connects the model to three tasks: planning the analysis, writing SQL, and explaining what came back.
Step 1
Read the columns
The model starts with the column information saved during upload. It can answer questions about the file’s structure directly from that profile.
Step 2
Plan the analysis
For questions that need calculations, it plans up to three checks on the selected table. A broader question can lead to several queries.
Step 3
Write and run SQL
The model writes SQL, SQLGlot checks it, and DuckDB runs it. If a query fails, the error goes back to the model so it can try again.
Step 4
Explain the results
The model builds its answer from the returned rows. The backend checks numbers against those rows and falls back to a direct description if the summary fails that check.
Choosing the model
DataPilot supports two ways to run the analysis. Both follow the same steps: plan the checks, validate and run the SQL, then explain the results.
OpenAI API
Add your API key and choose an OpenAI model in the project configuration. OpenAI handles the model calls, while DuckDB runs the queries in DataPilot's workspace.
Self-hosted with Ollama
Connect to a model served through Ollama, either locally or on a remote server. I successfully tested Mistral 7B on my own computer and used Qwen3-Coder:30B on RunPod for the recorded demo.
Checking the SQL
The model doesn't get to run anything it wants. SQLGlot checks that each query is a single SELECT on the selected table. Writes, external file readers, and unsupported functions are rejected before DuckDB sees the query.
Queries run on a read-only connection, with limits on time, rows, and response size. Retries are capped too. Each upload has its own temporary workspace, which expires after an hour of inactivity. The app is designed for local or trusted use.