> For the complete documentation index, see [llms.txt](https://docs.getmesa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getmesa.com/tools/ai.md).

# AI

MESA's **AI** tool uses the power of Artificial Intelligence to automatically generate, classify, and analyze your data.

The AI tool is powered by ChatGPT and does not require an OpenAI account to access its AI functionality.

{% hint style="warning" %}
AI uses Premium tasks. [Learn more](https://docs.getmesa.com/going-further/plans-and-billing#premium-steps)
{% endhint %}

## Configure <a href="#action" id="action"></a>

### Skill triggered <a href="#action" id="action"></a>

The AI Skill triggered trigger lets you supercharge your AI prompts by calling MESA workflows to fetch information and take action.

Get started by creating a workflow in MESA with the AI Skill triggered trigger. Then, let your AI app know about the MESA AI Skill and start chatting. In the steps below, we use Claude Desktop, but AI Skill triggered also supports Cursor and many other AI apps.

### Actions <a href="#action" id="action"></a>

The AI tool includes several defined actions to quickly get you started with common tasks like summarizing, categorizing, and extracting details from your free-form text.

<figure><img src="/files/gECwX9xQDT0Hw86dXpkr" alt="Screenshot of the MESA AI tool step showing its defined actions for common tasks like summarizing, categorizing, and extracting details. Spotlight the AI action selector dropdown."><figcaption></figcaption></figure>

### Prompts <a href="#examples" id="examples"></a>

Provide a prompt to generate a text response within the AI actions. Use the examples below as a starting point. For additional specificity, replace the details in the prompts with MESA Variables from previous steps in your workflow.

![Screenshot of the MESA AI Prompt action configuration where you provide a prompt to generate a text response. Spotlight the prompt input field.](/files/ygVJ2YIGwk0QzBhfgs4u)

```
Write a tagline for an ice cream shop.
```

<figure><img src="/files/GvCuKr2tQyT7k1d43GJE" alt="Screenshot of the MESA AI Prompt action with the prompt Write a tagline for an ice cream shop. Spotlight the generated prompt output."><figcaption></figcaption></figure>

```
Write a thank you letter in the form of a poem for John Doe who purchased a Special Agent Widget.
```

<figure><img src="/files/yKCZijGY1luxkSUwZpu0" alt="Screenshot of the MESA AI Prompt action with a prompt to write a thank you letter as a poem for John Doe who purchased a Special Agent Widget. Spotlight the generated prompt output."><figcaption></figcaption></figure>

```
Write a product description for wooden clogs.
```

<figure><img src="/files/yC1xZafQGLYRQSJft2w7" alt="Screenshot of the MESA AI Prompt action with the prompt Write a product description for wooden clogs. Spotlight the generated prompt output."><figcaption></figcaption></figure>

```
Write a blog post to announce our new glow in the dark ice cream.
```

<figure><img src="/files/EHQhObBDPX7B7GqfaxSj" alt="Screenshot of the MESA AI Prompt action with a prompt to write a blog post announcing new glow in the dark ice cream. Spotlight the generated prompt output."><figcaption></figcaption></figure>

### Summarize

This AI action will generate a short summary from paragraph(s) of text.

```
Determine if this is a physical address. Return yes or no.

PO Box 100
1010 NE Main Street
Springfield, MA, 12352
```

<figure><img src="/files/aofCpjGBR6JtXIzOSryl" alt="Screenshot of the MESA AI Summarize action determining whether the PO Box 100 address is a physical address, returning yes or no. Spotlight the generated prompt output."><figcaption></figcaption></figure>

```
Determine if this address is in Europe. Return yes or no.

1010 NE Main Street
Springfield, MA, 12352
```

<figure><img src="/files/17UKqxINFWmTdDUdgRyQ" alt="Screenshot of the MESA AI Summarize action determining whether the Springfield address is in Europe, returning yes or no. Spotlight the generated prompt output."><figcaption></figcaption></figure>

```
Determine the gender of this name. Return male, female or unknown:

Alexis Doe
```

<figure><img src="/files/YEZRkmtsESzV3q7parm5" alt="Screenshot of the MESA AI Summarize action determining the gender of the name Alexis Doe, returning male, female or unknown. Spotlight the generated prompt output."><figcaption></figcaption></figure>

## Going Further <a href="#limitations" id="limitations"></a>

Check the Advanced > Convert JSON response checkbox on a Prompt step and add a [Loop](https://docs.getmesa.com/tools/loop) step to loop over each result in this prompt:

```
A two-column spreadsheet of top science fiction movies and the year of release. 

Title,
Year of release

Return as json
```

### Other Kinds of AI Steps

There are a multitude of AI actions that are more specific than Prompt or Summarize. [Click here ](https://www.getmesa.com/templates?cat=AI)for our existing AI templates for a few ideas.

If none of these actions match what you're trying to do, the Prompt action lets you use any GPT4o-style prompt to fully unlock the potential of artificial intelligence. [OpenAI's example page](https://platform.openai.com/examples/) is an excellent source of inspiration, and the [OpenAI Playground](https://platform.openai.com/playground?mode=chat\&model=gpt-4o) is the easiest way to test and perfect your prompts.

{% hint style="info" %}
We recommend adding an [Approval](https://docs.getmesa.com/tools/approvals) step in your workflow to verify that the prompt output meets your expectations. This is especially useful when fine-tuning your prompt to achieve the desired results.
{% endhint %}

### More Resources <a href="#limitations" id="limitations"></a>

* OpenAI's [Text completion docs](https://platform.openai.com/docs/guides/text-generation) provide examples and best practices around writing prompts.

## Technical Notes <a href="#limitations" id="limitations"></a>

**What is the AI tool powered by?**

The AI tool is powered by ChatGPT-4o.

**Why should you use ChatGPT (or another service like Claude) instead of MESA's AI-built-in tool?**

* ChatGPT reduces MESA premium task usage. Actions associated with Email, SMS, Image, Weather, and AI are Premium steps because we incur the cost of these.
* ChatGPT supports more advanced queries
* The AI tool only reads and generates up to 500 words of text. Input text will be truncated after 500 words, and responses will be limited to around 500 words. If you need to analyze or generate long amounts of text, we recommend using MESA's OpenAI app, which allows you to customize the number of tokens to use for each prompt. Most prompts can be copied over from an AI step to an OpenAI prompt step.
* ChatGPT allows you to use your own fine-tuned model

### How AI Uses Your Data <a href="#data-security" id="data-security"></a>

The AI tool makes API calls to OpenAI. Only the variables explicitly configured in the MESA builder will be shared with OpenAI. MESA does not store any of this information beyond your data retention date. OpenAI does not use data submitted to and generated by their API to train OpenAI models or improve OpenAI's service offering.

To opt out of any data sharing with AI models, simply do not use the AI step in any of your workflows.

Learn more about how and when OpenAI is used to train their models: [MESA's Data Processing Agreement](https://www.getmesa.com/dpa).
