[docs]    def add_message(self, message: BaseMessage) -> None:
        """Append the message to the record in Redis"""
        self.redis_client.lpush(self.key, json.dumps(_message_to_dict(message)))
        if self.ttl:
            self.redis_client.expire(self.key, self.ttl)
[docs]    def clear(self) -> None:
        """Clear session memory from Redis"""
        self.redis_client.delete(self.key)