In order to improve the efficiency and reliability of the microgrid, a multi-agent based control framework is presented. Then, a three-layer multi-agent control system, including main grid agents, microgrid agents and component agents, is established. Accordingly, the special functions and control strategies of each agent are discussed in detail. A simulation example of a particular microgrid based on the multi-agent system(MAS) is performed to demonstrate that the efficiency and reliability of the microgrid can be improved by using MAS.