A prompt version is an identifiable revision of a prompt. Keeping revisions lets a team track how wording changes affect AI outputs and user experience, compare alternatives, and return to an earlier prompt when needed. section 5.6 section 5.1.3
Choose a storage approach that fits how prompts change:
- Keep named prompt files when revisions can move with application code. Translation examples distinguish both provider and revision in filenames such as translation_openai_v1.0.1.ts and translation_openai_v1.1.0.ts. section 5.1.3
- Store prompts in a database when they must change without redeploying. Multiple stored versions support A/B tests and rollback; database access control can limit who modifies them. section 5.1.3
- Test a change before relying on it. Mock generateText() with Vitest for predictable checks, or check generated text against similarity and word-count or required-word constraints. section 5.1.3
// prompts/translation_openai_v1.0.1.ts
export const translationPrompt_openai_v1_0_1 =
"Translate the following text from {source_lang}
to {target_lang}: {text}";
// prompts/translation_openai_v1.1.0.ts
export const translationPrompt_openai_v1_1_0 =
"You are a professional translator. Translate the
following text from {source_lang} to {target_lang},
maintaining the original tone and style: {text}";
// prompts/translation_anthropic_v1.0.0.ts
export const translationPrompt_anthropic_v1_0_0 =
"As an AI language model, please translate the given
text from {source_lang} to {target_lang}.
Ensure that the translation is accurate
and natural-sounding. Text to translate: {text}";
The translation prompt files show two OpenAI revisions and a separate Anthropic variant. Compare their instructions to see what each named revision preserves or changes. section 5.1.3
The Vercel AI SDK does not include built-in prompt management. A prompt store therefore sits alongside generation code: the application retrieves the chosen prompt, then passes it into its AI generation flow. Version names make that choice explicit rather than hiding a wording change inside application logic. section 5.1.3

