---
title: "AI Optimization"
description: "AI Optimization allows you to generate a structured, text-based overview of your documentation that is specifically formatted for AI assistants. By creating an llms.txt file, you provide AI tools w..."
last_updated: "2026-07-02T09:48:33.55223+00:00"
canonical_url: "https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/guide/integrations/ai-optimization"
---

AI Optimization allows you to generate a structured, text-based overview of your documentation that is specifically formatted for AI assistants. By creating an `llms.txt` file, you provide AI tools with a clear "map" of your content, including page titles, descriptions, and organized links. This helps AI models better understand your documentation structure and navigate your content more effectively.

## Understanding the AI-Friendly Format

The system processes your existing documentation tree and converts it into a clean Markdown list. It automatically extracts titles and descriptions from your pages and folders, nesting them in a hierarchical list that mimics your navigation structure. This ensures that when an AI model consumes your documentation, it sees a logical, tree-like summary.

```mermaid
graph LR
    A[Documentation Tree] --> B{System Processor}
    B --> C[Extract Titles/Descriptions]
    C --> D[Format as Markdown List]
    D --> E[Final llms.txt Output]
```

## Step-by-Step Customization

### Step 1: Set up the generation tool
Call the optimization generator on your content loader. This tool reads your structure and prepares the text-based format.

### Step 2: Configure indentation and formatting
Adjust the default spacing if you prefer a different indentation format than the default two spaces. This helps maintain clean nested lists in the final output.

### Step 3: Define custom metadata extractors
If you want to customize how the AI reads your page titles or descriptions, provide custom rendering rules to override the default metadata extraction.

## Key Concepts

### Title and Description Extraction
The system follows a strict order of priority when generating names and descriptions for the AI:
* **Title Extraction**: It prioritizes the specific title defined in your page metadata. If that is missing, it falls back to the navigation name.
* **Description Extraction**: It looks for the description field in your metadata. If no description is provided, it uses the default description associated with that navigation item.

### Structural Nesting
Folders, pages, and separators are converted into nested Markdown list items. For folders with index pages, the folder itself is listed first, followed by its index page and children on nested levels.

## Configuration Options

You can customize the output of your AI-optimized files by adjusting the settings in the table below.

| Option | Description |
| :--- | :--- |
| `TAB` | The string used for indentation (defaults to two spaces). |
| `renderName` | A custom function to define how page or folder names are displayed. |
| `renderDescription` | A custom function to define how page or folder descriptions are displayed. |

## Tips and Warnings

> [!TIP]
> Ensure that every page and folder has a clear, concise description in your metadata. The AI relies heavily on these descriptions to understand the purpose of a specific section.

> [!WARNING]
> If you have multiple languages enabled, the system will automatically generate separate indexes for each language. Make sure your metadata is localized correctly to ensure the AI receives the correct language output for each user.

> [!IMPORTANT]
> If you need to include extra sections or manual content in your AI index file, consider utilizing node-specific generation. This provides more granular control than the standard index generator, allowing you to build the output node by node.

## Related

- [Writing Content](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/guide/core-features/writing-content)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/llms.txt) for all pages in this wiki.
