Guidance Needed: Building a SQL Chatbot in Dataiku

Yawar
Yawar Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 10 ✭✭✭

Dear Dataiku Experts,

I’m working on a Dataiku project where I want to enable natural language interaction with a production SQL database — essentially, a chatbot I call the “Production Analyst.” The idea is that a user can type queries in natural language, and the chatbot will interpret them to perform production analysis, such as retrieving key metrics or generating diagnostic plots.

I’m familiar with using the LLM Prompt recipe to build chatbots for unstructured data (e.g., documents), but I’m unsure how to approach this for structured data like SQL tables.

Here’s what I’ve tried so far:

  • Prompt recipe: While it supports natural language input, I couldn't find a way to tailor prompts specifically for SQL query generation and execution.
  • AI-generated SQL: I’ve seen how Dataiku can generate SQL queries from natural language, which is great — but I want to go a step further by automatically fetching data and running diagnostic analyses within an application interface.
  • Agent Tool – “Performs SQL queries in a set of SQL datasets”: I’ve set this up, but I’m unclear on what the next steps are after configuring the agent.

Outside of Dataiku, I’ve experimented with this concept in a Python Jupyter notebook using function/tool calling (e.g., with Gemini 1.5 or GPT APIs), and it works well. However, I’m unsure how to translate that into a working solution within Dataiku.

I've reviewed the documentation and browsed through community discussions but haven’t found a practical example or end-to-end guide on building an interactive SQL chatbot or app inside Dataiku.

Below is a snippet of the Python-based prototype I’ve been testing outside Dataiku:

# These are the Python functions defined above.db_tools = [list_tables, describe_table, execute_query]instruction = """You are a helpful chatbot that can interact with an SQL databasefor a computer store. You will take the users questions and turn them into SQLqueries using the tools available. Once you have the information you need, you willanswer the user's question using the data returned.Use list_tables to see what tables are present, describe_table to understand theschema, and execute_query to issue an SQL SELECT query."""client = genai.Client(api_key=GOOGLE_API_KEY)# Start a chat with automatic function calling enabled.chat = client.chats.create(    model="gemini-2.0-flash",    config=types.GenerateContentConfig(        system_instruction=instruction,        tools=db_tools,    ),)

Could you kindly guide me on how I can replicate or implement something similar inside Dataiku — perhaps via plugins, custom recipes, webapps, or Agent Tools? Any example projects or detailed steps would be greatly appreciated.

Kind regards,

Yawar

Answers

Setup Info
    Tags
      Help me…