Monasteries were buildings where monks lived and worshipped God, devoting their lives to religion. Monks followed strict guidelines established by St. Benedict in 529 AD and took vows of poverty, chastity, and obedience. During the Middle Ages, monasteries were important centers of knowledge - they operated schools and libraries, copied manuscripts to preserve knowledge, and engaged in charitable works like hospitals. Monks had various roles like abbots in charge and lecturers who read lessons, while friars interacted more with the outside world.