# FEATURE.SET

> Write one or more feature values for an entity in a feature group.

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

```
FEATURE.SET group entity feature value [feature value ...]
```

- Group: Feature store
- Complexity: O(F) where F is the number of features given
- 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.SET` writes the given features of `entity`, creating the
entity if needed (its other features keep their current or default values),
and records the time of the update.

Each value is read according to the feature's type in the schema. Make sure
`int64` and `double` values are valid numbers: a value that does not parse
is stored as `0`. Feature names that are not in the schema are ignored.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Values written | Simple string `OK` | Same |

Errors:

- `ERR group not found` if the group does not exist.
- `ERR invalid value for feature 'name' (type)` if a value does not fit the feature's type, for example `abc` or `1.5` for an `int64`.
- `ERR unknown feature 'name' for group 'group'` if the group's schema has no such feature.

On any of these errors nothing is written for that call, and the entity is not created.
- `ERR wrong number of arguments for 'feature.set' command` if no pair is given or a feature has no value.
- `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.SET user_features user:42 age 31 ctr 0.042 country DE
OK
127.0.0.1:6379> FEATURE.SET user_features user:42 ctr 0.051
OK
```

## Compatibility

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

## See also

[FEATURE.CREATE](https://docs.hotkv.com/commands/feature-create/index.md), [FEATURE.GET](https://docs.hotkv.com/commands/feature-get/index.md), [FEATURE.BATCH](https://docs.hotkv.com/commands/feature-batch/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)