Skip to the content.

Context

LLM-generated artifacts (example sentences, summaries, labels) are written to persistent storage and reused for a long time, while the models and prompts that produce them keep improving. The prompt changes more often than the model, and can matter as much to output quality, sometimes more.

Example

When the system generates example sentences for a word, it stamps each stored sentence with a created_by value naming the model and prompt version that produced it (for example, claude-opus / examples-v3). When the example-generation prompt is improved to v4, the stale sentences are exactly those still stamped v3, so a single query finds them and they are regenerated, without touching the rest of the store.

Problem

When a prompt or model improves, how can exactly the stale artifacts be found and regenerated, without reprocessing the entire store?

Forces

Solution

Store the full provenance tuple alongside every LLM-generated artifact: model version, prompt version, generated output, timestamp. This turns regeneration into a targeted query, as broad as “re-run everything produced by prompt v2 with the improved v3” or as narrow as a single (model, prompt) pair, so when a prompt does well on one model and poorly on another, only that combination is redone.

Consequences

Known Uses

Notes


💬 Open an issue about this pattern