Digital Twin Network (DTN) is a new technology that builds on the concept of Digital Twins (DT) to create a virtual representation of the physical objects of a telecommunications network. DTN bridges physical and virtual spaces to enable coordination and synchronization of physical parts while eliminating the need to directly interact with them. In this work, we present B5GEMINI a DTN for 5G and beyond networks that makes an extensive use of artificial intelligence (AI). First, we present the infrastructural and architectural components that support B5GEMINI. Next, we explore five paradigmatic use cases where AI can leverage B5GEMINI for building new AI-powered applications. Finally, we identify the main components of the AI ecosystem of B5GEMINI.