def retrieve_recent(
      self,
      k: int = 1,
  ) -> Sequence[str]:
    """Retrieve memories by recency.

    Args:
      k: number of entries to retrieve

    Returns:
      List of strings corresponding to memories, sorted by recency
    """
    if k <= 0:
      raise ValueError('Limit must be positive.')

    with self._memory_bank_lock:
      if self._memory_bank.empty:
        return []
      return self._pd_to_text(self._memory_bank.iloc[-k:])
Retrieve memories by recency.

    Args:
      k: number of entries to retrieve

    Returns:
      List of strings corresponding to memories, sorted by recency
    
concordia/associative_memory/basic_associative_memory.py