prompt-eng
Glossary ↗Prompt Library
A prompt library is an organized, typically version-controlled collection of pre-written, tested prompt templates that a team, product, or individual maintains for reuse — ranging from a simple internal wiki of "prompts that work well for X" to a formal, structured repository integrated into a codebase or a dedicated prompt-management platform (LangSmith, PromptLayer, Langfuse, or a company's internal prompt registry) with versioning, tagging, and usage tracking. Prompt libraries solve a real organizational problem that emerges once a team is running more than a handful of AI features: without a shared library, prompt engineering knowledge stays siloed in individual developers' heads or scattered across code files, effective patterns get rediscovered repeatedly instead of reused, and there's no single place to see "what prompts are we running in production, and which model/version are they tuned for." A mature prompt library typically organizes templates by use case (classification, summarization, extraction, generation), tags each with metadata (which model/version it was tuned and evaluated against, expected token cost, last-updated date, owner), links each template to its evaluation results, and — critically — treats prompts as versioned artifacts subject to the same change-review discipline as application code, since a "small wording tweak" to a widely-used template can silently regress accuracy across every feature that depends on it. For SaaS builders, investing in a prompt library pays off non-linearly as the number of AI features grows: a 2-3 feature product can get away with prompts scattered in code; a product with 20+ AI-powered features without a shared library and evaluation discipline accumulates significant technical debt and inconsistent quality across features. Concrete worked example: an AI-powered project-management SaaS maintains a prompt library with categories like "task_extraction," "meeting_summarization," and "status_report_generation." Each entry includes the current production template, 2-3 prior versions with changelogs ("v3: added explicit date-format instruction after v2 produced inconsistent date parsing in EU vs US format"), the evaluation dataset it's tested against, and its measured accuracy score. When a new engineer builds a "generate sprint retrospective" feature, they start from the closest existing template in the library (status_report_generation) rather than writing a summarization prompt from scratch, inheriting months of accumulated wording refinements instantly.
Related terms