Skip to main content

Prompt Registry

The Prompt Registry is a versioned store for prompt templates. Instead of hardcoding prompts in your agent code, you register them once in Fact0 and fetch the latest version at runtime. Every registered prompt is tracked with usage statistics — call count, average token consumption, and average latency — directly from the spans that reference it.

Why use it

  • No redeployments for prompt changes — update a template in the dashboard, agents pick it up on the next request
  • Versioned history — every POST /v1/me/prompts creates a new version; older versions remain accessible
  • Usage analytics — see which prompts are called most, how many tokens they consume, and how long they take
  • Audit trail — prompt changes flow through the same tamper-evident log as all Fact0 events

Registering a prompt

Via the dashboard

Go to Observability → Prompt Registry and click Register Prompt. Fill in:

Via API

Each call creates a new version. The version number increments automatically.

Fetching a prompt at runtime

To list all prompts and find the one you want by name:

Prompt record schema


Linking a prompt to a span

To have usage statistics populated, tag your span with the prompt ID when you ingest it:

API reference