# AMEM.SUMMARY.APPEND

> Append text to an agent's rolling summary and return its new version number.

URL: https://docs.hotkv.com/commands/amem-summary-append/

```
AMEM.SUMMARY.APPEND agent_id text
```

- Group: Agent memory
- Complexity: O(1)
- HotKV Cloud: Performance and Scale plans
- On-Premise: requires the amem-summary license feature

Agent summaries keep one rolling, versioned text summary per agent, so a long-running agent can carry a compact summary in its prompt instead of its whole history. `AMEM.SUMMARY.APPEND` adds `text` to the end of the summary,
on a new line if the summary was not empty, creating the entry if needed. It
increments the version.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Text appended | Integer: the new version | Same |

Errors:

- `ERR wrong number of arguments for 'amem.summary.append' command` if the argument count is wrong.
- `NOLICENSE amem-summary requires a HotKV license. Contact sales@hotkv.com` if your license does not include the `amem-summary` feature.

## Examples

```
127.0.0.1:6379> AMEM.SUMMARY.APPEND agent-42 "Prefers window seats."
(integer) 3
127.0.0.1:6379> AMEM.SUMMARY.GET agent-42
1) "User booked flights to Paris for May 3-10.\nPrefers window seats."
2) (integer) 3
3) (integer) 1790985600
```

## Compatibility

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

## See also

[AMEM.SUMMARY.SET](https://docs.hotkv.com/commands/amem-summary-set/index.md), [AMEM.SUMMARY.GET](https://docs.hotkv.com/commands/amem-summary-get/index.md), [AMEM.SUMMARY.DROP](https://docs.hotkv.com/commands/amem-summary-drop/index.md), [AMEM.SUMMARY.LIST](https://docs.hotkv.com/commands/amem-summary-list/index.md), [AI features guide](https://docs.hotkv.com/ai-features/index.md)