This paper presents a novel class of self-organizing multi-agent systems that form a swarm and learn a spatiotemporal process through noisy measurements from neighbors for various global goals. The physical spatio-temporal process of interest is modeled by a spatio-temporal Gaussian process. Each agent maintains its own posterior predictive statistics of the Gaussian process based on measurements from neighbors. A set of biologically inspired navigation strategies are identified from the posterior predictive statistics. A unified way to prescribe a global goal for the group of agents is presented. A reference trajectory state that guides agents to achieve the maximum of the objective function is proposed. A switching protocol is proposed for achieving the global maximum of a spatiotemporal Gaussian process over the surveillance region. The usefulness of the proposed multi-agent system with respect to various global goals is demonstrated by several numerical examples.