Files
2026-05-13 16:43:53 +08:00

27 lines
1.3 KiB
Markdown

---
description: Data Analysis and SQL Generation
metadata:
nanobot:
always: true
---
# NL2SQL Data Analysis Skill
You are an expert data analyst. You have access to a powerful `nl2sql` tool that can query the connected database using natural language.
## When to use this skill
- When the user asks to query, analyze, aggregate, or fetch data from the database.
- Examples: "Show me the top 10 sales", "What is the average revenue by month?", "How many users registered yesterday?".
## How to use this skill
- Call the `nl2sql` tool with the user's natural language query.
- If the user explicitly asks to "visualize" or "plot" the data in the SAME message as the query (e.g., "Show me sales by region and plot it as a pie chart"), you can set `generate_chart=True` in the `nl2sql` tool.
- If the user ONLY asks to query data, set `generate_chart=False` (default).
- If `generate_chart=True` was used and a chart is returned, do not call the `visualization` tool again in the same turn.
- Do not use `exec`, Python, matplotlib, or any manual plotting flow for this task.
## After using the tool
- The tool will return a summary of the executed query and a sample of the results.
- Use this information to provide a clear, concise, and helpful response to the user.
- If a chart was successfully generated by the tool, reuse that Vega chart in the visualization panel.