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 natural-language summary and charts.

Example

“Compare sales by department this quarter”
MethodProcessTime
Write SQL yourselfWrite SQL → execute → interpret10–30 min
Ask the data teamRequest → wait → receiveHours to days
DbSphereNatural-language question → instant answer + chart10 sec
Database list

NL-to-SQL Pipeline

StageDescription
Schema analysisThe AI analyzes connected table structure and column descriptions
SQL generationConverts the natural-language question to SQL in the right DB dialect
Safety checkAllows only SELECT queries; blocks INSERT, UPDATE, DELETE, etc.
Run queryExecutes validated SQL on the database
NL responseConverts query results to natural-language text or chart

Supported Databases

10 databases are supported by default.
DatabaseTypeStrengths
PostgreSQLRDBMSAdvanced features, JSON support, open-source
MySQLRDBMSMost widely used RDBMS
Microsoft SQL ServerRDBMSEnterprise environments
OracleRDBMSLarge enterprise
SQLiteRDBMSLightweight embedded database
SnowflakeCloud DWCloud data warehouse
BigQueryCloud DWGoogle Cloud data warehouse, service account key auth
DatabricksLakehouseDatabricks SQL Warehouse, Delta Lake integrated
Azure SynapseCloud DWAzure unified analytics platform
Microsoft FabricLakehouse / DWPower BI integrated analytics environment
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 Connection” and enter basic info.
Database creation form
FieldDescriptionExample
NameConnection display name”Sales Analytics DB”
DescriptionDatabase purpose”Sales team revenue data”
DB typeDatabase typePostgreSQL
2

Enter connection info

Enter the credentials needed to connect to the database.Common fields:
FieldDescription
HostDB server address
PortConnection port
Database nameDB name to connect to
UsernameDB account
PasswordDB password
DB TypeAdditional FieldsDescription
SnowflakeAccount, Warehouse, Role, SchemaSnowflake account identifier, warehouse, role, schema
PostgreSQLSchemaSchema name (default: public)
MSSQLSchemaSchema name (default: dbo)
SQLiteDatabase (file path)No host/port/auth — only the DB file path
BigQueryProject ID, Dataset, Service Account JSONGCP project ID, default dataset, service account key (paste JSON). No host/port/username/password
3

Test connection

Click “Test Connection” to verify access.
4

Pick tables

After successful connection, select tables the AI will reference.
Table selection
Always exclude tables containing sensitive info (PII, passwords, etc.). Selected tables are accessible by the AI.
5

Add schema descriptions (optional)

Add Korean/English descriptions for tables and columns. The more detailed, the more accurate SQL the AI generates.
Schema description input
Use AI auto-extraction to let the LLM auto-generate table structures, column descriptions, and sample Q&A. You don’t have to write them manually, but reviewing and correcting auto-generated results improves accuracy further.
Table: orders
Description: Order history table
Columns:
- order_id: Unique order number
- customer_id: Customer ID (references customers table)
- order_date: Order timestamp
- total_amount: Total order amount (KRW)
- status: Order status (pending/confirmed/shipped/delivered)
6

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.
This database holds the sales team's order, customer, and inventory info.
Use for revenue analysis, customer lookup, inventory checks, and similar.
JOIN the orders table with the customers table
to get per-customer purchase history.
The more accurate the tool description, the more accurately the agent picks the right database among many.
7

Set access permissions

Set who can use the database.
OptionDescription
PublicAvailable to all users
PrivateAvailable only to you
Group/OrganizationAvailable only to specified groups or organizations

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.
MemoryBadgeContentCreation
DDL SchemaDDLTable structure + column descriptionsAuto on schema extraction
SQL MemorySQLQuestion-SQL pairs (past successful queries)Auto-accumulated on query success
DocumentationDOCBusiness terms, rules, contextManual entry
SQL ExampleEXReference SQL examples (use case, tags)Manual entry or auto on extraction
Memory list

SQL Memory is Key

SQL Memory is a few-shot learning memory where successful queries are auto-saved.
Use CountSQL MemoryAI Behavior
First0Guess SQL from schema only
55Generate referencing similar past queries
50+50+Generate accurate SQL using validated patterns

Documentation Use

Tell the AI about business rules it doesn’t know via Documentation.
TypeExample
Term”MRR is the abbreviation for Monthly Recurring Revenue, stored in the monthly_revenue column”
Rule”When aggregating revenue, orders with status=‘cancelled’ must be excluded”
Context”Customer tiers are 4 levels: S/A/B/C, with S being the highest”
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

Based on SQL execution results, the AI auto-generates appropriate charts.
Chart TypeSuitable Data
BarComparison by category
LineTime-series trend
PieRatio / composition
ScatterCorrelation
HeatmapCross analysis
HistogramDistribution
Grouped barMulti-dimensional comparison
TableDetailed data
If you don’t specify a chart type, Auto mode picks the optimal chart based on data structure.

Querying Databases

Connect to an Agent

  1. In the agent edit screen, click ”+ Add” in the “Database” section
  2. Pick the database to connect
  3. Save

Use in Chat

When you chat with an agent that has databases connected, the AI analyzes the question and auto-generates and runs SQL.
User: What's the revenue growth rate this quarter vs. last?

AI: Quarterly revenue analysis:

| Quarter | Revenue | QoQ |
|---------|---------|-----|
| Q4 2024 | ₩1.25B | - |
| Q1 2025 | ₩1.42B | +13.6% |

This quarter's revenue grew 13.6% QoQ.
Key drivers: new customer acquisition (+23%), repeat-buyer rate up (+8%)

Example Questions

- What's this month's revenue?
- Show daily revenue trend last week
- List the top 10 customers by revenue
- What's the share of revenue by product category?

Reviewing SQL Execution Results

A “SQL Query” button appears below the AI response. Click to see the actual SQL run and detailed results.
FeatureDescription
View SQLShow the executed SQL with formatting (uppercase keywords, indentation)
Copy SQLCopy SQL to clipboard — useful when re-running in a separate query tool
Result tableView query results as a table
CSV downloadSave results as a CSV file
Result data is shown up to 100 rows. When the total exceeds 100, “Showing 100 of N rows” notice appears. Download CSV for the complete data.

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

ItemPostgreSQLMySQLOracleMSSQL/Synapse/FabricSQLiteSnowflakeBigQueryDatabricks
Identifier quoting"name"`name`"NAME"[name]"name""NAME"`name``name`
LIMIT expressionLIMIT nLIMIT nFETCH FIRST n ROWS ONLYTOP nLIMIT nLIMIT nLIMIT nLIMIT n
Date literal'2026-04-26''2026-04-26'TO_DATE('2026-04-26', 'YYYY-MM-DD')'2026-04-26''2026-04-26''2026-04-26'DATE '2026-04-26''2026-04-26'
Date format functionTO_CHAR()DATE_FORMAT()TO_CHAR()FORMAT()strftime()TO_CHAR()FORMAT_DATE()date_format()
Date arithmetic+ INTERVAL '1 day'DATE_ADD(d, INTERVAL 1 DAY)+ 1 (direct)DATEADD(day, 1, d)date(d, '+1 day')DATEADD(day, 1, d)DATE_ADD(d, INTERVAL 1 DAY)date_add(d, 1)
String concat||CONCAT()||+||||CONCAT()||
Empty string = NULL✓ ⚠️
Case-sensitive identifiersWhen quoted ✓Default ✗Uppercase by defaultDefault ✗When quoted ✓When quoted ✓Default ✗When quoted ✓

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:
-- ❌ All wrong patterns (Oracle)
WHERE col <> ''
WHERE col = ''
WHERE TRIM(col) <> ''
Correct usage:
-- ✅ Use NULL checks instead
WHERE col IS NOT NULL
WHERE TRIM(col) IS NOT NULL
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.
-- ❌ Fails on Oracle
WHERE created_at >= '2026-04-01'

-- ✅ Oracle recommended
WHERE created_at >= TO_DATE('2026-04-01', 'YYYY-MM-DD')
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.
-- ❌ Oracle doesn't support INTERVAL '1 day'
WHERE created_at >= SYSDATE - INTERVAL '1 day'

-- ✅ Oracle recommended
WHERE created_at >= SYSDATE - 1
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.
-- ❌ Fails on Oracle
SELECT plant_code AS 공장코드 FROM plants

-- ✅ Oracle recommended
SELECT plant_code AS "공장코드" FROM plants
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.
-- ❌ Oracle 12c minimum, or wrong usage
SELECT * FROM users LIMIT 10

-- ✅ Oracle 12c+
SELECT * FROM users FETCH FIRST 10 ROWS ONLY

-- ✅ Oracle 11g compatible (subquery)
SELECT * FROM (SELECT * FROM users) WHERE ROWNUM <= 10

Security

Read-only

DbSphere only executes SELECT queries. Data modification is not possible.
AllowedBlocked
SELECTINSERT, UPDATE, DELETE
Aggregate functions (COUNT, SUM, AVG)DROP, ALTER, TRUNCATE
JOIN, subqueriesCREATE, GRANT

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

CauseSolution
Network issueCheck firewall rules, VPN connection
Auth failureRe-verify account, password, permissions
Port blockedVerify the DB port is open
SSL configCheck SSL certificate requirements
CauseSolution
Insufficient schema descriptionAdd detailed descriptions for tables and columns
Business rules not reflectedAdd rules to Documentation memory
Related tables missingPick tables that need JOIN together
Ambiguous questionInclude specific conditions (date range, filters) in the question
No past reference queriesAdd correct query examples to SQL Example memory
CauseSolution
Large data volumeAdd conditions like date range to the question
Complex querySimplify the question or break into multiple
DB performanceOptimize indexes, check DB resources

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