Prompt Versioning

LangWatch provides a robust prompt versioning system that allows you to manage and track changes to your prompts over time. This feature ensures consistency and enables team collaboration when working with AI models.

Using Prompts in the Optimization Studio

To get started with prompt versioning in the Optimization Studio:

  1. Create a new workflow or open an existing one
  2. Drag a signature node onto the workspace
  3. Click on the node to access configuration options in the right side panel
  4. Make your desired changes to the prompt configuration
  5. Save your changes as a new version

Managing Prompt Versions

Once you’ve created a prompt version, you can:

  • Restore previous versions by clicking the time icon
  • Rename your prompts for better organization
  • Reuse prompts across different workflows
  • View version history and track changes

Prompt Management Table

The Prompt Management table provides a centralized location to manage all your prompts:

  1. Access the prompt table from the main menu
  2. Create new prompts or edit existing ones
  3. Save different versions of your prompts
  4. View all saved versions in a list format
  5. See who created each version (team collaboration)

Team Collaboration

All prompts and their versions are shared across your project team:

  • Any prompt created in the table is available in the studio
  • Changes made in the studio are reflected in the prompt table
  • Team members can see who created each version
  • Prompts can be reused across different workflows

API Integration

LangWatch provides a comprehensive API for managing prompts programmatically. You can use the API to:

  • List all prompts for a project
  • Create new prompts
  • Update existing prompts
  • Manage prompt versions
  • Delete prompts

To use the Prompts API, you’ll need to authenticate using your LangWatch API key. For detailed information about the API endpoints and authentication, see the Prompts API Reference.

The API supports the following operations:

  • GET /api/prompts - Get all prompts for a project
  • POST /api/prompts - Create a new prompt
  • GET /api/prompts/:id - Get a specific prompt
  • PUT /api/prompts/:id - Update a prompt
  • DELETE /api/prompts/:id - Delete a prompt
  • GET /api/prompts/:id/versions - Get all versions for a prompt
  • POST /api/prompts/:id/versions - Create a new version for a prompt