Conversational Business Intelligence with Autonomous SQL Analytics

Dexlyn · Generative AI · Autonomous SQL Analytics · Secure read-only data access

The Challenge

Dexlyn's business teams needed timely answers from operational data, but accessing those insights often depended on people with SQL and database expertise.

Traditional reporting workflows required users to identify the required data, understand database structures, write SQL queries, validate the results, and convert the output into a business-friendly format. This made ad-hoc analysis time-consuming and created a dependency on technical teams.

Pre-built dashboards addressed recurring reporting requirements but were less effective when users had new questions that had not been anticipated during dashboard development.

Dexlyn needed a conversational business intelligence solution that could understand questions expressed in natural language and autonomously determine how to retrieve the required information.

The solution also needed to ensure that an AI model could never directly modify production data or execute uncontrolled SQL.

Discovery

Grey Bracket DevOps Automation analyzed Dexlyn's existing data-access workflow and identified opportunities to introduce Generative AI into the business intelligence process.

The focus was not simply to convert natural language into a single SQL query. Instead, the solution was designed as an autonomous SQL analytics agent capable of investigating the database before deciding how to answer a question.

“Which product is performing the best this quarter?”

The agent can determine which tables are relevant, inspect their structures, examine available values, construct the required query, execute it, analyze the results, and present the answer in a business-friendly format.

This approach allows users to ask new questions without requiring a developer to first create a dedicated query or dashboard.

Discovery requirements

  • Autonomous schema exploration.
  • Database-aware SQL generation.
  • Multi-step tool execution.
  • SQL error detection and recovery.
  • Secure read-only access.
  • Conversational context for follow-up questions.
  • Real-time visibility into the agent's work.
  • Support for multiple relational database technologies.

Onboarding

Grey Bracket DevOps Automation implemented an AI-powered conversational analytics agent using Amazon Bedrock and Amazon Nova Pro.

The agent uses the Bedrock Converse API with tool use to perform autonomous database investigation.

Instead of receiving unrestricted database access, the AI interacts with a controlled SQL execution tool exposed by the backend.

Agent workflow

  1. Interpret the business question.
  2. Determine what information is required.
  3. Discover available database tables.
  4. Inspect relevant table structures.
  5. Examine actual values when additional context is required.
  6. Generate SQL based on the database dialect.
  7. Submit the SQL for server-side validation.
  8. Execute the approved query.
  9. Analyze the returned data.
  10. Detect errors or incorrect assumptions.
  11. Revise and retry the query when required.
  12. Generate a final business-friendly response.

This creates an autonomous analytics workflow where the user does not need to understand the underlying database or SQL syntax.

The frontend was implemented using React and TypeScript and delivered through Amazon S3 and Amazon CloudFront. The backend agent orchestration layer runs on Amazon ECS with AWS Fargate.

Solution Architecture

Dexlyn conversational business intelligence and autonomous SQL analytics AWS architecture diagram

Operations & Support

The platform was designed with security controls around every stage of the AI-to-database interaction.

A server-side SQL validation layer evaluates every statement generated by the AI before it reaches the database.

Approved read operations

  • SELECT
  • WITH
  • SHOW
  • DESCRIBE
  • EXPLAIN

Statements capable of modifying database contents or structure are rejected.

The application also blocks stacked SQL statements and automatically applies a LIMIT 500 safeguard to unbounded queries.

Database credentials are securely stored using AWS Secrets Manager, while AWS IAM roles are used for AWS service authentication.

The databases run inside private VPC subnets and are not directly exposed to the internet.

Conversation context is maintained in Amazon DynamoDB with a 24-hour TTL, allowing users to continue conversations with contextual follow-up questions.

The application uses Socket.IO and WebSockets to stream agent processing information to the browser, providing visibility into the autonomous workflow.

Optimisation & Advisory

Grey Bracket DevOps Automation optimized the solution around the practical requirements of autonomous business intelligence: reliability, responsiveness, cost control, and database safety.

  • The agent workflow is bounded to a maximum number of iterations, preventing uncontrolled chains of model and database operations.
  • Amazon Bedrock ConverseStream provides token-level streaming so users can see the AI's progress while the agent performs multiple reasoning and tool-use steps.
  • Amazon Nova Pro is configured with deterministic decoding for tool-use workflows to encourage consistent SQL generation.
  • The query-agent was separated into a reusable npm workspace component, allowing the same autonomous analytics capability to be integrated into different applications and database environments.
  • The platform supports both MySQL and PostgreSQL, requiring the agent to understand database-specific SQL dialects rather than relying on a single fixed query syntax.
  • The architecture provides a foundation for future enhancements such as additional business data sources, richer analytical capabilities, domain-specific tools, and expanded visualization capabilities.

Summary

Grey Bracket DevOps Automation transformed Dexlyn's traditional business intelligence workflow into a conversational, autonomous SQL analytics platform.

Instead of waiting for technical teams to create queries or dashboards, users can ask business questions in natural language while the AI agent independently explores the database, determines the appropriate data, generates SQL, executes validated read-only queries, handles errors, and explains the results.

The solution combines Amazon Bedrock, Amazon Nova Pro, ECS Fargate, Amazon RDS, Amazon Aurora PostgreSQL, Amazon DynamoDB, Amazon CloudFront, Amazon S3, Amazon ECR, AWS Secrets Manager, AWS IAM, Amazon VPC, and Application Load Balancer.

The key GenAI capability is the transformation of a natural-language business question into a multi-step autonomous analytics workflow, with controlled tool use, database-aware reasoning, SQL validation, error recovery, and business-oriented result generation.

About Grey Bracket DevOps Automation

Grey Bracket DevOps Automation specializes in cloud architecture, DevOps automation, application modernization, Generative AI, AI-powered solutions, containerization, cloud security, and managed cloud services.

We help organizations design and implement secure, scalable cloud-native platforms that combine modern application engineering with automation and Generative AI.

Our approach focuses on solving practical business problems through AWS cloud services, agentic AI, automation, DevOps, observability, security, and modern application architectures.