An advanced generalization of this idea, adapted to the needs of algebraic geometry, is the étale fundamental group