Prompt Versioning
Practice of storing and tracking changes in prompts like code. Each change is recorded so that you can revert and compare.
Why
A prompt is code in natural language. It changes, breaks, and requires rollback just like a program:
- «worked yesterday, broke today» — you need history;
- A/B comparison of two formulations;
- collaborative work on a shared prompt library.
What to Store
| Field | Example |
|---|---|
| Version | v1.2.0 |
| Prompt text | Full text |
| Author and date | Who and when changed |
| Metrics | How the version performed in production |
How to Implement
- git — the simplest option: prompts as
.mdfiles in a repository; - specialized platforms — Langfuse, LangSmith with prompt history;
- Prompt registry — an internal service that returns a version by key.