> ## Documentation Index
> Fetch the complete documentation index at: https://docs.athina.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt Versioning

> A guide on managing and tracking prompts with prompt versioning in Athina AI.

Managing and refining prompts is a crucial part of optimizing Large Language Model (LLM) interactions. As prompts evolve with iterations and improvements, it becomes essential to keep track of changes, test different versions, and revert to previous ones if needed.

Prompt versioning in Athina AI allows you to systematically manage your prompt iterations, ensuring consistency, collaboration, and ease of experimentation. This guide will walk you through the importance of prompt versioning, how it works, and its implementation using Athina’s Prompt Playground.

<iframe
  src="https://demo.arcade.software/HqmWGHgecpD9lQUazz92?embed&embed_mobile=tab&embed_desktop=inline&show_copy_link=true"
  frameBorder="0"
  webkitallowfullscreen
  mozallowfullscreen
  allowfullscreen
  style={{
width: "100%",
height: "100%",
minHeight: "500px",
}}
/>

## Why Do We Need Prompt Versioning?

Prompt versioning is a system that automatically assigns a version number to each saved change of a **prompt template**. Managing prompts manually can become cumbersome, especially when multiple iterations are tested. Prompt versioning ensures:

* **Traceability**: You can see when and how a prompt changes.
* **Flexibility**: Easily switch between versions to compare effectiveness.
* **Collaboration**: Teams can work on the same prompt while maintaining version control.
* **Reliability**: Prevents accidental loss of a well-performing prompt by allowing easy rollbacks.

## Prompt Versioning in Athina AI

Now let’s see step by step how to version prompts:

### Step 1: Create a Prompt

<Steps>
  <Step>
    Start by opening the **Prompts** section in Athina AI and creating a new prompt.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/athinaai/images/guides/prompt-versioning/1.png" />
  </Step>

  <Step>
    Once the playground interface appears, rename the experiment as you can see in the following image.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/athinaai/images/guides/prompt-versioning/2.png" />
  </Step>
</Steps>

### Step 2: Test the Prompt

<Steps>
  <Step>
    Add your system prompt in the **System** field, then define the context in the **Variables** section on the right-hand side. After that, enter your query in the **User** section and review the response.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/athinaai/images/guides/prompt-versioning/3.png" />
  </Step>
</Steps>

### Step 3: Commit a Prompt Version

<Steps>
  <Step>
    Once you are satisfied with the prompt’s response, click on the **Commit** button.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/athinaai/images/guides/prompt-versioning/4.png" />
  </Step>

  <Step>
    Then add a commit message and click **Save Commit** to finalize the version.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/athinaai/images/guides/prompt-versioning/5.png" />
  </Step>

  <Step>
    You can see your prompt version next to the name and also in the commit history as you can see below.

    <img src="https://mintlify.s3.us-west-1.amazonaws.com/athinaai/images/guides/prompt-versioning/6.png" />
  </Step>
</Steps>

Prompt versioning in Athina AI provides a structured way to manage, track, and optimize prompts over time. By maintaining version history, users can experiment, revert to previous versions when needed, and collaborate seamlessly with their teams. With version tracking, default version settings, and rollback capabilities, they can confidently iterate on prompts while ensuring that well-performing versions are preserved and easily accessible.
