🎉 Build2Learn #32 Meetup - Saturday, October 11

⏰ 9:30 AM - 2:00 PM IST | 📍 Freeshworks

Register Now →

CRM Genie : Natural Language to SQL Query generator

Participants
yogeshravichandranvasudevan19bagavath-ravichandran-ba5b38321shekkylar-krishnan
Tech Stack
React.jsFlaskMySQLGemini 2.5 Proall-MiniLM-L6-v2
Description
Our project aimed to convert natural language questions into accurate SQL queries. Initially, it could only generate basic queries and often struggled with correct column names. To improve this, we used a technique called Retrieval-Augmented Generation (RAG). We took all the column names from our database and created descriptions , split them into chunks, and converted them into embeddings to create a knowledge base. When the user types a query in plain English, the backend first identifies relevant column info using these embeddings. Then, it sends both the user input and the retrieved knowledge to the Gemini 2.5 Pro model to generate a precise SQL query. The generated query is run on a MySQL database, and the result is returned.

Team Collaboration

Although our frontend (React.js) wasn’t fully connected, we successfully tested the results through the terminal. The CRM Genie project is an extension of the work we began during the January Build2Learn event in collaboration with Selvakumar Duraipandian, Ramachandran V, and Yogeshwaran Ravichandran.