From Hours of Manual Data Analysis to Instant Answers: How an Enterprise Team Transformed the Way They Query Business Data

Client Name : Insurtech for Underwriters

Industry : Insurance Services

Region: US East (N. Virginia)

Duration: 6 Weeks

Business Challenge

The customer relied heavily on a MySQL database as the central data source for reporting and analytics. However, accessing this data was a major challenge for non-technical business users. 

  • SQL Dependency: Users had to depend on data analysts or IT teams to write complex SQL queries to extract insights. This created a bottleneck and delayed decision-making. 
  • Error-Prone Queries: Even when users attempted to write queries themselves, syntax errors, lack of schema knowledge, and mismatched joins frequently caused failures. 
  • Slow Turnaround: A simple business question often took hours or days to answer, as requests moved through multiple teams. 
  • Inconsistent Results: Different teams writing their own queries led to variations in logic, resulting in inconsistent or conflicting reports. 
  • Lack of Accessibility: Business users without SQL expertise were completely dependent on technical staff, making self-service data exploration impossible. 

The customer wanted a chatbot interface that could translate natural language questions into valid SQL queries against their MySQL database, ensuring fast, accurate, and consistent answers without requiring SQL knowledge. 

Objective

To build a natural language query interface where users can ask questions in plain text and receive accurate, context-driven answers without needing SQL knowledge. The solution should ensure scalability, fault tolerance, and seamless integration with existing AWS data infrastructure.

Solution by Futran Solutions

  • A Python backend with a React-based frontend was deployed on AWS to provide a seamless chatbot interface for business users. 
  • Claude V2 (Amazon Bedrock) was integrated for natural language understanding, SQL query generation, and correction of invalid queries. 
  • Titan Embeddings + Amazon OpenSearch were used within a Retrieval-Augmented Generation (RAG) framework to add schema and metadata context, ensuring more accurate SQL queries. 
  • AWS Glue catalogued MySQL database schema and kept metadata updated for query accuracy. 
  • AWS DMS enabled continuous synchronization of MySQL schema changes to maintain consistency. 
  • Amazon Athena was leveraged as a query execution layer to validate SQL queries and handle large-scale analytical workloads. 
  • Amazon Bedrock generated conversational responses, transforming raw SQL results into business-friendly answers for the chatbot. 
  • Data was securely stored in MySQL while processed query results were managed through controlled workflows within the VPC for compliance. 
  • React-based chatbot frontend allowed users to interact naturally, receive instant answers, and review SQL execution outcomes without needing technical expertise. 
  • Centralized backend workflows ensured secure execution, error handling, and reliable delivery of insights with minimal manual intervention. 

Architecture Overview

Understudy

The architecture uses AWS-managed, distributed services to ensure resilience, elastic scaling, and high uptime, ready for future growth and regional expansion. 

Key Workloads and Services Involved

  • Amazon Bedrock (Claude V2, Titan Embeddings): Powered natural language understanding, SQL query generation, correction of invalid queries, and conversational responses. 
  • Amazon OpenSearch: Stored and retrieved embeddings for context, enabling the Retrieval-Augmented Generation (RAG) framework. 
  • AWS Glue: Catalogued MySQL schema and provided up-to-date metadata for accurate SQL generation. 
  • AWS DMS (Database Migration Service): Continuously synchronized schema and metadata from MySQL to ensure accuracy and minimize drift. 
  • Amazon Athena: Executed SQL queries generated by the AI model and validated query correctness. 
  • MySQL Database: Core transactional and analytical data source for chatbot queries. 
  • Amazon S3: Stored intermediate query results, logs, and metadata snapshots for compliance and reusability. 
  • React Frontend: Provided a user-friendly chatbot interface for business users to ask queries in plain language. 
  • Python Backend (within AWS VPC): Orchestrated query flow, integrated AI models, managed SQL execution pipeline, and enforced security. 

Business Results

  • Conversational Data Access: 100% of business users were able to query data directly via the chatbot without SQL knowledge. 
  • Higher Accuracy: Error correction loop reduced query failures by 80%, significantly improving reliability. 
  • Faster Insights: Query response time was reduced from several hours to under 30 seconds on average, a 95% improvement in turnaround time. 
  • Scalability: Chatbot successfully handled a 5x increase in concurrent queries without performance degradation. 
  • Improved User Experience: Adoption reached 70% of business users within the first month, with user satisfaction scores improving by 65% compared to legacy SQL-based processes.

     

Lessons Learned / Best Practices

  • Embedding quality is critical; using Titan Embeddings improved context retrieval significantly. 
  • Error correction loop for SQL queries is essential in real-world deployments to handle incomplete metadata and schema drift. 
  • Deploying within a VPC enhanced security by isolating the RAG framework and ensuring compliance with data governance policies. 
  • Iterative fine-tuning with real user queries helped refine SQL generation accuracy. 

Responsible and Ethical Generative AI Practices

Our company remained committed to the responsible and ethical use of Generative AI. We recognized both the transformative potential and the risks associated with AI, and we deployed solutions that were accurate, fair, transparent, safe, user-centric, and environmentally sustainable. 

AI Ethics Policies

We grounded our AI ethics policies in fairness, accountability, and transparency. Every AI initiative underwent an internal ethical review to ensure compliance with laws, regulations, and industry standards. We avoided deceptive design, ensured explainability in outputs, and maintained accountability through audit trails and governance structures. 

Bias Mitigation Strategies

Bias was a critical risk in Generative AI. To address this, we curated datasets with diversity across demographics, geographies, and contexts. We performed fairness audits during model development, applied debiasing algorithms, and continuously monitored outputs in production. Where biases were detected, corrective measures were deployed immediately, ensuring outputs remained equitable and inclusive. 

User Consent Protocols

Respect for user autonomy was central to our approach. All Generative AI interactions were designed with explicit, informed consent. Users were clearly informed about how AI was used, what data was collected, and how it was processed. Opt-in and opt-out mechanisms were provided to ensure that users stayed in control of their engagement with AI systems. 

Transparency Reports

We committed to publishing regular transparency reports that detailed model performance, known limitations, and updates. These reports included insights into system behavior, reliability metrics, and user feedback analysis. By disclosing this information, we built trust with stakeholders and provided visibility into how AI decisions were made and improved over time. 

Safety Measures

Safety was prioritized to prevent harmful or inappropriate outputs. We integrated multi-layer safeguards including content filtering, toxic language detection, and human-in-the-loop moderation. When outputs had the potential to cause harm, escalation protocols ensured human reviewers validated or overrode AI-generated results before final use. 

Sustainability Initiatives

Generative AI models could be computationally intensive, and we committed to minimizing their environmental footprint. We optimized model efficiency through pruning, quantization, and lightweight architectures. We leveraged green cloud infrastructure, prioritized renewable-energy-powered data centers, and adopted resource-sharing strategies to reduce carbon impact. Our long-term goal was to align AI innovation with global sustainability targets. 

Take Your Business to New Heights

Elevate your business with Futran Solutions' digital transformation. Contact us today to learn more.