Prompt management keeps an AI application’s prompts organized as they change. Storing prompts in a database outside application code lets teams update them without redeploying, retain earlier versions, query a growing collection, and control who can edit them. section 5.1.3
Treat each prompt change as something to evaluate, not just replace:
- Keep versions so you can compare variations through A/B testing or roll back when a change performs poorly. section 5.1.3
- Use user feedback or performance metrics to guide updates, and restrict editing through role-based access control. section 5.1.3
- Test the behavior you need: mock generation in Vitest, compare output against expected wording, or check constraints such as word count and required terms. section 5.1.3
Versioned translation prompts
A translation prompt can begin with source-language, target-language, and text placeholders. A later version adds instructions to preserve tone and style; another variant targets a different model provider. Keeping the variants distinct makes changes visible and comparable. 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}";
See the TypeScript prompt variants with versioned names, reusable placeholders, and provider-specific wording. section 5.1.3
In a diagram-generation application, a prompt library can sit between a user request and the Vercel AI SDK’s generateText() call. It selects the requested diagram type and passes a prompt toward model-based generation; a database can supply the managed prompts. The SDK does not itself provide a built-in prompt management system. LangChain.js prompt helpers are another avenue for more complex AI workflows. section 5.1.3 section 6.0



