Open sourceDatabase Agent

Ask your SQL database
in plain English.

Connect your PostgreSQL or MySQL database, ask questions in natural language, and explore the generated SQL, results, and visualizations.

An open-source AI Database Agent built by FutureSmart AI. A complete, opinionated reference application that developers can try, self-host, and customize.

Open source · Apache-2.0 · Self-hostable

How it works

Ask questions. Explore your data.

You don’t need to write SQL manually to explore your database.

Ask a question in natural language. Database Agent generates SQL, executes it against your connected database, and presents the results in an understandable format.

You can inspect the SQL, explore the returned data, generate visualizations when appropriate, and continue asking follow-up questions.

See Database Agent in action

Illustrative example
app.futuresmart.ai/database-agent
Who are our top five customers by total spend?
Read schema · customers orders
SELECT c.first_name, c.last_name, SUM(o.total_amount) AS total_spent
FROM customers c
JOIN orders o ON c.id = o.customer_id
GROUP BY c.id, c.first_name, c.last_name
ORDER BY total_spent DESC LIMIT 5;
5 rows · read-only database user
Priya Raman spent the most, at 11,984.20 — ahead of Arjun Mehta at 9,210.75. The top five together account for 41,208.60.
first_namelast_nametotal_spent
PriyaRaman11,984.20
ArjunMehta9,210.75
SnehaKulkarni7,488.90
VikramDesai6,602.15
NehaSharma5,922.60
Total spend
Priya Raman11,984
Arjun Mehta9,211
Sneha Kulkarni7,489
Vikram Desai6,602
Neha Sharma5,923

Features

What you can do with Database Agent

Ask questions in natural language

Ask about your customers, orders, revenue, or any information supported by your connected database. Database Agent translates your questions into SQL and retrieves the results.

Inspect generated SQL and results

See the SQL behind each answer and examine the returned rows. Understand which data was used instead of relying only on an AI-generated response.

Visualize your data

Explore supported query results through charts and tables to better understand patterns, comparisons, and trends.

Ask follow-up questions

Continue exploring your data through a conversation. Narrow results, change the question, or request a different presentation while retaining relevant conversation context.

Save and revisit conversations

Return to previous conversations and explore saved questions, answers, and available results.

Connect your existing databases

Connect PostgreSQL or MySQL databases and configure which data the application can use. Use read-only database credentials to control access at the database level.

Work in the app or from code

Ask in the web application, or call the same agent from Python, JavaScript, or cURL with an API key issued for it.

UI or API

Use the UI or API

Work directly through the web application or integrate Database Agent capabilities using its documented API.

Connects to

PostgreSQLMySQL

Reach it from

Web applicationPythonJavaScriptcURLMCP

Replace YOUR_AGENT_ID with your agent’s id and <YOUR_API_KEY> with a Database Agent API key issued for that agent — the product’s own key, not an OpenAI or other model-provider key. The samples call the hosted API; a self-hosted install serves the same routes from its own API root. The MCP server lets Claude Code and other MCP clients ask the same agent as a tool.

import requests

r = requests.post(
    "https://futuresmart.ai/database-agent/api/v1/agents/YOUR_AGENT_ID/chat",
    headers={"x-api-key": "<YOUR_API_KEY>"},
    json={"query": "Show products with stock quantity less than 10",
          "chart_output": True, "follow_up": True, "debug_info": True},
    timeout=120,
)
d = r.json()
print(d["response"])
print(d["debug_info"]["sql_query"])

Open source

Open source. Built to be customized.

Database Agent is a complete reference application, not just an NL2SQL library.

The open-source repository includes the frontend, backend, database integrations, model configuration, sample data, evaluation tools, and deployment instructions.

You can inspect the architecture, run the application in your own environment, modify its behavior, and extend it for your requirements.

The default standalone configuration works with one OpenAI API key, using FutureSmart’s recommended models for different operations. Developers can also customize supported providers and models for individual operations.

In the repository

FrontendBackendDatabase integrationsModel configurationSample dataEvaluation toolsDeployment instructions

Apache-2.0 · PostgreSQL and MySQL sources

Research

Improved through real-world AI research

At AI Demos, we benchmark AI products against real-world scenarios, capture their actual outputs, review the evidence, and publish what works and what fails.

We use those research findings to understand Database Agent’s capabilities, identify limitations, and guide product improvements.

Our public GitHub repository documents the findings, engineering decisions, fixes, and verification results so developers can see how the product evolves over time.

Get started

Try it online or run it yourself

Try the hosted application

Explore Database Agent through FutureSmart AI’s hosted application.

Sign in, add your OpenAI API key under Credentials, and connect a database the hosted service can reach. Then start asking questions.

Run it in your own environment

Prefer to host it yourself?

Clone the open-source repository, configure your OpenAI API key, start the application using Docker Compose, and explore the included sample database.

The repository includes setup instructions, architecture documentation, and examples to help you get started.

Explore Database Agent

Try the working application, inspect the open-source code, or follow how real-world benchmark findings guide ongoing improvements.

Built by FutureSmart AI. Open source under Apache-2.0.