Back to Projects

Slack Text-to-SQL Analytics Bot

Natural language queries for business teams

Data Engineer & AI DeveloperData App / LLM / AutomationJanuary 2024

Technology Stack

PythonSQLiteOllamaSlack APILangChainSQL

Overview

Built an intelligent Slack bot that converts natural language questions into SQL queries, enabling non-technical team members to access analytics data instantly.

Business Problem

Business stakeholders were constantly requesting ad-hoc data queries from the analytics team, creating bottlenecks and delays in decision-making processes. The analytics team spent 40% of their time on repetitive query requests instead of strategic analysis.

Approach & Solution

Developed a Slack bot using local LLM (Ollama) with custom prompting to generate SQL from natural language. Implemented safety measures including query validation, result limits, and user permission controls. Created a feedback loop to improve query accuracy over time.

Challenges Overcome

Ensuring SQL query safety to prevent data breaches, handling ambiguous requests that could generate multiple valid queries, maintaining data security while providing self-service access, and optimizing response times for complex analytical queries.

Results & Impact

Reduced analytics team query load by 60% and improved stakeholder data access from days to seconds. Achieved 92% query accuracy rate and processed over 1,000 queries in the first month.

Demonstrates expertise in LLM integration, API development, natural language processing, and bridging technical/non-technical team gaps in data-driven organizations.

Key Highlights

Quick bullets for recruiters and hiring managers:

  • 60% reduction in manual query requests to analytics team
  • Real-time analytics access for 50+ business stakeholders
  • 92% query accuracy with continuous learning improvements
  • Secure, validated SQL generation with audit trails
  • Seamless Slack workflow integration with zero training required