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.

FEATURE.BATCH

Last updated
FEATURE.BATCH group entity [entity ...] [FEATURES feature [feature ...]]
Group
Feature store
Complexity
O(E * F) where E is the number of entities and F the features returned
Arity
-3 (at least 3 words, counting the command name)
Flags
read-only, slow
Keys
first 1, last 1, step 1
HotKV Cloud
Performance and Scale
On-Premise
requires the feature-store license feature

The feature store keeps typed feature values for entities (users, items, sessions) in named feature groups, for low-latency reads at model inference time. FEATURE.BATCH works like FEATURE.GET for several entities at once. Every argument after group is an entity id until the FEATURES keyword; the names after it select the features to return for every entity. Without FEATURES, all features are returned.

Case RESP2 RESP3
Always Array with one element per entity, in the order given: the same three-element array as FEATURE.GET, or nil (null in RESP3) for an entity that does not exist. For an unknown group every element is nil. Same

Values come back as integers for int64 features, as decimal strings with six digits after the point for double features, and as bulk strings for string features.

Errors:

  • ERR wrong number of arguments for 'feature.batch' command if the argument count is wrong.
  • NOLICENSE feature-store requires a HotKV license. Contact sales@hotkv.com if your license does not include the feature-store feature.
127.0.0.1:6379> FEATURE.BATCH user_features user:42 user:999 FEATURES ctr
1) 1) 1) "ctr"
2) "0.051000"
2) (integer) 1790985600123
3) (integer) 7310
2) (nil)

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

FEATURE.CREATE, FEATURE.SET, FEATURE.GET, FEATURE.SCHEMA, FEATURE.STATS, FEATURE.DROP, FEATURE.LIST, AI features guide