Manage, version, and fetch prompts dynamically to accelerate agent iteration and experimentation.
{{variable_name}}
.For example, your prompt in python might look likef"summarize this page: {page_text}"
then when you copy it into the Prompt Database change it to"summarize this page: {{page_text}}"
Note: ALWAYS save a prompt if you make changes to it that you would like to keep.
Name | Type | Description |
---|---|---|
prompt_name | str | The name of the prompt to fetch. |
label | str (optional) | The label of the prompt to fetch. Defaults to production . |
variables | dict (optional) | A dictionary of string key/values to interpolate into the prompt. |
cache_ttl | int (optional) | The time-to-live for the prompt in seconds. Defaults to 300 seconds (0 = no cache, -1 = cache forever, n = cache for n seconds). |
If your prompt references {{variable_name}}
but you don’t provide a value, you’ll get a warning. If you provide variables that aren’t used in the prompt, you’ll get an error
Label | Behavior |
---|---|
latest | Always points to the most recent version |
production | The “live” version used by default |
development | Convenience label for testing changes before production |
test | Convenience label for testing changes before production |
Custom | Any user-defined label for testing or segmentation |
latest
label automatically moves to itproduction
label is a manual action (to ensure stability)beta
, experiment-a
, region-specific
) can be created by you for specific use cases{{variable_name}}
In Your Code | In Prompt DB |
---|---|
f"summarize this: {text}" | "summarize this: {{text}}" |
"analyze data: " + data_str | "analyze data: {{data_str}}" |
template.format(query=user_query) | "...your query: {{query}}" |
Generate {{number}} ideas about {{topic}}
In your code, you would call it like this:
Generate 5 ideas about artificial intelligenceAnother example: In the Prompt DB UI, you would define the prompt as:
In your code, you would call it like this:{{system_prompt}}
Answer the user's question: {{question}}
You are a helpful AI assistant specialized in biology. Answer the user’s question: How do cells divide?
{{variable_name}}
but you don’t provide a value, you’ll get a warninglatest
label is moved to the new versionproduction
label to the new version