Natural Language Prompts
The power of Billx-Agent lies in its ability to turn everyday language into valid, secure SQL queries. To get the most accurate and useful results, follow these guidelines when crafting your prompts.
✅ DO
✔️ Be Clear and Specific
Use straightforward, targeted prompts:
"Show me sales for Q1 2024 by product"
This helps the LLM accurately identify the intent and generate the correct SQL.
✔️ Use Common Data Terms
Use language that maps clearly to database fields:
date,total,amount,quantity,status,region, etc.
"What is the total amount of orders by region?"
✔️ Add Filters Where Needed
Use natural filter expressions to scope your data:
"List orders over $500 from March"
"Show users who signed up in the last 30 days"
✔️ Use Defined Timeframes
The AI understands relative timeframes such as:
"last 7 days""current month""past year""first quarter of 2023"
❌ AVOID
❌ Vague or Open-Ended Prompts
Avoid prompts that lack a specific objective:
"Give me something interesting""Analyze the data""What can you tell me?"
These don’t map clearly to SQL logic and may produce errors or generic output.
❌ Requests That Imply Write Access
Billx-Agent only supports read-only SQL (SELECT queries). Do not request modifications:
"Delete old orders""Update all user emails""Insert a new record"
Such queries will be blocked for safety.
❌ Prompt Overload
Avoid stacking too many conditions or objectives into one prompt:
"Show sales, profit, inventory, and shipment delays for all products in 3 regions, excluding weekends, and grouped by supplier and month"
🧠 Tip: Break large queries into multiple, focused prompts.
✅ A well-phrased prompt = faster results, cleaner SQL, and lower token usage.
Last updated