> ## 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.

# Generate documentation

> Automatically create comprehensive documentation for project pipelines

Use the Prophecy Agent to generate documentation for pipelines or entire projects. The Agent uses [templates](#documentation-templates) to structure the output as Markdown files that describe your data pipelines. You need to upload separate templates for pipeline and project documentation tasks.

You can generate documentation for a single pipeline or for an entire project.

## Generate pipeline documentation

To generate documentation for a pipeline, follow these steps:

1. Open your pipeline in Prophecy.
2. Click **Chat** in the left sidebar.
3. Prompt the Agent to document your pipeline.

   For example: `Generate pipeline documentation using @custom_template`.

   This generates a document for the pipeline that you have opened in your project.

If you don't specify a template using an @ mention, the Agent looks for a default template file in your project, which should have the name `pipeline-template.md`.

If the default template exists, the Agent uses it. Otherwise, the Agent asks you to upload or specify a template.

<img src="https://mintcdn.com/prophecy-62973bd0/Gv5A3TvHfao8H7jw/data-analysis/ai/agent/documentation/img/agent-generate-docs.png?fit=max&auto=format&n=Gv5A3TvHfao8H7jw&q=85&s=8e9198b65889718f21de8f3c14f4018d" alt="Ask Agent to generate documentation" width="2876" height="1594" data-path="data-analysis/ai/agent/documentation/img/agent-generate-docs.png" />

## Generate project documentation

To generate documentation for a project, including all of its pipelines, follow these steps:

1. Open your project in Prophecy.
2. Open any pipeline or document entity.
3. Click **Chat** in the left sidebar.
4. Prompt the Agent to document your project.

   For example: `Generate project documentation using @custom_template`.

   This generates a document that describes your project.

If you don't specify a template using an @ mention, the Agent looks for a default template file in your project, which should have the name `project-template.md`.

If the default template exists, the Agent uses it. Otherwise, the Agent asks you to upload or specify a template.

## How the Agent generates documentation

During generation, the Agent:

1. Displays a preparation checklist with progress.
2. Analyzes pipeline or project components.
3. References the template that defines the document structure.
4. Generates the documentation.
5. Saves the Markdown file to the `documents` directory in your project.

View the generated document in **Documents** in the project sidebar.

<img src="https://mintcdn.com/prophecy-62973bd0/Gv5A3TvHfao8H7jw/data-analysis/ai/agent/documentation/img/agent-docs-list.png?fit=max&auto=format&n=Gv5A3TvHfao8H7jw&q=85&s=ae1dd24ead52b7950bea3575b1c057cb" alt="Generated documentation" width="2872" height="1604" data-path="data-analysis/ai/agent/documentation/img/agent-docs-list.png" />

## Update generated documentation

After the Agent generates your document, you can:

* Edit the document in the visual editor (recommended). The visual editor displays the rendered Markdown file, including special components like pipeline frames.
* Switch to the **Code** tab to edit the Markdown code. In the Code tab, you may see encoded or complex strings that contain embedded data. Don't edit them, as changes will break the visual output.

Since the document is stored in your project repository, all changes are version-controlled with your code.

## Documentation templates

Templates define how the Agent structures documentation output. Templates use Markdown for standard formatting and [Copilot Template Language (CTL)](/data-analysis/ai/agent/documentation/ctl-reference) markers to create special components that standard Markdown doesn't support. You might create your template such that the Agent generates a completely static file, or you can incorporate components that allows users to fill in fields of the generated document.

Once you have written the template file, you need to upload the file to your project:

1. Open the project where you want to upload the template.
2. In the **Project** tab of the left sidebar, click **Add Entity**.
3. Click **Template**. Your file browser opens.
4. Select the Markdown file to upload.
5. Click **Open**.

<Note>
  To create a custom template, you must upload a file from your local file system. You cannot create
  a blank template from the project editor.
</Note>

## Enabling the Documentation Agent

The Documentation Agent runs in a dedicated project mode and requires the Transform Agent to be disabled. Projects can operate in either Transform Agent mode or Harmonization/Documentation mode, but not both simultaneously.

To use the Documentation Agent:

1. Disable the v4 Agent for the team that owns the project by opening **Metadata → Teams → Select team → Settings → Advanced**.
2. Click the **Enable Transform Agent** toggle.
3. Return to your project.

Only one agent mode can be active per team at a time.
