The mechanics of self-knowledge