Principle:Wandb Weave Prompt Versioning
| Knowledge Sources | |
|---|---|
| Domains | Prompt_Engineering, Versioning |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
An iterative workflow pattern for evolving prompt templates through successive publish-modify-republish cycles.
Description
Prompt Versioning describes the iterative process of refining prompts. After initial publishing, users modify the prompt content and re-publish with the same name. Each re-publish creates a new version (if content changed), while previous versions remain accessible by their digest. This supports A/B testing, gradual rollout, and audit trails.
Usage
Use this pattern throughout prompt development. Each iteration (modifying wording, adding examples, changing system messages) should be published as a new version for tracking and reproducibility.
Theoretical Basis
Prompt versioning applies the append-only log pattern:
- Initial Publish: Creates version 1 with digest D1.
- Modify: Change prompt content locally.
- Re-publish: Publishing with the same name creates version 2 with digest D2.
- Access: weave.ref("name") resolves to latest. weave.ref("name:D1") retrieves version 1.
This is a Pattern Doc — it documents a user workflow rather than a specific API.
Practical Guide
Iteration Workflow
- Create an initial prompt and publish it.
- Test the prompt in your application.
- Modify the prompt based on results.
- Re-publish with the same name to create a new version.
- Compare versions using the Weave UI or API.
Best Practices
- Use meaningful prompt names that describe the purpose.
- Publish frequently during development for a complete history.
- Use specific version digests in production for reproducibility.
- Use weave.ref("name") (latest) in development for flexibility.