ADSP Logo

Building a Text-to-SQL Agent and Company Oracle

Creating a text-to-SQL tool and a company oracle for a financial technology firm, aimed at enhancing data accessibility and information retrieval for non-technical staff.

text-to-sql-company-oracle-image

The Opportunity

Our client, a financial technology company, recognised the need to enable non-technical staff to interact with databases through natural language. Additionally, they envisioned a 'company oracle'—a sophisticated chatbot powered by large language models (LLMs) that could tap into the company's extensive documentation via retrieval augmented generation, providing swift and conversational access to information.

What we did

✔︎ Developed a text-to-SQL conversion tool that allows natural language querying, greatly enhancing data accessibility for non-technical personnel. ✔︎ Engineered an advanced 'company oracle' chatbot utilising Retrieval Augmented Generation (RAG) technology ✔︎ Implemented a user-friendly interface using Streamlit, facilitating effortless interaction with the AI agents. ✔︎ Supplied the complete codebase and comprehensive deployment manuals to ensure a smooth transition to operational use.

The Results

Our innovative solutions achieved a remarkable 91% accuracy rate in generating perfect SQL queries on the first attempt and a 90% retrieval accuracy for providing precise Oracle responses initially, significantly enhancing the efficiency and decision-making capabilities within the financial technology firm. Our solution enabled the client's staff to interact with their databases without prior SQL knowledge, streamlining their workflow.

91%

accuracy rate in generating perfect SQL queries on the first attempt

How we did it

To develop the text-to-SQL agent, we delved into the latest Large Language Model (LLM) research to select the most suitable model for our client's needs. We established a rigorous testing framework to assess various LLMs and their prompt engineering strategies, which led to a comprehensive user acceptance testing phase. This phase was critical to confirm that the tool satisfied all functional requirements. For the 'company oracle', we compiled an extensive dataset sourced from both internal and external company documentation. This dataset was then incorporated into a vector database to support the Retrieval Augmented Generation (RAG) process. We meticulously refined multiple iterations of the oracle, utilising a dedicated test set to determine the most effective version. Both AI solutions were integrated into a web-based application, designed to log user interactions and gather feedback on the agents' performance. This feedback loop is essential for the ongoing refinement of the agents' capabilities. The entire system has been securely deployed on Azure infrastructure, ensuring compatibility with the client's existing setup

Building a Text-to-SQL Agent and Company Oracle Guide

Building a Text-to-SQL Agent and Company Oracle

Chat Icon

Start a conversation

Take the first step by speaking with one of our data experts today.

Get in touch