> 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

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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
