def retrieve_associative(
      self,
      query: str,
      k: int = 1,
      use_recency: bool = True,
      use_importance: bool = True,
      add_time: bool = True,
      sort_by_time: bool = True,
  ) -> Sequence[str]:
    """Retrieve memories associatively.

    Args:
      query: a string to use for retrieval
      k: how many memories to retrieve
      use_recency: whether to use timestamps to weight by recency or not
      use_importance: whether to use importance for retrieval
      add_time: whether to add time stamp to the output
      sort_by_time: whether to sort the result by time

    Returns:
      List of strings corresponding to memories
    """
    query_embedding = self._embedder(query)

    data = self._get_top_k_similar_rows(
        query_embedding,
        k,
        use_recency=use_recency,
        use_importance=use_importance,
    )

    return self._pd_to_text(data, add_time=add_time, sort_by_time=sort_by_time)
Retrieve memories associatively.

    Args:
      query: a string to use for retrieval
      k: how many memories to retrieve
      use_recency: whether to use timestamps to weight by recency or not
      use_importance: whether to use importance for retrieval
      add_time: whether to add time stamp to the output
      sort_by_time: whether to sort the result by time

    Returns:
      List of strings corresponding to memories
    
concordia/associative_memory/deprecated/associative_memory.py