AI and LLMLLM applicationsPerformance and Scale plans

Prompt Versioning and Rollback

Version your system prompts in the data layer, roll a new one out to every service at once, and roll back in one command when it misbehaves.

command to roll back
1
redeploys
0
recent versions kept by default
64
Step 1 of 5
Publish version 1

The first version of the support agent's system prompt.

Example sessionplaying
# Publish version 1
hotkv> PROMPT.PUT support-agent "You are a helpful support agent."
(integer) 1

An animated walkthrough with real HotKV commands and example replies. Click any step to jump to it.

The problem

System prompts change more often than code, yet they usually live in the code. Every tweak is a deploy, different services drift onto different versions, and when a new prompt makes the assistant worse at 2 a.m., rolling back means another release.

How HotKV handles it

The prompt registry keeps every version of each template in HotKV. Services read the active version at runtime, an editor publishes a new version with one command, and choosing which version is active is a single atomic switch that every service sees on its next read.

Step by step

What happens, command by command

  1. 01

    Publish version 1

    The first version of the support agent's system prompt.

    PROMPT.PUT support-agent "You are a helpful support agent."
  2. 02

    Services read the active version

    Every service fetches the template at runtime instead of compiling it in.

    PROMPT.GET support-agent
  3. 03

    Roll out version 2

    A new version with metadata about who wrote it. It becomes active for every service at once.

    PROMPT.PUT support-agent "You are a concise, friendly support agent." META "{\"author\":\"maria\"}"
  4. 04

    Something is off, so roll back

    Answers got too terse. One command makes version 1 active again. No deploy, no restart.

    PROMPT.SETACTIVE support-agent 1
  5. 05

    Audit the history

    Recent versions stay in the registry, 64 by default, so you can compare them or return to any of them.

    PROMPT.VERSIONS support-agent
Where it fits

Real-world scenarios

Product teams iterating on tone

Writers adjust the assistant's voice daily without waiting for an engineering release, and recent versions are kept.

Multi-service platforms

Chat, email drafting and summarisation all read the same template, so a fix lands everywhere at the same moment.

Incident response

When a prompt change causes bad answers in production, on-call rolls back in seconds with one command.

Built in

What you get

Versioned templates

Each PROMPT.PUT adds a version and makes it active. The most recent versions are kept, 64 by default.

PROMPT.PUTPROMPT.VERSIONS

Read at runtime

Services read the active version, or a specific one, with a single call.

PROMPT.GETPROMPT.LATEST

Instant rollback

Switch the active version atomically.

PROMPT.SETACTIVE

Metadata

Keep the author, the change reason or an experiment id with each version.

META

Common questions

Do services need to restart after a change?

No. They read the active version at runtime, so the next read returns the new one.

Can I keep my prompts in Git as well?

Yes. Publish from CI with PROMPT.PUT, so Git stays the source of review and HotKV serves the live version.

Which plans include it?

The prompt registry is part of the Performance and Scale plans.

Related use cases

Try it on your own workload

HotKV speaks the Redis protocol, so you can point an existing client at it and run these same commands.