Handle a memory event.

        This function accesses the internal database. It writes a record
        containing state information and an optional note.

        :param obj: A :py:class:`~turberfield.dialogue.model.Model.Memory`
            object.
        :return: The supplied object.

def handle_memory(self, obj):
        """Handle a memory event.

        This function accesses the internal database. It writes a record
        containing state information and an optional note.

        :param obj: A :py:class:`~turberfield.dialogue.model.Model.Memory`
            object.
        :return: The supplied object.

        """
        if obj.subject is not None:
            with self.con as db:
                SchemaBase.note(
                    db,
                    obj.subject,
                    obj.state,
                    obj.object,
                    text=obj.text,
                    html=obj.html,
                )
        return obj