getMostRecent method

List<Memory> getMostRecent(
  1. int n
)

Retrieves the n most recent episodic memories.

Implementation

List<Memory> getMostRecent(int n) {
  final all = _store.values.toList()
    ..sort((a, b) => b.timestamp.compareTo(a.timestamp));
  return all.take(n).toList();
}