Prompt Guide

Similar to talking to ChatGPT, Rasgo's AI understands some questions better than others. Here's a guide to craft the best possible question prompts for your data question.

Tips for Success

Tip: The more specific you can be, the better

Rasgo's AI is using your question to study its notes, pick the right table or tables, and then craft an accurate SQL query. That's a lot of steps! The more detail you can share in your prompt, the better AI will do at navigating that task. Details that can be helpful to include:

  • How should AI aggregate the data, if at all (i.e. Total, Average, Max, etc...)

  • Do you have an idea of what table or tables AI should look at? Even a guess can be helpful (i.e. "Use our Master Sales table")

  • Want your query to apply filters to the data? Include both the column and the values in that column you want to filter, if possible (i.e. "... for customer Acme Corp", where customer is the column and Acme Corp is the value in the customer column that you want to filter to)

Tip: Don't tell AI what NOT to do

Just like a 5 year old, you don't want to give AI the wrong ideas... It's not very good at discerning the "negative" instruction (i.e. "Don't use column ABC"). Instead, focus on telling AI what to do whenever possible (i.e. "Use a column starting with DEF").

Tip: When in doubt, you can always trust the "Mad Libs" prompt

If you're not sure where to start, this is a good template that very reliably translates to SQL:

Sum <Column A> and <Column B> by <Column C> for the current time period using <Date Column D>

Examples for Inspiration

Not OptimizedOptimizedNotes

sales for Acme Corp

total sales for Customer Name Acme Corp by month

  • "Total" tells AI to sum the sales, instead of selecting rows of transactions

  • Customer Name helps AI find the right column

top products based on growth

Top 10 products by total sales based on year over year change for current year vs previous year

  • "by total sales" tells AI what data to use to rank the products

  • "current year vs previous year" indicates the time ranges for calculating the growth rate

  • using terms like "current" and "previous" will result in analysis that is relative to the current date

  • if you prefer hard coded dates, you would instead say "for 2023 vs 2022"

what color products are popular

What are the top 10 most popular product colors based on number of orders for the current year to date

  • including a date range will help limit the data queried

  • "based on number of orders" tells AI what metric to use to approximate popularity

Rasgo AI Limitations

  • Rasgo AI, like all generative AI, is token limited. For that reason, we only let the AI see a preview of the query result (up to 100 rows).

  • Notes and descriptions that contradict each other or don't clearly identify data will either be ignored or will confuse the AI when it retrieves them from the metadata graph.

Last updated