> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Transformation

> Transform data sources using the Prophecy Agent

export const WistiaVideo = ({mediaId, autoplay = true, muted = true, loop = true}) => {
  const containerRef = React.useRef(null);
  const playerRef = React.useRef(null);
  const wistiaPlayerRef = React.useRef(null);
  const initWistia = () => {
    if (!containerRef.current || playerRef.current) return;
    const container = containerRef.current;
    const playerId = `wistia_${mediaId}_${Math.random().toString(36).substr(2, 9)}`;
    container.innerHTML = '';
    const embedDiv = document.createElement('div');
    embedDiv.className = `wistia_embed wistia_async_${mediaId}`;
    embedDiv.id = playerId;
    container.appendChild(embedDiv);
    if (window._wq) {
      window._wq.push({
        id: playerId,
        onReady: video => {
          wistiaPlayerRef.current = video;
          if (loop) {
            video.bind('end', () => {
              video.play();
            });
          }
        },
        options: {
          autoPlay: autoplay,
          muted: muted,
          videoFoam: true
        }
      });
    }
    playerRef.current = playerId;
  };
  React.useEffect(() => {
    if (window._wq) {
      initWistia();
      return;
    }
    const script = document.createElement('script');
    script.src = 'https://fast.wistia.com/assets/external/E-v1.js';
    script.async = true;
    script.onload = () => {
      window._wq = window._wq || [];
      initWistia();
      window.dispatchEvent(new Event('wistia-loaded'));
    };
    document.head.appendChild(script);
    const checkWistia = () => {
      if (window._wq) {
        initWistia();
        window.removeEventListener('wistia-loaded', checkWistia);
      }
    };
    window.addEventListener('wistia-loaded', checkWistia);
    return () => {
      window.removeEventListener('wistia-loaded', checkWistia);
      if (playerRef.current && window.Wistia && window.Wistia.api) {
        const player = window.Wistia.api(playerRef.current);
        if (player) {
          player.remove();
        }
      }
    };
  }, [mediaId, autoplay, muted, loop]);
  return <div ref={containerRef} className="aspect-video w-full rounded-xl" style={{
    position: 'relative'
  }} />;
};

You can use the Prophecy Agent to generate transformations based on natural language prompts. When you describe a data operation, the Transform Agent generates the corresponding gems in the pipeline and summarizes the applied changes in the chat interface.

The following sections describe how to add transformations, review modifications, and restore previous versions of the pipeline.

The Transform Agent runs in the default agent mode for a project. If your team has enabled Harmonization mode, the Transform Agent must be re-enabled in team settings before transformations can be generated.

## What the Transform Agent can modify

The Transform Agent operates strictly within the active [project](/data-analysis/development/projects/create-project). It can:

* Create and refactor pipelines.
* Generate and update analyses.
* Modify datasets and related project artifacts.
* Update project documentation.

All changes remain fully visible and editable in the project editor.

## Execution model

The Transform Agent can retrieve metadata and limited data samples to validate generated transformations.

When executing SQL or running pipelines, the Agent operates under the permissions of the user who invoked it.

When generating output tables or executing write operations, changes take effect immediately in the connected warehouse under the invoking user’s permissions. Existing warehouse access controls and governance policies are always enforced.

## Model architecture

The Transform Agent is built on a specialized deployment of Claude Code and is optimized for Anthropic Opus 4.5.

Prophecy augments model reasoning with structured tool access to project artifacts, metadata, and connected warehouse systems. The model is not used in isolation; all actions are mediated through Prophecy’s execution layer and project boundaries.

Enterprise customers may configure approved Anthropic endpoints in supported deployment environments. Using alternative models may affect output quality.

## Prerequisites

You need at least one [Source gem](/data-analysis/gems/source-target/source-target) in your pipeline to add transformation gems with AI chat.

## Provide a transformation

To generate a transformation, enter a prompt that describes the desired data operation.

The Agent returns:

* One or more gems on the pipeline canvas.
* A description of the applied changes.
* Options to restore, inspect, or preview changes.
* A group of SQL execution logs.

<img src="https://mintcdn.com/prophecy-62973bd0/Gv5A3TvHfao8H7jw/data-analysis/ai/agent/img/agent-sql-logs.png?fit=max&auto=format&n=Gv5A3TvHfao8H7jw&q=85&s=dde7d17e4a367e6a3364d12525732d64" alt="Agent SQL logs" width="2866" height="1580" data-path="data-analysis/ai/agent/img/agent-sql-logs.png" />

## Inspect pipeline changes

To understand the Agent changes:

1. Select **Inspect** on the chat that generates a transformation.
2. Review the configuration panel beginning with the first modified gem. Modified gems appear in yellow.
3. Hover over the **Previous** and **Next** button to display a minimap of the pipeline. This shows you the specific gem you are viewing in the context of the pipeline.
4. Use the **Previous** and **Next** controls to move through other modified gems in sequence.
5. Examine both the input and output of each gem to confirm that the transformation produces the expected result.

<Frame>
  <WistiaVideo mediaId="cqu2b9e6pi" />
</Frame>

## Restore a previous state of the pipeline

To revert changes or try another transformation from a previous state, select **Restore** from the reply you want to revert to in the chat history. The pipeline will match the earlier version. You can also manage versions from the main project [version history](/data-analysis/development/versioning/version-control).

## Create output tables

After adding various data transformations in your pipeline, ask the Agent to save the result as a table. The Agent writes the output to the default database and schema configured for your connected fabric. This allows you to persist results and reuse them in downstream workflows.

<Warning>
  If you have multiple pipelines or pipeline branches that do not terminate with tables, the Agent
  will not be able to create an output table.
</Warning>

## Project history

All changes made by the Agent are saved in the project [version history](/data-analysis/development/versioning/version-control). Commits are clearly marked as authored by the Agent.

<Note>
  If you did not save your project before interacting with the Agent, Prophecy will automatically
  save your changes before the Agent proceeds.
</Note>

## Sample prompts

Here are some sample prompts that can produce transformations in your pipeline.

| Scenario           | Prompt                                                    | Expected output   |
| ------------------ | --------------------------------------------------------- | ----------------- |
| Filter records     | "Filter to only include customers from California"        | Filter gem        |
| Add transformation | "Calculate the total order value as `quantity * price`"   | Reformat gem      |
| Clean data         | "Remove rows where email is null"                         | DataCleansing gem |
| Aggregate data     | "Group by region and calculate average sales"             | Aggregate gem     |
| Rename columns     | "Rename `cust_id` to `customer_id` and `amt` to `amount`" | Reformat gem      |
| Save output tables | "Show me and save the final output of the pipeline"       | Table gem         |
