Prompt Composability
As you create more prompts, you will often find yourself using the same snippets of text or instructions in multiple prompts. To avoid duplication, you can compose prompts by referencing other prompts.
Why Use Composed Prompts?
- Create modular prompt components that can be reused across multiple prompts
- Maintain common instructions, examples, or context in a single place
- Update dependent prompts automatically when base prompts change
Get started
When creating the prompt via the Langfuse UI, you can use the Add prompt reference button to insert a prompt reference into your prompt.
Not exactly what you need? Consider these similar features:
- Variables for inserting dynamic text into prompts
- Message placeholders for inserting arrays of complete messages instead of strings
Or related FAQ pages:
- Can I dynamically select sub-prompts at runtime?
- Using external templating libraries (Jinja, Liquid, etc.) with Langfuse prompts
Was this page helpful?