AI prompt template with variables
A prompt template is a reusable, parameterised prompt: a fixed structure with named slots for variables, a system message, and places for few-shot examples, ready to be filled at request time. It is the difference between an instruction someone typed once into a chat box and an instruction a product sends ten thousand times a day. The structure is the asset; the filled-in text is just one rendering of it.
Parameterised text long predates language models, from printf format strings to email mail-merge. What changed is that the filled-in string now drives a probabilistic system whose behaviour is sensitive to wording, ordering, and example choice. A template that names its variables explicitly, {{customer_name}} or {{ticket_body}}, turns an ad-hoc prompt into something a team can reason about and reuse.
The practice matured into prompt management as products moved prompts out of source code and into dedicated stores. Tooling such as Langfuse and others popularised the split between the template, the editable structure, and its versions, the immutable snapshots. The mantra that prompts are code drove the rest: templates get reviewed, tested, and deployed through staged environments rather than edited live in production.
The current debate is where a template should live and who owns it. Keeping prompts in code couples them to releaseReleaseProduct SpecificationA shipped version of the productView reference → cycles, which slows iteration; moving them to a hosted store lets non-engineers edit them, which raises the riskRiskComplianceA risk to the product or businessView reference → of an unreviewed change reaching users. Most teams settle on a template held outside the binary but governed by the same review and versioning discipline as code.
A support tool defines one prompt template for ticket triage: a system message stating the assistant's role, two few-shot examples of correctly categorised tickets, and slots for {{ticket_body}} and {{customer_tier}}. Every incoming ticket renders the same template with different values, so 4,000 tickets a day share one auditable structure. When the product later adds a billing category, the team edits the template once, in one place, and every request picks up the change. Had the prompt been hardcoded at each call site, the same edit would mean hunting through the codebase and risking drift between copies.
In the Unified Product Graph, Prompt TemplateAI & Machine LearningA reusable prompt template lives in the prompt_templateai domain and sits early in its creation sequence, right after AI ModelAI & Machine LearningAn AI or ML model used within the productView reference →. Its versions hang off it through ai_modelPrompt VersionevolvesPrompt Templatecross-domain, the feature it serves connects through prompt_version_evolves_prompt_templatePrompt TemplatepowersFeaturecross-domain, and the product that calls it links via prompt_template_powers_featureProductprompted viaPrompt Templatehierarchy. A content calendarContent CalendarContent & KnowledgeA content publication calendarView reference → can even schedule a template through product_prompted_via_prompt_templateContent CalendarschedulesPrompt Templatehierarchy. Modelling the template as the durable parent and versions as its children is what enforces the domain's anti-pattern against prompts without versioning: an unversioned template is a visible gap in the graph, not a silent one in the code.content_calendar_schedules_prompt_template
Type-specific fields on BaseNode
use_casestringIntended use case for the prompt
variablesstring[]Variable names expected by the template
versionstringVersion identifier of the template
idstringrequiredUnique identifier (UUID)
typeNodeTyperequiredDiscriminator for the entity type
titlestringrequiredDisplay name
descriptionstringOptional detailed description
statusstringLifecycle status
tagsstring[]Freeform tags for filtering
4 phases — initial: draft · template: PUBLISHING
5 edge types connected to this entity.
product_prompted_via_prompt_templatecontent_calendar_schedules_prompt_templateprompt_version_evolves_prompt_templateprompt_template_powers_featureprompt_template_targets_ai_model