liveBook · Manning

Prompt management

As explained in Build AI-Enhanced Web Apps

Prompt management is the organized storage, updating, versioning, and governance of prompts used by an AI application.

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

How Build AI-Enhanced Web Apps covers it

How deep it goes
Explains storage rationale and an integration architecture, with version and test examples; does not demonstrate a database implementation.
Examples
Uses versioned translation templates, Vitest output checks, and a PlantUML diagram-generation architecture.
What you can do after
Evaluate and organize prompt variants for updates, testing, and rollback; understand where a prompt store fits in an AI application.
How it connects
Links prompt versioning and A/B testing to access control, output testing, Vercel AI SDK generation, and LangChain.js prompt helpers.

Also explained in

Compare how 4 books explain prompt management →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI-Enhanced Web Apps. The section links point to the parts of the book it draws on.