🎓 A1Learner
🔍
0 of 50 lessons completed

Prompt Engineering: Versioning Prompts

Versioning prompts is keeping every version of a prompt. One line changes, the old version stays, and the outputs are compared.

Version one of the greeting

The first greeting prompt is short, and it is saved before any change.

You are a support agent for ShopStack. Greet the customer and ask how you can help.

Version two of the greeting

The second greeting prompt adds the customer name and a two-sentence limit, and version one stays saved.

You are a support agent for ShopStack. Greet the customer by name, thank them for writing, and ask how you can help. Keep the greeting to two sentences.

Example

You are a support agent for ShopStack. Greet Maya by name, thank her for writing, and ask how you can help. Keep the greeting to two sentences.

Key points

  • Versioning: keeping every version of a prompt, so a change can be undone.
  • A prompt is code, and code is versioned, so a prompt is versioned too.
  • A small change can change the reply, and only a saved old version shows what changed.
  • A version number and a date mark each version, so the desk knows which prompt is live.
  • Comparing the old reply with the new reply is how the desk judges a change.

This example runs version two of the greeting for a real customer. The real reply is the new version to compare against version one.

Note

A change without a saved old version cannot be undone. Save first, then change.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Rust Playground

Exercise

Why version a prompt?