Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

PROMPT.SETACTIVE

Last updated
PROMPT.SETACTIVE name version
Group
Prompt registry
Complexity
O(N) where N is the number of stored versions
Arity
3 (exactly, counting the command name)
Flags
write, fast
Keys
first 1, last 1, step 1
HotKV Cloud
Performance and Scale
On-Premise
requires the prompt-registry license feature

The prompt registry stores versioned prompt templates by name, with one version marked active, so you can roll a prompt forward or back without deploying code. PROMPT.SETACTIVE points the template’s active version at version, which must still be stored. Use it to roll back a bad prompt. The next PROMPT.PUT makes its new version active again.

Case RESP2 RESP3
Active version changed Simple string OK Same

Errors:

  • ERR template or version not found if the template or the version does not exist.
  • ERR invalid version if version is not a non-negative integer.
  • ERR wrong number of arguments for 'prompt.setactive' command if the argument count is wrong.
  • NOLICENSE prompt-registry requires a HotKV license. Contact sales@hotkv.com if your license does not include the prompt-registry feature.
127.0.0.1:6379> PROMPT.SETACTIVE support-agent 1
OK
127.0.0.1:6379> PROMPT.GET support-agent
1) (integer) 1
2) "You are a helpful support agent."
3) ""
4) (integer) 1790985000

HotKV-only command. Redis and Valkey have no equivalent.

PROMPT.PUT, PROMPT.GET, PROMPT.LATEST, PROMPT.VERSIONS, PROMPT.DROP, PROMPT.LIST, AI features guide