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.
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.
How it works
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.
customers ordersSELECT 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;
| first_name | last_name | total_spent |
|---|---|---|
| Priya | Raman | 11,984.20 |
| Arjun | Mehta | 9,210.75 |
| Sneha | Kulkarni | 7,488.90 |
| Vikram | Desai | 6,602.15 |
| Neha | Sharma | 5,922.60 |
Features
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.
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.
Explore supported query results through charts and tables to better understand patterns, comparisons, and trends.
Continue exploring your data through a conversation. Narrow results, change the question, or request a different presentation while retaining relevant conversation context.
Return to previous conversations and explore saved questions, answers, and available results.
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.
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
Work directly through the web application or integrate Database Agent capabilities using its documented API.
Connects to
Reach it from
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
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
Apache-2.0 · PostgreSQL and MySQL sources
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
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.
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.
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.