The increased integration of distributed Renewable Energy Sources (RESs) and adoption of Electric Vehicles (EVs) require appropriate control and management of energy sources and EV charging. This becomes critical at the distribution system level, especially at a microgrid (MG) level. This control is required not only to mitigate the negative impacts of intermittent generation from RESs but also to make better use of available energy, reduce carbon footprint, maximize the overall profit of microgrid and increase energy autonomy by effective utilization of battery storage. This paper proposes a heuristic multi-agent based decentralized energy management approach for grid-connected MG. The MG comprises of active (controlled) and passive (uncontrolled) electrical loads, a photovoltaic (PV) system, battery energy storage system (BESS) and a charging post for electric vehicles. The proposed approach is aimed at optimizing the use of local energy generation from photovoltaic and smart energy utilization to serve electrical loads and EV as well as maximizing MG profit. The aim of the energy management is to supply local consumption at minimum cost and less dependency on the main grid supply. Utilizing energy available from RESs (PV and BESS), customers satisfaction (fulfilling local demand), considering uncertainty of renewable generation and load consumption and also taking into account technical constraint are the main strengths of the presented framework. Performance of the proposed algorithm is investigated under different operating conditions and its efficacy is verified.