# FEATURE.BATCH

> Read feature values for many entities of a feature group in one call.

URL: https://docs.hotkv.com/commands/feature-batch/

```
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
- HotKV Cloud: Performance and Scale plans
- 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](https://docs.hotkv.com/commands/feature-get/index.md) 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.

## Return value

| 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.

## Examples

```
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)
```

## Compatibility

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

## See also

[FEATURE.CREATE](https://docs.hotkv.com/commands/feature-create/index.md), [FEATURE.SET](https://docs.hotkv.com/commands/feature-set/index.md), [FEATURE.GET](https://docs.hotkv.com/commands/feature-get/index.md), [FEATURE.SCHEMA](https://docs.hotkv.com/commands/feature-schema/index.md), [FEATURE.STATS](https://docs.hotkv.com/commands/feature-stats/index.md), [FEATURE.DROP](https://docs.hotkv.com/commands/feature-drop/index.md), [FEATURE.LIST](https://docs.hotkv.com/commands/feature-list/index.md), [AI features guide](https://docs.hotkv.com/ai-features/index.md)