A Wireless Sensor Network (WSN) is of paramount importance in facilitating smart Agricultural Internet of Things (Agri-IoT). It connects numerous sensor nodes or devices to develop a robust framework for efficient and seamless communication with improved throughput for intelligent networking. Such enhancement has to be facilitated by an adequate and smart machine learning-based resource allocation approach. With the ensuing surge in the volume of devices being deployed from the smart Agri-IoT, applications such as intelligent irrigation, smart crop monitoring and smart fishery would be largely benefited. However, the existing resource allocation techniques would be inefficient for such anticipated energy-efficient networking. To this end, we develop a distributed artificial intelligence approach that applies efficient multi-agent learning over the WSN scenario for intelligent resource allocation. The approach is based on dynamic clustering which coupled tightly with the Back-Propagation Neural Network and empowered by the Particle Swarm Optimization (BPNN-PSO). We implement the overall framework using a Bayesian Neural Network, where the outputs from BPNN-PSO are supplied as weights to the underlying neuron layer. We observe that the cost function and energy consumption demonstrate a substantial improvement in terms of cooperative networking and efficient resource allocation. The approach is validated with simulations under realistic assumptions.