# Prompts

Prompts, in the Dynamiq platform, are reusable templates. Each prompt is versioned - versioning enables prompt reusability while preserving previous versions, which can be crucial for testing and iterative development.

### Adding a New Prompt

<figure><img src="/files/XPYiDasOtIW6HTqPz10x" alt=""><figcaption></figcaption></figure>

To add a new prompt:

1. Navigate to the **Prompts** page and select **Add new prompt**.
2. Fill out the form on the right panel:
   * **Name**: Enter a descriptive name for the prompt.
   * Specify the prompt’s template in the **Prompt** section. You can choose between two views:
     * **Visual**: A user-friendly interface for inputting text.
     * **Raw**: JSON format for more complex prompt structures.
   * Add a new prompt message by clicking **Add message**
     * Each message must have a **Role**:
       * **User**: Represents input coming from the user.
       * **Assistant**: Represents AI assistant.
       * **System:** Represents system message.
     * The **Content** section may include not only regular text but also contain dynamic fields. To use dynamic fields using `{{...}}` syntax (e.g., `{{question}}`), which will be replaced at runtime based on provided data.
3. Once all fields are filled out, click **Create** to save the prompt. The system will automatically assign a version `v1` to the new prompt. Future updates to the prompt will result in new versions (e.g., `v2`), which allows tracking changes over time and maintaining backward compatibility.

### Updating Existing Prompts

<figure><img src="/files/TdgkeskJEZDE6t24Mpix" alt=""><figcaption></figcaption></figure>

To update an existing prompt:

1. Navigate to the **Prompts** page.
2. Find the prompt you wish to update and click the **Edit** icon next to it. This will open the prompt's configuration panel on the right side.
3. Modify necessary fields.&#x20;
4. Once your updates are complete, click **Update** to save the changes. This action will automatically create a new version (e.g., from `v2` to `v3`) and store it in the **Versions** tab.


---

# Agent Instructions: 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:

```
GET https://docs.getdynamiq.ai/prompts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
