# 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="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2Fd7A81GPXHvYEvMMsYuYH%2Fimage.png?alt=media&#x26;token=9cf2df21-218d-47cf-ab8d-878d2d390b0e" 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="https://4279757243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTbBxR0Ob7RUmbvHZkQi2%2Fuploads%2FIiBRszEaR85DOdrc7yGM%2Fimage.png?alt=media&#x26;token=039928c2-a8a3-4bed-a48c-633070a19e4f" 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.
