> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Use AI to classify, enrich or translate a column

> Use Generative AI in Mammoth to classify, translate or summarise rows with a plain-English prompt. Covers limits, previews and your own OpenAI or Claude key.

**Generative AI** writes values into a column from a plain-English prompt, so you can classify, enrich, summarise, translate or reformat rows without leaving the Data Editor. Open a View, click the blue **+** button and choose **Generative AI** in the **AI Powered** category. The result is saved as a pipeline task, so it runs again whenever your data refreshes.

## Before you start

You don't need your own AI key. If your workspace has no external keys, Generative AI uses a key that Mammoth provides, and the panel shows no key selector.

To choose the provider and model yourself, a Workspace Owner can add an external key in **Workspace Settings** > **API Keys**. Once the workspace has at least one key, the panel shows an **API key selector** and you pick a key for each task. Supported providers are **OpenAI (ChatGPT)**, **Anthropic (Claude)**, **Google (Gemini)** and **xAI (Grok)**. See [Add your own AI provider key](#add-your-own-ai-provider-key).

## Open Generative AI

1. Open a View in the Data Editor.
2. Click the blue **+** button (tooltip "Add a task") in the action bar, or a **+** button in the Pipeline panel. The Transform menu opens on the **AI Powered** category.
3. Click **Generative AI**.

The panel opens at the bottom of the View.

![Transform menu open on AI Powered, listing AI SQL Query, Generative AI, Extract Text, Bulk Replace and Conditional Filter](https://mammoth.io/docs/images/20260605_093209_transform-picker1.webp)

![Generative AI panel with an empty prompt box, a column selector, an API key picker showing a Gemini key, and a Preview button](https://mammoth.io/docs/images/20260605_093345_genai-panel-main1.webp)

| Element | What it does |
| --- | --- |
| Prompt box | Describe the values you want in plain English |
| Limit note | "Max 300 chars per cell, applies only to the first 50,000 rows." |
| Column selector | Chooses which columns the AI sees as context (automatic or manual) |
| **API key selector** | Picks a saved external key and its provider. Shown only when the workspace has external keys. |
| **Preview** | Generates a sample without changing the dataset. Active once there is a prompt (and a key, if the workspace has keys). |
| **Apply results into** | Sets the destination column and whether it is new or existing |
| **Apply** | Runs on the full dataset and adds the pipeline task |

## Fill a column with AI from a prompt

1. Type your instruction in the prompt box. Say what you want and what the output should look like.
2. Choose the context columns, or leave automatic selection on.
3. If the workspace has keys, pick one in the **API key selector**.
4. Click **Preview** and check the 10 sample rows.
5. Under **Apply results into**, choose **New Column** and type a name, or choose **Existing Column** and pick one to overwrite.
6. Click **Apply**.

The new column appears in the grid, and a **Generative AI** task card appears in the Pipeline panel. How long it takes depends on the number of rows, the provider and the model.

![Pipeline panel with a Generative AI task showing its prompt and new column, and the data grid updated](https://mammoth.io/docs/images/20260605_094207_genai-apply-complete1.webp)

### Example prompts

| Goal | Example prompt |
| --- | --- |
| Classify | `Based on the Ship to Country, classify the shipping destination as Europe, UK, or Other` |
| Categorise | `Categorize the product description into one of: Electronics, Apparel, Home, Food` |
| Enrich | `Generate a short 1-sentence description of this product based on its name and category` |
| Translate | `Translate the customer comment from Spanish to English` |
| Normalise | `Standardize the company name: remove Inc, Ltd, LLC suffixes and trim whitespace` |
| Score | `Rate the sentiment of this review as Positive, Neutral, or Negative` |

Each value must be 300 characters or fewer. If the model returns longer values, the run fails with an error.

## Choose which columns the AI reads

The column selector sets which columns are sent to the AI with each row.

- **Auto select columns for evaluation**: Mammoth picks the columns most relevant to your prompt. If your prompt mentions "Ship to Country", that column is selected.
- **Manually select columns for evaluation**: pick the columns yourself. Use it when automatic selection picks columns that could confuse the model, when you want more consistent results, or when column names are similar.

More columns take longer to process. You can select up to 20. With more, the panel shows "25 columns selected. Max 20 allowed" until you remove some.

## Pick an API key (workspaces with their own keys)

This step applies only when your workspace has external keys. Without them, Mammoth uses its own key.

Click the **API key selector** to see the workspace's keys, grouped by provider. Each shows the provider's logo and name, and the key's display name. Select one.

![API key dropdown open in the Generative AI panel, listing an Anthropic key](https://mammoth.io/docs/images/20260605_093555_key-dropdown-all-keys1.webp)

If the key has a problem, such as a rate limit, a banner appears at the top of the panel.

## Preview AI results before you apply

Click **Preview** to generate 10 sample rows. Preview calls the AI provider with your prompt and context columns, and shows the output in a **Generated column**. It doesn't change your dataset or add a task.

![Generative AI panel with a prompt to classify shipping destination and a preview column of Europe and UK values](https://mammoth.io/docs/images/20260605_093734_genai-preview-results1.webp)

Generative AI doesn't use the live preview most functions show above the panel. Its **Preview** runs only when you click it, because each preview calls the AI provider.

## How Generative AI runs

When you click **Apply**, Mammoth:

1. takes your prompt and the context columns;
2. sends rows to the AI provider, using the selected external key or, without one, a key Mammoth provides;
3. writes the returned values into the output column.

The task re-runs on future dataset refreshes and whenever the pipeline runs again.

## Limits

| Limit | Value |
| --- | --- |
| Output per cell | 300 characters |
| Rows processed | The first 50,000 rows of the View. Rows after that are not processed. |
| Context columns | 20 |

See [Limits and quotas](https://mammoth.io/docs/learn/help/limits/) for all Generative AI limits.

## Add your own AI provider key

External API keys live in **Workspace Settings** > **API Keys**. Only Workspace Owners can add or remove them. Keys belong to the workspace, so all members can use them for AI features.

1. Open **Workspace Settings** and select **API Keys**. The **External API keys** card lists saved keys by name, with who added each and when. Open a row's menu to see the key's last four characters.
2. Click **Add external key**. The **Add External API Key** modal opens.
3. Click a provider card: **ChatGPT** (OpenAI), **Claude** (Anthropic), **Grok** (xAI) or **Gemini** (Google). Click **Next**.
4. Choose a model in the model dropdown.
5. Optional: expand **Preferences** to set model options (see below).
6. Type a **Key Name**. The placeholder shows the model name. Each name must be unique: "This key name already exists. Please try a different one."
7. Paste the key in **Paste API key**. The "How to get your Claude key" link (named for your provider) opens the provider's key documentation.
8. Click **Add External Key**. Mammoth checks the key when you submit.

![Add External API Key dialog in Workspace Settings, with provider choices ChatGPT, Claude, Grok and Gemini](https://mammoth.io/docs/images/20260605_094308_add-external-key-modal1.webp)

### Set model preferences

Click **Preferences** to see the options for the chosen model. Not every model offers every option. They apply to all Generative AI work that uses this key.

![Add External API Key dialog for Claude, with a model dropdown, Extended thinking, Web search and Batch API toggles](https://mammoth.io/docs/images/20260605_094521_add-key-preferences1.webp)

| Preference | What it does |
| --- | --- |
| **Extended thinking** | The model reasons longer before answering. Uses more tokens. |
| **Reasoning effort** | Sets how much reasoning the model applies, on models that support it |
| **Web search** | Lets the model search the web for current information |
| **Batch API** | Sends requests through the provider's Batch API. Results may be slower. |

### Providers and key formats

| Provider | Display name | Key starts with |
| --- | --- | --- |
| OpenAI | ChatGPT | `sk-proj-...` |
| Anthropic | Claude | `sk-ant-api03-...` |
| xAI | Grok | `xai-...` |
| Google | Gemini | `AIza...` |

The model dropdown lists the models you can choose. You can add several keys per provider, for example two Gemini keys, one for production and one for testing, and switch between them in the key selector.

### Remove or replace a key

Open the key's row menu and select **Remove**. The key is deleted for good, and pipeline tasks that use it fail until another key is selected.

Once saved, a key is shown masked and can't be changed. To replace an expired or exposed key, remove it and add a new one.

For the rest of the **API Keys** settings, see [Workspace settings](https://mammoth.io/docs/learn/workspace/settings/).

## Troubleshooting

| Symptom | Cause | Fix |
| --- | --- | --- |
| "Your Google Gemini key has exceeded its rate limit. Please try again in a few minutes." | The selected key hit the provider's rate limit | Wait a few minutes, or pick another key from the same or another provider |
| "The Claude key is invalid." | The key failed validation | Check the key. Keys only work with their own provider, so make sure you pasted it under the right one. |
| A message says the account has no quota left | The provider account has no balance | Add funds in the provider's dashboard, or add a key from another account |
| The run fails with an error about length | A returned value is over 300 characters | Ask for shorter output in the prompt |
| Only part of the View has values | Only the first 50,000 rows are processed | Filter the View to 50,000 rows or fewer before this step |
| **Apply** stays off | No column name, no prompt, or no key selected in a workspace with keys | Fill in the missing item |
| Results don't match what you meant | The prompt is unclear | Make it more specific, check a few rows, and compare with a manual step |

## Related

- [Write SQL with AI](https://mammoth.io/docs/learn/clean-and-shape/sql-with-ai/): query and reshape the whole View in plain English.
- [Extract text, change case and parse JSON](https://mammoth.io/docs/learn/clean-and-shape/text-and-json/): pattern-based text work, including Custom Prompt.
- [Workspace settings](https://mammoth.io/docs/learn/workspace/settings/): the full API Keys section.
- [Limits and quotas](https://mammoth.io/docs/learn/help/limits/): every AI limit in one place.
- [How the pipeline works](https://mammoth.io/docs/learn/clean-and-shape/how-the-pipeline-works/): how tasks re-run on refresh.

---
Source: https://mammoth.io/docs/learn/clean-and-shape/ai-on-columns.md · Updated: 2026-11-08
