Hello Shah, from Wikipedia about the Direction Gyro, or Heading Indicator (HI):
<The HI works using a gyroscope to establish an inertial platform, which will remain fixed in space.>
The DG will remain fixed on an axis in space, so will pick up errors requiring regular adjustment to a compass heading as the earth rotates. The Artificial Horizon simply hangs in the local gravity field wherever you are as it rotates to show movement about your local vertical. Therefore the Artificial Horizon is an 'earth gyroscope' while the DG is referenced to a point in space.