Skip to main content
Prompt versioning lets you track which prompt template produced which agent outcomes. As you iterate on your prompts, you register each version in AgentVista, link it to the traces it produces, and then compare versions side-by-side on success rate, cost, and latency.

Prompt template fields

Each prompt template version has the following fields: The combination of name and version must be unique per account. If you try to register a duplicate, the API returns HTTP 409.

Workflow

1

Register a prompt version

Call POST /api/v1/dashboard/prompts/ to register a new version of your prompt:
When you ship an updated prompt, register it as the next version:
2

Run your agent

Run your agent as normal. Your existing SDK instrumentation captures the trace automatically. Make a note of the trace_id for each run so you can link it to the prompt version that produced it.If you are using the AgentVista Python SDK, the trace_id is available on the completed run object.
3

Record prompt usage

After each trace completes, call POST /api/v1/dashboard/prompts/usage to link the trace to the prompt version that produced it:
This call is idempotent — submitting the same (prompt_name, prompt_version, trace_id) combination more than once is safe.You can optionally include a span_id to link to a specific span within the trace rather than the trace header.
4

Compare versions in the dashboard

Once you have traces linked to multiple versions, open the prompt detail view in the dashboard. You will see a side-by-side table with per-version stats.You can also fetch comparison data directly from the API:
Example response:
In this example, version 2 achieves a 17-point higher success rate at the cost of a slightly higher average latency and per-run cost.

Viewing all versions

To list all registered versions of a specific prompt, call GET /api/v1/dashboard/prompts/{name}/versions. To list all prompts across all names, call GET /api/v1/dashboard/prompts/. Versions are returned newest first within each name.

Per-version metrics

The comparison endpoint computes the following metrics for each version, derived from all traces linked to that version:
Metrics are computed from the success, total_cost_usd, and duration_ms fields on traces linked to each prompt version. Make sure your SDK is recording outcome signals and cost data on each run — otherwise success_rate and cost metrics will be null.