Inspiration

Modern application backends often suffer from performance bottlenecks caused by missing database indexes and poorly structured SQL queries. Traditional DBA tools can be complex and slow to configure. I wanted to build an intelligent, instant DBA assistant that leverages state-of-the-art LLMs to analyze queries, recommend precise indexing strategies, and interactively guide developers in real time.

What it does

AI SQL Optimizer & Index Advisor is an interactive Streamlit application that acts as an automated database administrator:

  • Schema & Query Analysis: Parses complex DDL schemas alongside target queries to identify full table scans, implicit conversions, and high-cost join operations.
  • Smart Index Recommendations: Generates copy-paste ready CREATE INDEX statements (such as compound B-Tree indexes) optimized for filtering and sorting predicates.
  • Query Rewriting: Provides refactored, performance-optimized SQL statements with detailed explanations.
  • Interactive Multilingual DBA Agent: Features a multi-turn chat powered by a persistent system prompt, supporting dynamic switching across English, Italian, French, German, and Portuguese.

How we built it

  • Framework: Streamlit for a fast, intuitive web UI.
  • LLM Engine: nvidia/Nemotron-3_5-Lightning accessed via Nebius Token Factory serverless endpoints using the standard OpenAI Python SDK.
  • Context & Multilingual State Management: Custom prompt routing that updates system context on the fly without losing conversation history.

Challenges we ran into

Balancing detailed, deterministic DBA recommendations with strict system boundaries required careful prompt engineering. Ensuring seamless multi-turn conversation support across multiple languages while maintaining low response latency was another key focus area.

Accomplishments that we're proud of

We successfully integrated Nebius Token Factory serverless inference to achieve near-instantaneous query parsing and agent responses. We are also proud of implementing seamless multi-language agentic context switching without breaking conversation continuity.

What we learned

We gained hands-on experience optimizing serverless LLM calls with NVIDIA Nemotron-3.5-Lightning on Nebius infrastructure, as well as designing resilient system prompts for domain-specific agentic applications.

What's next for AI SQL Optimizer & Index Advisor

  • Adding support for PostgreSQL EXPLAIN ANALYZE JSON plan uploads.
  • Automated index impact estimation using historical execution metrics.

Built With

Share this project:

Updates

Submission history