StackDX AI Queries
StackDX AI is a powerful tool that lets you query our core datasets with natural language. With correct prompts, you can construct complex queries and get detailed reports in a matter of seconds, which was previously unattainable with traditional user interfaces.
Datasets currently supported: Canadian and US wells, pipelines, facilities, mineral rights, crown mineral activity, and surface dispositions.
Getting started
The quickest way to open StackDX AI interface is the Ctrl + ~ shortcut (Cmd + ~ on MacOS). Additionally, this shortcut allows you to instantly switch back and forth between your workspace and the chat.
Once the chat is open, enter an actionable prompt/question that specifies which dataset you are querying (e.g. wells) and what data you are after. StackDX AI will not be able to provide meaningful answers for questions that are too generic. For example, instead of asking "How do I query by licensee?" you can say:
Find all wells licensed to Tourmaline.You can query any data that's available in the table and on the map but detailed info such as well completions history is currently not available. Note that the assistant does not have any context about your workspace so you'll need to provide it with input data directly. For example, instead of asking "What producing formations my list is in?" you can say:
What producing formations are these wells in?
100022705212W500
100012705212W500
100013405212W500
...How it works
Behind the scenes, StackDX AI leverages an LLM to perform the following operations for every user prompt:
Aggregate & summarize
If the request required some form of data aggregation, pass the first 50 results from the output back into the model to summarize it in a formatted text response. This result will only show up in your chat and won't be displayed on the map.
How to use
The SQL generation step produces its full introspection which you can access by clicking the "See technical details" button. If you spot an error or an incorrect assumption in the model's approach, you can guide it to correct itself in a follow-up message. For example:
User prompt:
Calculate mean recent oil production of all Tourmaline's wells.Assistant reply (example):
SELECT AVG(recent_oil) AS mean_recent_oil FROM sql_table WHERE
LOWER(licensee::text) ILIKE '%tourmaline%';...
The mean recent oil production of all Tourmaline's wells is approximately 3.52 cubic meters per month.
Follow-up user prompt:
Exclude all zero values from your calculation.Assistant reply (example):
SELECT AVG(recent_oil) AS mean_recent_oil FROM sql_table WHERE
LOWER(licensee::text) ILIKE '%tourmaline%' AND recent_oil > 0;...
The mean recent oil production of all Tourmaline's wells, excluding zero values, is approximately 101.01 cubic meters per month.
Note that StackDX AI currently has very limited access to production data: only "recent" fields for the latest monthly volumes and "cumulative" fields are available.
For data aggregation queries, you can specify the exact format you'd like to receive the data in. Only text-based formats are supported. For example:
User prompt:
Get top 10 wells by cumulative gas production and output them as a CSV with UWI, Licensee, and production columns.Assistant reply (example text + CSV):
Here are the top 10 wells by cumulative gas production, along with their UWI, licensee, and cumulative production values. The data is also formatted as a CSV for your convenience:
UWI,Licensee,Cumulative Gas (e3m3)
102112204416W500,Tidewater Midstream and Infrastructure Ltd.,9526807
100092403610W500,Cavvy Production Ltd.,9332082
1W0120900330W400,Shell Canada Limited,9215807
...Note that all textual responses are limited to a maximum of 50 results for cost and performance reasons.
Technical users can leverage the full spectrum of Polars SQL SELECT functionality by explicitly instructing StackDX AI to include certain expressions. For example, to find all wells whose licensees consist of exactly 8-character long words:
User prompt:
Find all wells whose licensees match the following regex: `^(?:[^[:space:]]{8})(?:[[:space:]]+[^[:space:]]{8})*$`Assistant reply (example):
_Retrieves 15 wells licensed to Paterson Theodore, Crawford Sawmills, and Novacorp._While it is trivial for StackDX AI to match all company names that are exactly 8 characters long, it struggles to come up with the correct syntax to match names with multiple conforming words. An explicit instruction above helps it overcome this limitation.
Calculations and conversions
You can ask the assistant to run mathematical operations on the data. Some common conversions are supported out of the box: you can ask for production volumes in BOE, convert monthly values to daily, or request aggregation results in imperial units. For more complex or ambiguous conversions it may be beneficial to include the formulas in your prompt:
User prompt:
Find top 3 active wells in Montney formation by recent GOR. Output as a table with UWI, Field, and GOR in scf/stb. Calculate GOR as 35,315 e3m3/6.2898 m3 * gas/oil. Exclude all wells whose oil or gas volumes are zero.Assistant reply (example table):
100010707507W600
LA GLACE
7,009,884.5
103161507601W603
PEORIA
1,809,787.375
100110207721W500
GIROUXVILLE EAST
1,265,541.125
StackDX AI also supports simple geographic queries. You can always refine the results by providing more technical instructions as a follow-up:
User prompt:
Find all wells in a 5 km radius around 102160207808W600.Assistant reply (example):
_Retrieves 181 wells centered on 102/16-2-78-8W6/00 bottom location via flat-earth distance approximation._Follow-up user prompt:
Could you recalculate using Haversine formula?Assistant reply (example):
_Retrieves the same 181 wells by applying Haversine formula._Handling errors (expandable)
Stack tokens (expandable)
We'd love to hear from you!
If you have any questions or feedback about StackDX AI, send us an email to [email protected]. We are also happy to hear if you found this article helpful or if we missed something you'd like us to cover.