> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/elements-language/component/properties-json/general-structure/ai.md).

# AI

Make component properties understandable to AI-assisted editing.

The `ai` key attaches metadata to a property that describes it to RapidWeaver Elements' AI-assisted editing. A well-described property lets the AI find and change the right setting when a user asks for something in plain language ("make the background a gradient", "align the label to the left").

The `ai` object sits alongside the control on a property, at the same level as `title` and `id`:

```json
{
  "title": "Alignment",
  "id": "align",
  "segmented": {
    "default": "center",
    "items": [
      { "value": "start", "icon": "arrow.left.to.line" },
      { "value": "center", "icon": "arrow.right.and.line.vertical.and.arrow.left" },
      { "value": "end", "icon": "arrow.right.to.line" }
    ]
  },
  "ai": {
    "name": "align",
    "description": "Label alignment within the button.",
    "values": ["start", "center", "end"]
  }
}
```

### Supported Options

| Key           | Type    | Notes                                                                                                                                                                                            |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name`        | string  | A short, stable name the AI uses to identify the property.                                                                                                                                       |
| `description` | string  | What the property does, in plain language. Include the expected range or format where useful, e.g. `"Background color opacity, 0-100."`                                                          |
| `values`      | array   | Optional list of allowed values, useful when the control's items don't make the valid options obvious.                                                                                           |
| `visible`     | string  | Optional condition expression (same syntax as [visible](/elements-docs/elements-language/component/properties-json/general-structure/visible.md)) telling the AI when this property is relevant. |
| `exclude`     | boolean | Set to `true` to hide the property from AI-assisted editing entirely.                                                                                                                            |

### Describing conditional properties

When a property only applies in certain configurations, mirror the relevant condition in `ai.visible` so the AI knows when the setting takes effect:

```json
{
  "title": "Gradient Direction",
  "id": "bgGradientDirection",
  "visible": "bg == 'static' && bgStyle == 'gradient'",
  "select": {
    "default": "bg-linear-to-r",
    "items": [
      { "value": "bg-linear-to-r", "title": "Left to Right" },
      { "value": "bg-linear-to-b", "title": "Top to Bottom" }
    ]
  },
  "ai": {
    "name": "bgGradientDirection",
    "description": "Linear gradient direction.",
    "visible": "bg == 'static' && bgStyle == 'gradient'"
  }
}
```

### Excluding properties

Use `exclude` for internal or duplicate properties that the AI shouldn't touch:

```json
"ai": {
  "name": "borderColor",
  "description": "Border theme color.",
  "exclude": true
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmacsoftware.com/elements-docs/elements-language/component/properties-json/general-structure/ai.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
