Skip to main content
Tired of writing SQL or asking the data team every time you need to analyze internal data? DbSphere auto-converts natural language to SQL to query databases. Ask “show me this month’s sales” and the AI generates SQL, executes it, and responds with the results in natural language and a table, visualizing them as a chart on request.

Example

“Compare sales by department this quarter”
Database list

View connected DBs in Workspace > Database


NL-to-SQL Pipeline


Supported Databases

10 databases are supported by default.
All 10 are enabled by default. Admins can narrow or expand the visible list with the DBSPHERE_TYPES environment variable.

Connect a Database

1

Create a new connection

Click Workspace > Database > ”+ New Database” and enter basic info.
Database creation form

Enter name, description, and permissions

2

Enter connection info

In DB Information, click Configure to enter the credentials needed to connect to the database. The required fields depend on the database type.Common fields:
Beyond the common fields (host, port, database, username, password, max query time), each DB type adds the fields below.
3

Test connection

Click “Test Connection” to verify access.
4

Pick tables

After successful connection, select tables the AI will reference.
Table selection

Select only tables the AI should access — exclude tables with sensitive data

Always exclude tables containing sensitive info (PII, passwords, etc.). Selected tables are accessible by the AI.
5

Set tool description (optional)

Write a tool description that tells the agent when and how to use this database.AI auto-generation: Click the auto-generate button next to the tool description field — the AI drafts it based on connected table structure and column info.
The more accurate the tool description, the more accurately the agent picks the right database among many.
6

Set access permissions

Click the lock button at the top to set who can use the database.

How the AI Generates SQL

When you connect a DB to an agent, user questions go through this process to become SQL.
Successful queries auto-accumulate in memory. The more you use it, the more accurate SQL the AI generates for similar questions.

Memory System

DbSphere uses 4 types of memory to improve SQL generation accuracy. The more memory, the more accurate the AI’s queries.
Memory list

Manage 4 memory types in the Memory tab

Improve Accuracy with DDL Schema Descriptions

Adding business descriptions to the tables and columns in DDL Schema memory greatly improves the AI’s SQL generation accuracy. After schema extraction, go to Memory tab → click DDL Schema → Edit and enter descriptions for each table and column.
DDL schema description input

Enter table and column descriptions under Memory tab → DDL Schema → Edit

You can also configure the LLM to auto-generate table/column descriptions and sample Q&A during schema extraction. Reviewing and correcting the auto-generated results improves accuracy further.

SQL Few-shot is Key

SQL Few-shot is a few-shot learning memory where successful queries are auto-saved.

Documentation Use

Tell the AI about business rules it doesn’t know via Documentation.
When the AI repeatedly generates wrong SQL with a recurring pattern, add the rule to Documentation. The AI references it from the next question onward.

Data Visualization

SQL results are provided as a table by default. When you ask (e.g., “show me a chart”), they’re visualized with a chart suited to the data, and you can switch directly via the chart-type toggle at the top of the results. When you request a chart, the chart type that fits the data structure is recommended and auto-selected, and you can switch to another type via the top toggle.

Querying Databases

Connect to an Agent

  1. In the agent edit screen, click “Select Database” in the “Database” section
  2. Pick the database to connect
  3. Click Apply

Use in Chat

When you chat with an agent that has databases connected, the AI analyzes the question and auto-generates and runs SQL.

Example Questions

Reviewing SQL Execution Results

A “SQL Query” button appears below the AI response. Click to see the actual SQL run and detailed results.
Result data is shown up to 100 rows. When the total exceeds 100, a “Showing 100 of N rows” notice appears. If you need the complete data, download it via Export to CSV at the top-right of the chat result table.

DB Dialect Differences

Each DB has slightly different SQL syntax. Cloosphere dynamically injects per-DB dialect rules into the system prompt when converting natural language to SQL, guiding the AI to produce correct SQL. Still, expressing intent clearly produces more accurate SQL.

Key Differences

System Auto-Correction vs. User Responsibility

Handled automatically:
  • Dashboard period filter ($st/$ed placeholders): auto-converted to per-DB date literals
  • Identifier quoting during Knowledge Graph value extraction: auto-selects per-DB quotes
  • Per-DB dialect rules dynamically injected into the AI’s system prompt (LIMIT, date, identifiers, etc.)
User/AI responsibility:
  • When you write Korean/special-char column names directly in natural-language queries — the AI may miss quotes and fail
  • Oracle empty-string comparisons (see Oracle quirks below)
  • Complex window functions and CTEs vary by DB — verify AI output

Oracle DB Quirks

Oracle has some behaviors that differ from ANSI SQL — worth knowing.
Oracle treats '' (empty string) the same as NULL. So conditions like the following always return 0 rows:
Correct usage:
Cloosphere’s system prompt includes this rule, and the AI auto-avoids it. Still, when natural-language queries use ambiguous phrasing like “non-empty items” and 0 rows are returned, suspect this pattern.
Unlike other DBs, Oracle doesn’t auto-cast strings to dates.
BI dashboard period filters ($st/$ed) auto-substitute as TO_DATE(...) when using Oracle. But you must specify it yourself when writing SQL directly in the SQL result screen.
Use TRUNC(col, 'DD') instead of DATE_TRUNC(), and TO_CHAR(col, 'D') instead of EXTRACT(DOW FROM col) for day-of-week.
In Oracle, using a Korean column alias (AS 공장코드) directly causes ORA-00936: missing expression.
The system prompt includes this rule and the AI auto-applies quotes — but in environments with many Korean columns, verify the result and fix manually if needed.

Security

Read-only

DbSphere only executes SELECT queries. Data modification is not possible.

Credential Protection

  • DB passwords are stored encrypted
  • Connection info is only viewable by users with access permission

Best Practices

Database Account Setup

  1. Create a dedicated account: Make a read-only account just for AI use
  2. Grant least privilege: Grant SELECT permission only on needed tables
  3. Set query limits: Configure timeout and result row limits

Table Selection

  1. Pick only what’s needed: Connecting all tables can confuse the AI
  2. Exclude sensitive data: Always exclude tables with PII or passwords
  3. Pick related tables together: Pick tables that need to JOIN together

Schema Description Writing

  1. Korean descriptions encouraged: Describe tables and columns using business terminology
  2. Add business context: Document possible values and meanings of “status” columns
  3. State relationships explicitly: Describe foreign-key relationships and JOIN conditions

Troubleshooting


FAQ

No — DbSphere is read-only. Only SELECT queries are executed; data can’t be modified or deleted. Any SQL not starting with SELECT is blocked immediately.
Yes — the AI response shows the generated SQL. You can also see the executed SQL and results in detail under Tracing.
Yes — pick all related tables and describe inter-table relationships in the schema description. The AI will generate appropriate JOIN queries.
Yes — when multiple databases are connected to an agent, the AI auto-picks the right one based on the question. Writing detailed tool descriptions for each DB improves selection accuracy.
With a model, the LLM auto-generates business descriptions for tables/columns and sample Q&A pairs. Without a model, only DDL structure is stored. Picking a model is recommended.

Agents

Connect a DB to an agent to enable natural-language queries

Glossary

Tell the AI about DB business terminology to improve accuracy

Tracing

Track the SQL generation and execution process step by step