About the Project
What Inspired Me
I was constantly frustrated with having to manually search through CSV files and PDF documents at work. Every time someone asked "what skills does this candidate have?" or "show me records where sales are above X," I had to open files, scroll through data, and manually find answers. I thought there had to be a better way to make data accessible to everyone, not just people who know SQL.
What I Learned
This project taught me so much about the complexity of file processing. PDFs were especially tricky - some are image-based, others have weird encoding issues. I learned about Unicode normalization, different CSV delimiters, and how to handle Excel files properly. Working with Google's Gemini API showed me how to craft effective prompts for SQL generation.
How I Built It
I started with a simple Flask app that could upload CSV files. Then I added PostgreSQL integration because I needed a real database for complex queries. The PDF processing was the hardest part - I had to use both PyPDF2 and pdfplumber to handle different types of documents. Finally, I integrated Gemini AI to convert natural language questions into SQL queries.
Challenges I Faced
The biggest challenge was getting PDF text extraction to work reliably. Some PDFs would return empty text, others had garbled characters. I spent days debugging PostgreSQL connection issues and learning how to properly sanitize table names. Getting the AI to generate accurate SQL was another hurdle - I had to write detailed prompts with examples and constraints.
Technical Decisions
I chose Flask over FastAPI for simplicity, PostgreSQL for robust data handling, and Google Gemini for its strong SQL generation capabilities. The frontend is intentionally simple - just HTML/CSS/JavaScript - to focus on the core functionality.
Log in or sign up for Devpost to join the conversation.