# VSIM.SAVE

> Write a named blob of vector data to a file on the server.

URL: https://docs.hotkv.com/commands/vsim-save/

```
VSIM.SAVE name blob
```

- Group: Vector search
- Complexity: O(N) where N is the size of the blob
- HotKV Cloud: Performance and Scale plans
- On-Premise: requires the vsim-persist license feature

VSIM persistence stores named blobs of vector data that you supply, such as an exported set of embeddings, as files on the server, separate from your snapshots and AOF. Each blob goes to a file named after it in the directory set by `dir` under `[vsim_persist]` (default `vsim_snapshots`) when `enabled = true` there. The files are local to each server, also in a cluster. `VSIM.SAVE` writes `blob` (any string or binary value) under
`name`, replacing a blob already saved under that name. It creates the
directory if needed. Names are 1 to 128 characters and cannot contain `/`, `\`, `.`, `:` or control characters.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Blob saved | Integer: the number of bytes written to the file | Same |

Errors:

- `ERR invalid snapshot name` if the name breaks the rules above.
- `ERR cannot create snapshot directory` or `ERR cannot open file for writing` if the server cannot write to the directory.
- `ERR wrong number of arguments for 'vsim.save' command` if the argument count is wrong.
- `NOLICENSE vsim-persist requires a HotKV license. Contact sales@hotkv.com` if your license does not include the `vsim-persist` feature.

## Examples

```
127.0.0.1:6379> VSIM.SAVE products-2026-10 "0.12,0.98,0.44;0.10,0.95,0.40"
(integer) 41
127.0.0.1:6379> VSIM.SAVE bad/name "x"
(error) ERR invalid snapshot name
```

## Compatibility

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

## See also

[VSIM.LOAD](https://docs.hotkv.com/commands/vsim-load/index.md), [VSIM.LIST](https://docs.hotkv.com/commands/vsim-list/index.md), [VSIM.DROP](https://docs.hotkv.com/commands/vsim-drop/index.md), [AI features guide](https://docs.hotkv.com/ai-features/index.md)