# Create and manage prompts
URL: https://docs.datarobot.com/en/docs/agentic-ai/prompt-mgmt/create-prompts.html

> Create prompts, add variables, version, and share prompts with users or organizations for use in the agent experience.

# Create and manage prompts

Prompts are a fundamental part of interacting with, and generating outputs from, LLMs and agents. Access the prompt management system from the Prompts tile within Registry for a centralized, version-controlled, and integrated system for prototyping, experimenting, deploying, and monitoring prompts as agent components.

The Prompts tile initially lists all saved and shared prompts. Click an entry for configuration details.

**Registry listing:**
[https://docs.datarobot.com/en/docs/images/manage-prompts-2.png](https://docs.datarobot.com/en/docs/images/manage-prompts-2.png)

**Prompt details:**
[https://docs.datarobot.com/en/docs/images/prompt-3.png](https://docs.datarobot.com/en/docs/images/prompt-3.png)


The system supports:

- Creating prompts .
- Versioning capabilities , for iterating on to prompts.
- Managing prompts by comparing and sharing prompts with users or organizations.
- Calling a prompt in an agent .

## Create prompts

To create a prompt, open Registry > Prompt. The prompt library opens with a Create prompt button available.

**First prompt:**
If you have not created any prompts, or none have been shared with you, the library shows an empty state.

[https://docs.datarobot.com/en/docs/images/prompt-2.png](https://docs.datarobot.com/en/docs/images/prompt-2.png)

**Populated prompt library:**
If you have created prompts, or prompts have been shared with you, they are listed on the Prompt tile landing page.

[https://docs.datarobot.com/en/docs/images/prompt-1.png](https://docs.datarobot.com/en/docs/images/prompt-1.png)


Click Create prompt and complete the fields. All fields support a maximum of 5000 characters.

| Field | Description |
| --- | --- |
| Name | Enter a name for the prompt. The name must contain only letters, numbers, underscores (_), dashes (-), spaces, and brackets. |
| Description | Enter a description for the prompt. The description is for developer information; it displays on the prompt library landing page and the individual prompt details page. |
| Prompt text | Enter the text that will be included with each individual user prompt, up to 5 million characters. Prompt text can contain variables, as described below. Note that text entered in this field is counted as part of an LLM's max completion token limit. You can use a maximum of 100 variables in a single prompt. |
| Variables | Enter a variable name marked with double braces {{ variable_name }}. The variable definition must be included with the agent files and must contain only letters, numbers, and underscores (_). Variable character limits are: Name maximum = 200 characters.Description maximum = 200 characters. |
| Comments (optional) | Enter text to display on individual prompt details page. |

If you are not using variables, click Create. Otherwise see the section on [adding variables](https://docs.datarobot.com/en/docs/agentic-ai/prompt-mgmt/create-prompts.html#add-variables).

Also, see [prompt versioning](https://docs.datarobot.com/en/docs/agentic-ai/prompt-mgmt/create-prompts.html#create-prompt-versions) for details on modifying existing prompts.

### Add variables

If you enter a variable in the Prompt text field, the Variables section expands to include a description field. The description is required; the content of this field displays on the individual prompt details page. It does not define the variable.[Variable must be defined](https://docs.datarobot.com/en/docs/agentic-ai/prompt-mgmt/prompt-in-agent.html) in the `MyAgent` class of the `agents.py` file.

To include a variable:

1. Define the variable(s) inagents.py. Note that this step does not have to be completed first but must be completed before testing the prompt.
2. Enter the prompt text, indicating a variable using double brackets ({{ }}) around the variable name. With each variable you reference, an entry for that variable is included in theVariablessection. You can use the same variable multiple times in the prompt text.
3. ClickCreate.

### View defined prompts

When you click the Prompts tile in Registry, the prompt library opens listing all prompts created by, or shared with, you. You can search for the prompt name or use the Created by filter to search by creator.

Click an entry to see details of the newest version of the prompt. A list of all versions is displayed in the right panel. To view a different version, click a version in the panel or use the dropdown.

The prompt displayed is read-only. To modify it, [create a new version](https://docs.datarobot.com/en/docs/agentic-ai/prompt-mgmt/create-prompts.html#create-prompt-versions).

## Create prompt versions

Prompt versioning is vital for managing changes to prompts over time, as even small alterations can significantly impact an LLM's output. This practice ensures reproducibility, allowing teams to link specific model outputs to the exact prompt version that generated them, and facilitates quick rollbacks to stable versions if new changes degrade performance.

To version prompts:

1. Click on the prompt you want to modify from the table list of prompts on thePromptstile in Registry. The display shows the most recent version of the prompt; it is read-only.
2. ClickCreate new version from currentin the upper right to open the canvas for creating a new version of the prompt. The existing prompt text, variables, and comments area are now editable. The name and description are not.
3. Modify the text and variables, as needed. Be sure that all description fields are complete.
4. ClickCreate. The new prompt is displayed in the versions panel.

## Manage prompts

Once you have created prompts, or prompts have been shared with you, you can sort, compare, and share them. Access the prompt management system from the Prompts tile within Registry.

### Filter table listing

You can filter the prompt table to list only those prompts created by certain users. To do so, select prompt creators from the Created by dropdown.

### Compare versions

Use the Compare versions functionality to review changes made between versions. To compare:

1. Select the prompt from the table listing. The latest version of the prompt opens.
2. ClickCompare versionsto open the comparison modal.
3. Using the dropdowns, select the versions to compare. Color helps to identify changes in the prompt text; use the scrollbars to see complete entries. Changes in variable and comments are also indicated.

### Share prompts

You can share prompts with a user, group, or organization. An owner can share, change roles, or create new versions from the existing prompt. To share the prompt, click the Action menu and choose Share prompt.

The [standard sharing](https://docs.datarobot.com/en/docs/api/dev-learning/python/admin/sharing.html) modal appears.

---
