# PROMPT.PUT

> Add a new version of a prompt template and make it the active version.

URL: https://docs.hotkv.com/commands/prompt-put/

```
PROMPT.PUT name content [META metadata]
```

- Group: Prompt registry
- Complexity: O(1)
- HotKV Cloud: Performance and Scale plans
- 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.PUT` stores `content` as the next version of template
`name` (starting at 1), creating the template if needed, and makes the new
version active.

A template keeps its most recent versions only, up to `max_versions` under
`[prompt]` (64 unless you change it); older versions are removed.

## Options

| Option | Effect |
| --- | --- |
| `META metadata` | Any string to keep with this version, such as JSON describing the change. |

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Version stored | Integer: the new version number | Same |

Errors:

- `ERR template limit reached` if the template is new and the server already holds its maximum number of templates (`max_templates` under `[prompt]`).
- `ERR unknown option` if the fourth argument is not `META`.
- `ERR wrong number of arguments for 'prompt.put' 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.

## Examples

```
127.0.0.1:6379> PROMPT.PUT support-agent "You are a helpful support agent."
(integer) 1
127.0.0.1:6379> PROMPT.PUT support-agent "You are a concise, friendly support agent." META "{\"author\":\"maria\"}"
(integer) 2
```

## Compatibility

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

## See also

[PROMPT.GET](https://docs.hotkv.com/commands/prompt-get/index.md), [PROMPT.LATEST](https://docs.hotkv.com/commands/prompt-latest/index.md), [PROMPT.SETACTIVE](https://docs.hotkv.com/commands/prompt-setactive/index.md), [PROMPT.VERSIONS](https://docs.hotkv.com/commands/prompt-versions/index.md), [PROMPT.DROP](https://docs.hotkv.com/commands/prompt-drop/index.md), [PROMPT.LIST](https://docs.hotkv.com/commands/prompt-list/index.md), [AI features guide](https://docs.hotkv.com/ai-features/index.md)