Prompt Management
Prompts is a versioned registry for the prompts your application uses. You edit a prompt in ANTS Platform, point a label such as production at a version, and your application fetches the labelled version at runtime. Changing what is live does not need a code change or a redeploy.
Prompts is not in the sidebar today. Open it at /project/<projectId>/prompts on your ANTS Platform host, or follow the prompt link on a generation in a trace. Among the built-in roles, only Owner includes prompt access today. See Members & Roles.
Concepts
| Concept | Meaning |
|---|---|
| Prompt | A named template. Text prompts are a single string. Chat prompts are a list of messages with roles. Both use {{variable}} placeholders. |
| Version | Every save creates a new numbered version. Earlier versions are kept. |
| Label | A name that points at one version, such as production or staging. Labels are lowercase letters, digits, _, - and ., up to 36 characters. |
latest | Always points at the newest version. You cannot set it yourself. |
production | The version your app gets when it asks for a prompt without a version or label. |
| Config | Optional JSON stored with a version, for example model name and temperature. |
| Tags | Free form tags to organize and filter prompts. |
| Folders | A / in a prompt name, such as support/refunds, shows the prompt inside a folder. |
| Commit message | An optional note saved with a version. |
Create and use a prompt
Create the prompt
On the Prompts page select New prompt. Choose text or chat, write the template with {{variables}}, optionally add config, labels and a commit message, and save. This is version 1.
You can also create a version from code:
Label a version
On the prompt page, set labels on a version. Move production to the version you want live. Move it back to roll back.
From code:
Fetch it at runtime
get_prompt returns the production version unless you pass version= or label=. Passing prompt= links the generation to that prompt version. The outermost observation of a trace needs an agent_name.
Iterate
Open the version in the Playground with the Playground button, run an experiment with the Experiment button, then save a new version and move the label when you are ready.
The SDK caches fetched prompts in memory for 60 seconds by default and refreshes them in the background. See Prompts API & Caching for cache settings and the REST endpoints.
Composing prompts
A prompt can include another prompt with a reference tag. The tag is replaced with the referenced prompt's text when the prompt is fetched.
Use version=<n> instead of label= to pin a version. The prompt page shows the resolved prompt next to the template.
Protected labels
Under Project Settings > Protected Prompt Labels you can protect labels such as production. In the app, only users whose role can manage protected labels can then add or remove those labels, create a version with them, or delete a version or prompt that carries one. Protected labels are a plan feature; see Billing & Plans.
Other prompt features
- Version history and diff. Compare any two versions of a prompt.
- Metrics. The Metrics tab shows, per version, the number of linked generations, median latency, median input and output tokens, median cost, trace and generation scores, and when it was first and last used.
- Use Prompt. Copy ready-made Python and JS/TS snippets for fetching the prompt.
- Duplicate and delete. Duplicate a prompt, or delete a single version or the whole prompt.
- Comments. Leave comments on a prompt version.
- Automations. The Automations button on the Prompts page opens automations that send a webhook or Slack message when a prompt version is created, updated or deleted.
Next steps
- Prompts API & Caching: REST endpoints and caching.
- Playground: test a prompt against models.
- Experiments: compare prompt versions on a dataset.