The great libraries of the ancient world served as archives for empires, sanctuaries for sacred writings, and depositories of literature and chronicles.