def add(
      self,
      text: str,
  ) -> None:
    """Adds nonduplicated entries (time, text, tags, importance) to the memory.

    Args:
      text: what goes into the memory
    """
    if not self._embedder:
      raise ValueError('Embedder must be set before calling `add` method.')

    # Remove all newline characters from memories.
    text = text.replace('\n', ' ')

    contents = {
        'text': text,
    }
    hashed_contents = hash(tuple(contents.values()))
    derived = {'embedding': self._embedder(text)}
    new_df = pd.Series(contents | derived).to_frame().T.infer_objects()

    with self._memory_bank_lock:
      if hashed_contents in self._stored_hashes:
        return
      self._memory_bank = pd.concat(
          [self._memory_bank, new_df], ignore_index=True
      )
      self._stored_hashes.add(hashed_contents)
Adds nonduplicated entries (time, text, tags, importance) to the memory.

    Args:
      text: what goes into the memory
    
concordia/associative_memory/basic_associative_memory.py