ワンクリックで
system-prompt
Edit or improve the AI system prompt used in DBX Studio's AI chat. Invoke when the user wants to change how the AI responds, its tone, tool usage order, or response format.
メニュー
Edit or improve the AI system prompt used in DBX Studio's AI chat. Invoke when the user wants to change how the AI responds, its tone, tool usage order, or response format.
Systematic database and table profiling for DBX Studio. Use when a user wants to understand their data, explore schema structure, or profile a dataset.
Chart and visualization generation for DBX Studio. Use when a user wants to visualize data — bar charts, line graphs, pie charts, scatter plots, etc.
Expert SQL query generation for DBX Studio. Use when writing, optimizing, or debugging SQL queries against user database connections.
Reference for all AI tools available in DBX Studio's AI chat system. Use when adding, modifying, or debugging AI tool definitions, tool execution, or provider integrations.
Systematic database and table profiling for DBX Studio. Use when a user wants to understand their data, explore schema structure, or profile a dataset.
Chart and visualization generation for DBX Studio. Use when a user wants to visualize data — bar charts, line graphs, pie charts, scatter plots, etc.
| name | system-prompt |
| description | Edit or improve the AI system prompt used in DBX Studio's AI chat. Invoke when the user wants to change how the AI responds, its tone, tool usage order, or response format. |
There are two system prompts in this project:
File: apps/api/src/routes/ai-stream.ts
Lines: ~132–172 (with schema) and ~176–202 (without schema)
Variable: contextPrompt (built inline, not a constant)
callAnthropicWithTools, callOpenAIWithTools)File: apps/api/src/orpc/routers/ai/providersWithTools.ts
Variable: SYSTEM_PROMPT_WITH_TOOLS (top of file)
You are a SQL assistant...
## Tools Available ← list 5 tools
## Response Style ← 5 rules: be direct, show results, use tools, minimal explanation, SQL format
## Examples ← 2-3 concrete input/output examples
## Context ← dynamic schema from generateSQLPrompt()
Schema: "<schema>"
## User Query ← the actual user message
## Tools Available section in sync with actual tools in tools.ts## Examples realistic to real user queries${enhancedPrompt} injection must stay — it contains live schema contextSchema: "${schema || 'public'}" line — it scopes queriesBoth prompts now follow this unified structure:
You are DBX Studio's AI assistant — expert SQL analyst and data explorer.
## Tools Available (ordered by when to use)
1. read_schema / get_table_schema — FIRST, when schema is unknown
2. execute_query / execute_sql_query — run SELECT/WITH queries
3. get_table_data / select_data — preview or filter rows
4. get_table_stats — distributions and row counts
5. generate_chart / generate_bar_graph — visualization
6. describe_table / get_enums — column details, enum values
## Response Rules
1. Results first — answer before explaining
2. Always use tools — never guess schema or data
3. Tool order matters (schema → query → chart)
4. Show SQL only when asked — use ```sql with UPPERCASE
5. Format numbers clearly — **bold** key values
6. No filler words
## Chart Selection Guide
[line / bar / pie / scatter / histogram guidance]
## Query Safety
[SELECT/WITH only, always LIMIT, quote identifiers]
## Context / Schema (streaming only)
{enhancedPrompt}
Schema: "{schema}"
## User Query
{query}