> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/ai-in-umbraco/add-ons/prompt.md).

# Prompt Management

Prompt Management add-on for creating and executing reusable prompt templates.

The Prompt Management add-on (`Umbraco.AI.Prompt`) enables you to create, manage, and execute reusable prompt templates through the Umbraco backoffice and Management API.

## Installation

{% code title="Package Manager Console" %}

```powershell
Install-Package Umbraco.AI.Prompt
```

{% endcode %}

Or via .NET CLI:

{% code title="Terminal" %}

```bash
dotnet add package Umbraco.AI.Prompt
```

{% endcode %}

## Features

* **Prompt Templates** - Create reusable prompts with variable placeholders
* **Variable Interpolation** - Use `{{variable}}` syntax for dynamic content
* **Profile Association** - Link prompts to specific AI profiles
* **Context Injection** - Include AI Contexts for brand voice
* **Scoping** - Control where each prompt can be used using allow and deny rules
* **Version History** - Track changes with full rollback support
* **Backoffice Management** - Full UI for creating and managing prompts

## Quick Start

### 1. Create a Prompt

In the backoffice, navigate to the **AI** section > **Prompts** and create a new prompt:

| Field        | Value                                                                 |
| ------------ | --------------------------------------------------------------------- |
| Alias        | `summarize-article`                                                   |
| Name         | Summarize Article                                                     |
| Instructions | `Summarize the following article in 3 bullet points:\n\n{{bodyText}}` |
| Profile      | (select your chat profile)                                            |

### 2. Execute the Prompt

Template variables like `{{content}}` resolve from the target entity's property values. Execute the prompt against the document you want to summarize:

{% code title="ArticleSummarizer.cs" %}

```csharp
public class ArticleSummarizer
{
    private readonly IAIPromptService _promptService;

    public ArticleSummarizer(IAIPromptService promptService)
    {
        _promptService = promptService;
    }

    public async Task<string> SummarizeAsync(Guid articleKey)
    {
        var prompt = await _promptService.GetPromptByAliasAsync("summarize-article");

        var result = await _promptService.ExecutePromptAsync(
            prompt!.Id,
            new AIPromptExecutionRequest
            {
                EntityId = articleKey,
                EntityType = "document",
                PropertyAlias = "summary",
                ContentTypeAlias = "article"
            });

        return result.Content;
    }
}
```

{% endcode %}

## Template Syntax

### Basic Variables

Use `{{variable}}` to insert dynamic content:

```
Translate the following text to {{language}}:

{{text}}
```

### Image Variables

Use the `image:` prefix to include images from content properties:

```
Describe this image: {{image:heroImage}}
```

### Example Template

When prompts execute from property actions, entity and property values are available directly:

```
You are a content assistant for {{name}}.

Write a meta description for this content:

Title: {{pageTitle}}
Content: {{bodyText}}

Requirements:
- Maximum 160 characters
- Include the primary keyword
- Be compelling and action-oriented
```

## Documentation

| Section                                                                 | Description                          |
| ----------------------------------------------------------------------- | ------------------------------------ |
| [Concepts](/ai-in-umbraco/add-ons/prompt/concepts.md)                   | Prompt templates, variables, scoping |
| [Getting Started](/ai-in-umbraco/add-ons/prompt/getting-started.md)     | Step-by-step setup guide             |
| [Template Syntax](/ai-in-umbraco/add-ons/prompt/template-syntax.md)     | Variable interpolation details       |
| [Scoping](/ai-in-umbraco/add-ons/prompt/scoping.md)                     | Allow and deny rules for prompts     |
| [API Reference](/ai-in-umbraco/add-ons/prompt/api.md)                   | Management API endpoints             |
| [Service Reference](/ai-in-umbraco/add-ons/prompt/ai-prompt-service.md) | IAIPromptService                     |

## Related

* [Add-ons Overview](/ai-in-umbraco/add-ons/add-ons.md) - All add-on packages
* [AI Contexts](/ai-in-umbraco/concepts/contexts.md) - Brand voice and guidelines
* [Profiles](/ai-in-umbraco/concepts/profiles.md) - AI configuration


---

# 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.umbraco.com/ai-in-umbraco/add-ons/prompt.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.
