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/promptscreates 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:| Field | Required | Description |
|---|---|---|
| Name | Yes | Unique identifier for this prompt (research-agent-system) |
| Template | Yes | The prompt text. Use {{variable}} placeholders for dynamic values |
| Variables | No | Comma-separated list of variable names expected in the template |
| Model hints | No | Suggested models (gpt-4o, claude-sonnet-4-6) — informational only |
| Metadata | No | Arbitrary JSON key/value pairs |
Via API
Fetching a prompt at runtime
Prompt record schema
| Field | Description |
|---|---|
id | Stable ULID — use this to fetch a specific prompt |
name | Human-readable identifier |
version | Auto-incremented on each POST |
template | Raw prompt text with {{variable}} placeholders |
variables | Expected placeholder names |
model_hints | Suggested models (informational) |
usage_count | Number of spans referencing this prompt (computed) |
avg_tokens | Mean token consumption per use (computed) |
avg_latency_ms | Mean latency per use (computed) |
Linking a prompt to a span
To have usage statistics populated, tag your span with the prompt ID when you ingest it:API reference
| Method | Path | Description |
|---|---|---|
GET | /v1/me/prompts | List all prompt versions for the current tenant |
POST | /v1/me/prompts | Register a new prompt (or new version of an existing name) |
GET | /v1/me/prompts/{id} | Fetch a specific prompt version by ID |