Prompt
I'm building an LLM app and need a prompt registry with version history
Latest observation
Nov 4, 2026
OpenAI APIWeb search: off
A good prompt registry with version history should let you treat prompts like code: identifiable, auditable, testable, and easy to roll back.
Core capabilities
At minimum, include:
-
Prompt records
prompt_idnamedescriptiontagsownercreated_at,updated_at
-
Version history
version_idprompt_idversion_numbercontentchange_summarycreated_bycreated_atstatuslikedraft,active,archived
-
Environment mapping
dev,staging,prod- which version is currently deployed where
-
Audit trail
- who changed what and when
- immutable history for rollback and compliance
-
Testing metadata
- evaluation results
- sample inputs/outputs
- model used
- pass/fail metrics
Suggested data model
A simple relational schema could look like this:
prompts
idUUID PKnametext uniquedescriptiontextownertexttagstext[]created_attimestampupdated_attimestamp
prompt_versions
idUUID PKprompt_idUUID FK -> prompts.idversion_numberintcontenttextvariables_schemaJSONBchange_summarytextcreated_bytextcreated_attimestampis_activeboolean- unique (
prompt_id,version_number)
prompt_deployments
idUUID PKprompt_version_idUUID FK -> prompt_versions.idenvironmenttextdeployed_bytextdeployed_attimestamprolled_back_fromUUID nullable
prompt_evaluations
idUUID PKprompt_version_idUUID FKdataset_nametextmetricsJSONBnotestextcreated_attimestamp
Recommended workflow
- Create prompt
- Add version
- Validate schema
- Run evaluations
- Promote to staging
- Promote to production
- Track all changes
- Rollback if needed
API endpoints
If you’re exposing this as a service, useful endpoints are:
POST /promptsGET /promptsGET /prompts/{id}POST /prompts/{id}/versionsGET /prompts/{id}/versionsGET /prompts/{id}/versions/{version}POST /deploymentsGET /deployments?environment=prodPOST /versions/{id}/rollback
Versioning best practices
- Make versions immutable
- Store prompts as exact text, not generated state
- Include parameter schema for placeholders
- Require a change summary
- Support diffing between versions
- Keep active version pointer separate from the version content
- Add RBAC for who can edit or deploy
- Use semantic versioning if helpful, but simple incrementing numbers often work best
Example version record
{
"prompt_id": "p_123",
"version_number": 7,
"content": "You are a helpful assistant. Answer in JSON...",
"variables_schema": {
"type": "object",
"properties": {
"user_query": { "type": "string" }
},
"required": ["user_query"]
},
"change_summary": "Tightened JSON output format and added examples.",
"created_by": "alice@example.com",
"created_at": "2026-11-04T12:30:00Z",
"is_active": true
}
Nice-to-have features
- Side-by-side diff viewer
- Commenting/review approval
- A/B testing across versions
- Automatic regression testing
- Prompt templates with variables
- Rollback with one click
- Search by tag, owner, model compatibility
If you want, I can also help you with:
- a Postgres schema
- a Python/FastAPI implementation
- a Prisma/TypeScript schema
- a UI design for the registry