EMBED.DEDUP.PUT
EMBED.DEDUP.PUT namespace hash model embedding
- Group
- Embeddings
- Complexity
- O(1)
- Arity
- 5 (exactly, counting the command name)
- Flags
- write, fast
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- Performance and Scale
- On-Premise
- requires the embed-dedup license feature
Embedding de-duplication stores each embedding once per content hash and counts references to it, so the same content embedded by many users or documents is stored, and paid for, only once. You compute the content hash and the embedding; HotKV keeps them in named namespaces. EMBED.DEDUP.PUT stores embedding (any string or binary value,
such as packed floats or JSON) under hash with a reference count of 1. If
hash is already stored, the stored embedding is kept unchanged and its
reference count goes up by 1. model records which embedding model produced
it. The namespace is created on first use.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| New embedding stored | Integer 1 |
Same |
| Already stored, reference added | Integer 0 |
Same |
Errors:
ERR namespace or entry limit reachedif a new namespace would exceedmax_namespaces, or a new entry would exceedmax_entries_per_namespace, under[embed].ERR wrong number of arguments for 'embed.dedup.put' commandif the argument count is wrong.NOLICENSE embed-dedup requires a HotKV license. Contact sales@hotkv.comif your license does not include theembed-dedupfeature.
Examples
Section titled “Examples”127.0.0.1:6379> EMBED.DEDUP.PUT org abc123 text-embedding-3-small "vector-bytes"(integer) 1127.0.0.1:6379> EMBED.DEDUP.PUT org abc123 text-embedding-3-small "vector-bytes"(integer) 0Compatibility
Section titled “Compatibility”HotKV-only command. Redis and Valkey have no equivalent.
See also
Section titled “See also”EMBED.DEDUP.GET, EMBED.DEDUP.RELEASE, EMBED.DEDUP.STATS, EMBED.DEDUP.PURGE, EMBED.DEDUP.DROP, EMBED.DEDUP.LIST, AI features guide
Was this page helpful?
Thanks for the feedback.