# AMEM.EPIS.STATS

> Report the number of events and the oldest and newest timestamps in an agent's episodic memory.

URL: https://docs.hotkv.com/commands/amem-epis-stats/

```
AMEM.EPIS.STATS agent_id
```

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

Agent memory gives AI agents four kinds of memory. Episodic memory is an append-only log of timestamped events per agent, which you can query by event type and time range. `AMEM.EPIS.STATS` summarises an agent's log. For an agent with
no events, every field is zero.

## Return value

The reply is a flat array of alternating field names and values in both RESP2 and RESP3 (it is not sent as a RESP3 map). The fields, in order:

| Field | Type | Meaning |
| --- | --- | --- |
| `total_events` | Integer | Events in the log. |
| `oldest_ts` | Integer | Timestamp of the first event, in nanoseconds since the Unix epoch. |
| `newest_ts` | Integer | Timestamp of the last event. |

Errors:

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

## Examples

```
127.0.0.1:6379> AMEM.EPIS.STATS agent-42
1) "total_events"
2) (integer) 2
3) "oldest_ts"
4) (integer) 1790985600023456789
5) "newest_ts"
6) (integer) 1790985600123456789
```

## Compatibility

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

## See also

[AMEM.EPIS.LOG](https://docs.hotkv.com/commands/amem-epis-log/index.md), [AMEM.EPIS.QUERY](https://docs.hotkv.com/commands/amem-epis-query/index.md), [AMEM.EPIS.CLEAR](https://docs.hotkv.com/commands/amem-epis-clear/index.md), [AI features guide](https://docs.hotkv.com/ai-features/index.md)