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

# Generative AI

> Use Generative AI in Mammoth to classify, enrich, translate or summarize rows with a plain-English prompt and your own AI provider key, saved as a task.

Generative AI is a Transform function that lets you describe what you want in plain English and have an AI model write the values for you, directly in your dataset. Use it to classify, enrich, summarize, translate, reformat, or generate new content from your existing columns, without leaving the Data Editor.

The results are added as a column and saved as a reusable pipeline task, so they re-run automatically whenever your data refreshes.

## Before you start

Generative AI uses your own AI provider API key. A Workspace Owner must add at least one external key in [Workspace Settings → API Keys](https://docs.mammoth.io/learn/workspace-management/workspace-settings/#external-api-keys) before anyone on the workspace can use this feature.

Supported providers are **OpenAI (ChatGPT)**, **Anthropic (Claude)**, **Google (Gemini)** and **xAI (Grok)**. For setup steps, see [Adding an external API key](#adding-an-external-api-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.
3. The Transform menu opens on the **AI Powered** category.
4. Click **Generative AI**.

The Generative AI 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://docs.mammoth.io/api/v1/images/20260605_093209_transform-picker1.jpg)

## Generative AI panel

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

| Element | Description |
| --- | --- |
| **Prompt textarea** | Describe the content you want to generate in plain English |
| **Constraint note** | Reminder: "Max 300 chars per cell, applies only to the first 50,000 rows." |
| **Column selector** | Chooses which existing columns to pass as context to the AI model (auto or manual) |
| **API key selector** | Selects which saved external key (and AI provider) to use |
| **Preview** | Generates a sample without writing to the dataset—active once prompt and key are set |
| **Apply results into** | Sets the destination column name and whether to create a new column or write into an existing one |
| **Apply** | Runs generation on the full dataset and adds the pipeline task |

## Write a prompt

Type your instruction in the **prompt textarea**. Be specific about what you want and what the output should look like.

Example prompts:

| Goal | Example prompt |
| --- | --- |
| Classify | `Based on the Ship to Country, classify the shipping destination as Europe, UK, or Other` |
| Categorize | `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` |
| Normalize | `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 generated value must be 300 characters or fewer; if the model returns longer values, the run fails with an error.

## Select context columns

The column selector controls which columns from your dataset are passed to the AI model alongside each prompt. The model uses these columns as context when generating values.

**Auto select columns for evaluation**—Mammoth automatically identifies the columns most relevant to your prompt. For most prompts this works well; Mammoth picks up column names that match your intent (e.g., if your prompt mentions "Ship to Country", that column is auto-selected).

**Manually select columns for evaluation**—Switch the column selector to manual selection to pick specific columns yourself. Evaluating more columns increases processing time. Use this when:

- Auto-selection picks up irrelevant columns that could confuse the model
- You want to limit context to keep generations consistent
- You have columns with similar names and need to be precise

Up to 20 columns can be selected as context.

## Select an API key

Click the **API key selector** to see all external keys saved in your workspace, grouped by provider.

Each key shows:

- Provider logo and name
- Key display name

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

Select a key to use it. If the selected key has a problem such as a rate limit, a banner appears at the top of the panel.

If no keys are saved in the workspace, a banner appears with a link to add one.

## Preview results

Before applying to your full dataset, click **Preview** to generate a sample of 10 rows. Preview:

- Calls the AI provider with your prompt and context columns
- Returns sample output in a preview table with a **Generated column**
- Does not modify your dataset or count as an applied task

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

Use preview to verify the output matches your expectation before committing to the full dataset.

## Configure output

Below the key selector, **Apply results into** controls where results are written.

- **New Column** (default)—Creates a new column. Type a name in the text field next to it. The Apply button stays disabled until you enter a column name.
- **Existing Column**—Overwrites the values in an existing column. A dropdown appears to select the target column.

## Apply

Once your prompt is entered, a key is selected, and a column name is set, the **Apply** button becomes active.

Click **Apply** to run generation on the full dataset. Generation time depends on the number of rows, the provider, and the model.

After apply:

- The new column appears in the dataset grid
- A **Generative AI** task card is added to the Pipeline panel

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

## Limits and constraints

| Constraint | Value |
| --- | --- |
| Max output per cell | 300 characters |
| Max rows processed | 50,000 |
| Max context columns | 20 |

See [limits and quotas](https://docs.mammoth.io/learn/limits-and-quotas) for all Generative AI limits. Rows beyond 50,000 are not processed—the task applies only to the first 50,000 rows of your View.

## Troubleshooting

### Rate limit exceeded

A banner appears when the selected key has hit its rate limit with the AI provider:

> "Your Google Gemini key has exceeded its rate limit. Please try again in a few minutes."

**Options:**

1. Wait a few minutes for the rate limit window to reset
2. Switch to a different key from the same or a different provider using the key selector

### No API key configured

A banner prompts you to add an API key. Use the link in the banner to open the Add External API Key modal directly.

### Key validation failed

If a key fails validation, Mammoth shows a message such as "The Claude key is invalid." Check the key and try again. Ensure you are pasting the key for the correct provider—keys are provider-specific and will fail if used with the wrong service.

### Insufficient quota

The provider account has no remaining balance, and Mammoth shows a message to that effect. Add funds in the provider's dashboard, or add a key from a different account.

## How it works

When you click Apply, Mammoth:

1. Takes your prompt and the selected context columns
2. Sends rows to the AI provider using your external API key
3. Writes the returned values into the output column

The task is saved in your pipeline and re-runs automatically on future dataset refreshes or when the pipeline is re-executed.

## Adding an external API key

External API keys are managed in **Workspace Settings → API Keys** (Workspace Owner role required). Keys are workspace-scoped—all members of the workspace can use them for AI features.

### Step 1—Open Workspace Settings

Open Workspace Settings and select **API Keys**.

The **External API keys** card lists all saved keys by name, with the person who added each one and the date it was added. Open a row's menu to see the key's last four characters.

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

### Step 2—Choose a provider

Click **Add external key**. The **Add External API Key** modal opens.

Choose the AI service you want to connect:

- **ChatGPT**—OpenAI
- **Claude**—Anthropic
- **Grok**—xAI
- **Gemini**—Google

Click a provider card to select it, then click **Next**.

### Step 3—Configure and paste your key

| Field | Description |
| --- | --- |
| **Model dropdown** | Select which model this key will use |
| **Preferences** | Expand to configure model-specific capabilities (see below). Shown only for models that support them |
| **Key Name** | Display label for this key—the placeholder shows the model name |
| **Paste API key** | Field for your API key. A "How to get your [Provider] key" link opens the provider's API key documentation |

Click **Add External Key**. Mammoth validates the key on submission.

### Model preferences

Click **Preferences** to expand model-specific options. Which toggles appear depends on the selected model:

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

| Preference | What it does |
| --- | --- |
| **Extended thinking** | Enables an extended reasoning mode—the model spends more time reasoning before responding. Uses more tokens |
| **Reasoning effort** | Controls how much reasoning the model applies, for models that support it |
| **Web search** | Allows the model to search the web for up-to-date information |
| **Batch API** | Routes requests through the provider's Batch API. Results may be slower |

These preferences apply to all Generative AI operations using this key.

### Key management

| Action | How |
| --- | --- |
| **Remove** | Open the row's menu and select Remove. Removes the key permanently; any pipeline tasks using it will fail until a new key is selected |

> Info: Key values are write-only\
> Once saved, the key value is shown masked and cannot be changed. To replace a compromised or expired key, remove it and add a new one.

### Supported providers and models

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

The models you can choose from are listed in the model dropdown when you add a key.

Multiple keys per provider are supported. For example, you can add two Gemini keys—one for production use and one for testing—and switch between them in the key selector.

---
Source: https://docs.mammoth.io/learn/transform/generative-ai.md · Updated: 2026-10-13