This doc provides some basic recomendations on how to prompt Ana in her two main interfaces:

Ana Chat Best Practices

  • 🤖 Treat Ana as you would a coworker: Have interactive conversations to clarify or refine requests, just as you would with a real analyst.

  • 🧩 Break complex requests into smaller steps: Language models can get overwhelmed when given too many steps at once.

  • Ask follow-up questions: This helps uncover deeper insights or correct misunderstandings along the way.

  • 📈 Request charts and visualizations: These can be easy ways to understand data and insights, as well as verify Ana’s assumptions.

  • Expect occasional misunderstandings or assumptions: Ana might interpret questions differently, so be prepared to rephrase or specify your request when needed.

  • 🔄 If a chat gets too long or isn’t going well, start fresh: Ana has access to many tools and may stumble when handling too many things at once. Sometimes, the best solution is to start a new chat.

TextQL Agents Best Practices

  • 📝 Write comprehensive prompts: TextQL agents are designed for deep asynconous analysis, triggered on an event or schedule. Unlike Ana chats, which are designed to expect followup messages, TextQL Agents generally assume that you have you have provided a comprehensive descrition of the task (at a high level), so that they can continually work without the need to ask for clarifying questions. To that end, Agents tend to perform best with long prompts, that include as many steps, actions, and corner cases as the user is aware of. After an Agent completes its action, you will have the option of continueing the agent conversation with followup messages through the chat interface.

  • 🕵️‍♀️ Preview your analysis before activating the agent: Previewing agent runs allows you to quickly iterate and refine your prompt, ensuring your agent is able to reliably execute your desired task. Generally, we recomend running atleast 3 previews before activating your agent.

  • 🎁 Attach any relevant datasets you’re aware of: If you believe that an Agent will regularly use a partiular dataset of interest, you should attach that dataset explicitly to the agent at setup time. This helps reduce ambiguity and streamline the Agent’s planning at runtime. If you aren’t aware of any such datasets, or you have low farmilirarity with your companies datawarehouse, you can safely disregard this step/ TextQL Agents have the ability to search your datawarehouse at runtime to identify the data of interest relevant to your query, it just might take longer to get to the result.

Sample Agent Prompt Template
You are making a daily report on chats with our product from the previous day.  

Here are two datasets "Chat" and "Chat Cell." Chats are identified by their url (which is unique to each chat). Chat cells describe messages in a chat - and for one chat url there will be many cells. use the time stamps on chat cells to determine the order in which they were sent.  Chat cells have a cell type that determines what kind of cell they are, the report needs information about the PythonCell type particularly, you'll see below in the example.

## Sample report
Here is a sample showing the EXACT format that I want for the report.  These are the exact questions I want you to answer for me - do not have other data on the report at this time:

📊 **Yesterday's Report (01/07)**

- **Total Chats:** 18 ⬇️ *(-26 compared to day before)*
- **Number of Failures:** 1 ⬆️ *(+1 compared to day before)*
- **Average Chat Length:** 23  ➡️ *(No change)*
- **Total Python Cells:** 50 ⬇️ *(-103 compared to day before)*
- **Total Lines of Python Written:** 508 ⬇️ *(-1267 compared to day before)*
- **Average Length of PythonCell:** 10 ➡️ *(No change)*

Additionally, note that this is just a sample, and the date isn't today's: this sample is an old report from many weeks ago.  Use the actual value of yesterday date for your analysis.

## Formatting Instructions
- Round any decimal to the nearest integer. Do this before doing the up/ down comparisons.
- In the case of 0 change, I don't want to see the accident, eg, ⬇️ (-0 compared to day before). so make sure you first aggregate columns by day (including, eg, the average number per day). Then round. and then do the comparison in the report, so that we only ever see, eg, 0 ➡️ *(No change)*.

## How to approach
- First determine todays date, yestredays date, and the date of the day before yestreday. note, you should not use any data from today in your analysis. You were asked to compare the data from yesterday to the day before.
- inspect the data, then use the analyze mode to right python that aggregates these metrics by date.  Round and decimals to the nearest integer, and then compute the difference between yesterday's data and the data from the day before.  finally, send back the report. Note: Do not stop working until you have answered all questions and the report is generated.