KG4Diagnosis is a hierarchical multi-agent framework for medical diagnosis.It combines Large Language Models (LLMs) with automated knowledge graph construction.The framework includes a general practitioner (GP) agent for initial assessment and specialized agents for in-depth diagnosis.KG4Diagnosis facilitates the generation of knowledge graphs and can incorporate new diseases and medical knowledge.