Renewable energy resources are deemed a potential energy production source due to their cost efficiency and harmless reaction to the environment, unlike non-renewable energy resources. However, they often fail to meet energy requirements in unfavorable weather conditions. The concept of Hybrid renewable energy resources addresses this issue by integrating both renewable and non-renewable energy resources to meet the required energy load. In this paper, an intelligent cost optimization algorithm is proposed to maximize the use of renewable energy resources and minimum utilization of non-renewable energy resources to meet the energy requirement for a nanogrid infrastructure. An actual data set comprising information about the load and demand of utility grids is used to evaluate the performance of the proposed nanogrid energy management system. The objective function is formulated to manage the nanogrid operation and implemented using a variant of Particle Swarm Optimization (PSO) named recurrent PSO (rPSO). Firstly, rPSO algorithm minimizes the installation cost for nanogrid. Thereafter, the proposed NEMS ensures cost efficiency for the post-installation period by providing a daily operational plan and optimizing renewable resources. State-of-the-art optimization models, including Genetic Algorithm (GA), bat and different Mathematical Programming Language (AMPL) solvers, are used to evaluate the model. The study’s outcomes suggest that the proposed work significantly reduces the use of diesel generators and fosters the use of renewable energy resources and beneficiates the eco-friendly environment.