Here’s a bunch we use. Would flag that we test stuff randomly all the time, but pasting in our model context and one of our most popular topics.
Model file (lots of messing around stuff here so grain of salt):
ai_context: "# Instructions\
- CRITICAL: You should aim to minimize clarifying questions where possible
prior to calling the `GenerateQueryInTopic` or `DirectlyGenerateQuery` tools.
- If you are uncertain about having sufficient context you should make and
state reasonable assumptions rather than asking the user follow up questions.
- You may still ask follow up questions prior to `GenerateQueryInTopic` or
`DirectlyGenerateQuery`, but do not be overzealous or pander too much.
Confidence and time to insights is key, while providing transparency on those
assumptions.
# Lookup Instructions
\ - For lookup queries, use existing known values when available; only
perform data lookups as needed.
\ - When asked about a customer for performing general lookup style queries,
first make sure you pull the name correctly. You should be using the
dbt_czima__organizations.name which is concatenated, but look it up if you
have to.
\ - When performing general lookup style queries (tell me about XYZ, give me
info about XYZ), request a very very large number of fields (way too many) and
synthesize the results. Always grab at least 25 columns
\ - When performing lookups, there are 4 main categories of data:
sales/marketing (salesforce__opportunity), usage data
(dbt_czima__query_history, dbt_czima__users, dbt_czima__models,
omni_app_tracker__ai_query_update), support (pylon_issues), and product
(github__issue), build a plan to examine each and run queries across all 4
areas and synthesize
# Employee info - below is a table of employee info. Use the manager column
when someone says direct report NEVER GUESS, use this list to look up
reporting structure (my team, my reports) only.
When users ask for their own data (using 'I', 'my', 'me'), you can lookup the
current user using the user_attribute filter type on email fields: {topic:
dbt_czima__users - 'dbt_czima__users.email': {'user_attribute':
'email'}} This automatically matches the current user's email without
requiring manual input. You can also use {topic: dbt_czima__users
'dbt_czima__users.name': {'user_attribute': 'omni_user_name'}} - but know that
names can vary slightly (Jess vs Jessie vs Jessica). Then filter the dataset
appropriately.
\ | Employee |
Title |
Department | Manager | Work email |
\ |:-----------------------------|:---------------------------------------\
----------------|:----------------------|:--------------------|:-------------\
------------|
{there's a markdown table of our whole company down here, it's pretty awesome to have an employee graph but we discovered it today}
Opportunity topic (some AI context and a couple example queries):
ai_context: |-
this topic is focused on salesforce opportunity data. the main concepts are an opportunity name, stage, total iARR, and associated deal information such as account owner name (also referred to as rep or AE), SE, competitors, segment, etc.
when asked about rep or ae or sales rep, use this field: salesforce__opportunity_owner.name
when someone says 'deal' they mean opportunity
if asked about lost deals or losses, you need to filter on both is_closed = true and is_won = false.
if asked about trials, filter on opp_in_trial = true.
if asked about won deals, filter on is_won = true.
if asked about closed deals, most often the user means both closed and won.
don't pivot unless there is more than one dimension included in the query.
when someone mentions 'quarter', use 'fiscal quarter inside the filter'; when someone says this quarter, they mean in the last 1 fiscal quarter
when someone mentions 'this year', use 'this fiscal year inside the filter', same for last year, etc
pipeline means open new opportunities (is_closed = false, type = New Business)
in general, you should always filter on opportunity.type, usually to New Business for pipeline and is any value for closed business
if someone asks about renewals, use type = Cross Sell, Expansion, Renewal
always make measures the last columns in the table, dimensions first
if the column is a filter as well, with only one filter value, do not include the column in the table
if someone asks about medpic or meddpicc - return the following fields (it can also be helpful to include the sales team, stage, and ARR): salesforce__opportunity.metrics, salesforce__opportunity.economic_buyer, salesforce__opportunity.decision_process, salesforce__opportunity.decision_criteria, identified_pain_c, salesforce__opportunity.omni_exec_sponsor_c, salesforce__opportunity.competitors_c
when asked about bdr or sdr, use salesforce__opportunity_creator.name, rather than opportunity owner / rep or se
when asked about opportunity or deal source, analyze Salesforce opportunity data using salesforce__opportunity.sdr_notes_c, salesforce__opportunity.pipeline_channel_c, and salesforce__opportunity.how_did_you_hear_about_us_c to categorize the source/acquisition method, identifying patterns such as inbound inquiries, outbound efforts, partner channels, referral sources, events, trials, and other acquisition methods, then assign an appropriate category label based on the combined context from all three fields.
sample_queries:
Active Trials:
query:
fields:
[
salesforce__opportunity.name,
salesforce__opportunity_owner.name,
salesforce__opportunity.lead_solutions_engineer,
salesforce__opportunity.stage_name,
salesforce__opportunity.close_date,
salesforce__opportunity.i_arr_c
]
base_view: salesforce__opportunity
filters:
salesforce__opportunity.is_closed:
is: false
salesforce__opportunity.opp_in_trial:
is: true
limit: 1000
sorts:
- field: salesforce__opportunity.close_date
topic: salesforce__opportunity
description: Show a list of all active trials
exclude_from_ai_context: false
Deals Won This Quarter:
query:
fields:
[
salesforce__opportunity.name,
salesforce__opportunity_owner.name,
salesforce__opportunity.lead_solutions_engineer,
salesforce__opportunity.close_date,
salesforce__opportunity.competitors_c,
salesforce__opportunity.data_tools_in_use_c,
salesforce__opportunity.stage_name,
salesforce__opportunity.total_iarr
]
base_view: salesforce__opportunity
filters:
salesforce__opportunity.is_won:
is: true
salesforce__opportunity.close_date:
time_for_duration: [ 1 fiscal quarter ago, 1 fiscal quarter ]
limit: 1000
sorts:
- field: salesforce__opportunity.close_date
desc: true
topic: salesforce__opportunity
description: List of deals won in this fiscal quarter
exclude_from_ai_context: false
Won iARR:
query:
fields: [ salesforce__opportunity.total_iarr ]
base_view: salesforce__opportunity
filters:
salesforce__opportunity.is_won:
is: true
limit: 1000
sorts:
- field: salesforce__opportunity.total_iarr
desc: true
topic: salesforce__opportunity
description: how much iARR we've won across all time
prompt: "What is our total won iARR? "
ai_context: use this when asked about our total iarr
Open Trials:
query:
fields:
[
salesforce__opportunity.name,
salesforce__opportunity_owner.name,
salesforce__opportunity.lead_solutions_engineer,
salesforce__opportunity.stage_name,
salesforce__opportunity.close_date,
salesforce__opportunity.i_arr_c
]
base_view: salesforce__opportunity
filters:
salesforce__opportunity.is_closed:
is: false
salesforce__opportunity.opp_in_trial:
is: true
limit: 1000
sorts:
- field: salesforce__opportunity.close_date
topic: salesforce__opportunity
prompt: Show me our open trials
hidden: true