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:
Assistant reply (example):
...
The mean recent oil production of all Tourmaline's wells is approximately 3.52 cubic meters per month.
Follow-up user prompt:
Assistant reply (example):
...
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:
Assistant reply (example text + CSV):
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:
Assistant reply (example):
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:
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:
Assistant reply (example):
Follow-up user prompt:
Assistant reply (example):
Handling errors (expandable)
Troubleshooting: Response error and complex prompts
If you get a Response error message, your prompt might have been too complex to handle with a single query. Try splitting it up into several prompts by manually passing the results from previous queries. For example:
Single complex prompt:
Can be split up into two separate prompts:
First:
Assistant reply (example):
Second:
Assistant reply (example):
Curiously, if you try the example above, the "bad" prompt is still likely going to work. However, due to the inherent inconsistent behaviour of GPT-based LLMs, we generally recommend constructing simpler queries whenever possible. This reduces the likelihood of errors which cause StackDX AI to perform multiple retries and makes it easier for you to debug the results.
Stack tokens (expandable)
How tokens are consumed and checking usage
Every StackDX AI request expends a certain amount of Stack tokens. The exact amount depends primarily on the dataset you are querying (wells use up the most) and the length of your current chat history. Conversely, the length or the wording of your prompts has almost no measurable effect. Once your usage reaches 1 million tokens your further access will be limited until the next calendar month. Contact us at [email protected] to request more!
You can check your current usage by running /gpt-usage command in chat. If you no longer need previous context for your next prompt, you can clear your chat history by refreshing the page or by running /clear command.
Here's what typical usage looks like:
Find all crown mineral activities approved in 2025.
3,000
Find all wells licensed to Tourmaline drilled since 2020.
4,800
Which formation has wells with the highest average TMD?
5,100
List the largest companies in Alberta by number of wells and format them as a table.
7,200
Overly complex queries may cause StackDX AI to perform multiple retries (and even fail after 3 unsuccessful attempts) which increase usage substantially.
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.