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

# Prompt Studio

> Netra Prompt Studio is a prompt management workspace to build, test, and version prompts without redeployments. Manage templates and A/B test in production.

<CardGroup cols={2}>
  <Card title="Prompt Library" icon="folder">
    View all prompts, select an existing one, or create a new prompt from a centralized library.
  </Card>

  <Card title="Message Builder" icon="messages">
    Compose prompts using **System** and **User** messages for chat-style model interactions.
  </Card>

  <Card title="Variables + Inputs" icon="brackets-curly">
    Parameterize prompts with variables and provide runtime values using **Fields** or **JSON**.
  </Card>

  <Card title="Model Configuration" icon="sliders">
    Configure the **provider**, **model**, and runtime parameters so behavior stays consistent across environments.
  </Card>

  <Card title="Publish Workflow" icon="upload">
    Publish immutable prompt versions with **GitHub-style diffs** and review changes before release.
  </Card>

  <Card title="Version History" icon="clock-rotate-left">
    Track all published versions along with metadata and change history.
  </Card>

  <Card title="Labels" icon="tag">
    Attach labels such as `production`, `staging`, or `latest` to control which version applications invoke.
  </Card>

  <Card title="Safe Iteration" icon="copy">
    Create drafts from existing prompt versions and iterate without modifying previously published versions.
  </Card>
</CardGroup>

***

## When to Use Prompt Studio

Use Prompt Studio when you need a structured way to manage prompts across teams and environments, safely iterate on prompt changes, and control how updates are released to production systems.

| Situation                                                                          | Benefit                                |
| ---------------------------------------------------------------------------------- | -------------------------------------- |
| You want a single place to manage prompts across services and teams                | Centralized prompt management          |
| You need controlled releases (dev → staging → production) without redeploying code | Safe production rollouts               |
| You want an audit trail of prompt changes                                          | Version diffs, comments, and history   |
| You want to reproduce outcomes exactly                                             | Pin prompt versions and model settings |

## Step by step guide to manage your prompts

<Steps>
  <Step title="Create a Prompt">
    Open **Prompt Studio** and click **Create Prompt** to start a new prompt.
  </Step>

  <Step title="Add Messages">
    Compose your prompt using **System** and **User** messages.

    * **System messages** define role, rules, and guardrails.
    * **User messages** contain the request template and runtime input.
  </Step>

  <Step title="Define Variables">
    Add **variables** for dynamic inputs such as user messages, context, or knowledge snippets.

    Reference variables using placeholders like:

    `{{user_message}}`
  </Step>

  <Step title="Provide Inputs">
    Specify how variable values are provided at runtime.

    | Method     | Description                                           |
    | ---------- | ----------------------------------------------------- |
    | **Fields** | Structured inputs with name, type, and example values |
    | **JSON**   | Runtime JSON payload for programmatic invocation      |
  </Step>

  <Step title="Configure the Model">
    Select the **provider**, **model**, and runtime parameters that control how the prompt executes.

    | Setting         | Description                                                     |
    | --------------- | --------------------------------------------------------------- |
    | **Provider**    | The model provider used to run the prompt (for example, OpenAI) |
    | **Model**       | The specific model that will generate responses                 |
    | **Temperature** | Controls randomness in the output                               |
    | **Max tokens**  | Limits the maximum length of the response                       |
    | **Top P**       | Adjusts sampling diversity when generating text                 |

    Keep **temperature low** for deterministic tasks such as support replies, extraction, or formatting. Increase it when creativity is needed.
  </Step>

  <Step title="Publish the Prompt">
    Click **Publish** to convert the draft into an **immutable version**.

    You can review the change, add a comment, and assign labels.
  </Step>

  <Step title="Manage Versions">
    Use **Version History** and **labels** (`production`, or any custom label) to control which prompt version your application invokes.
  </Step>
</Steps>

***

## Immutability and Iteration

Published prompt versions are **immutable**, meaning they cannot be edited after they are published. This ensures that production behavior remains predictable and that every version can be audited or reproduced later.

When you need to update a prompt, you create a new draft, make your changes, and publish a new version.

<Steps>
  <Step title="Create a New Draft">
    Select any published version and create a **draft** from it.\
    The draft acts as a working copy where changes can be made safely.
  </Step>

  <Step title="Edit and Iterate">
    Modify messages, variables, or model settings in the draft.\
    You can iterate and test freely without affecting the currently published version.
  </Step>

  <Step title="Publish a New Version">
    When your changes are ready, click **Publish** to create a new immutable version.\
    You can then assign labels such as `staging` or `production` to control which version is used.
  </Step>
</Steps>

***

## Best Practices

| Practice                                   | Why It Matters                                           |
| ------------------------------------------ | -------------------------------------------------------- |
| Treat prompts like **APIs**                | Stable inputs and predictable outputs                    |
| Write publish comments like **changelogs** | Improves traceability and collaboration                  |
| Use labels as **release channels**         | Manage deployments safely (`dev → staging → production`) |
| Keep prompts **focused**                   | Compose multiple prompts instead of one large prompt     |
| Write clear **publish comments**           | Helps teammates quickly understand what changed          |
| Keep changes **small and descriptive**     | Makes it easier to track who changed what and why        |

***

## FAQ

<AccordionGroup>
  <Accordion title="Can I edit a published version?">
    Published versions are immutable. To make changes, create a new **draft** from a published version, update it, and publish a new version.
  </Accordion>

  <Accordion title="How do I change which prompt runs in production?">
    Move the **`production label`** to the version you want your application to use.
  </Accordion>
</AccordionGroup>
