Computational infrastructure for a self-aware agent