The Brief History of Artificial Intelligence
Chapter 2: The Middle Ages

Africa

7 min read

Illustrations

1 / 5
The University of Sankoré

The University of Sankoré in Timbuktu: African intellectual center welcoming thousands of students.

Libraries of Sand: How Medieval Africa Inscribed Thought in Memory

There are libraries the wind cannot erase. In the Middle Ages, while Europe still searched for light, Africa had already invented several ways to capture knowledge: in parchment and voice, in knots and sand, in stars and bodies. These multiple libraries—some visible, others invisible—constitute the forgotten foundations of what we now call artificial intelligence.

Yesterday — The Golden Age of Timbuktu

In 1324, a man crossed the Sahara with a caravan so sumptuous it destabilized Egypt's economy. Mansa Musa, emperor of Mali, carried so much gold that his passage caused inflation lasting decades. But the true wealth he brought back from his pilgrimage to Mecca was not metallic: it was scholars, architects, books. On his return, Timbuktu became what Baghdad had been, what Alexandria had been before it—the intellectual center of the known world.

The University of Sankore, founded around 989, reached unprecedented splendor under his reign. Twenty-five thousand students—a quarter of the city's population—studied mathematics, astronomy, logic, philosophy, and physics there. Training lasted an average of ten years. Books were the second most precious import, just after salt. Between four hundred thousand and seven hundred thousand manuscripts were produced over the centuries—the largest collection since the Library of Alexandria.

These manuscripts, many of which still lie with families in Timbuktu, contain treasures we are only beginning to inventory. Treatises on algebra and geometry. Star charts that predate Galileo. Planetary trajectory calculations. Algorithms for dividing inheritances according to Islamic law—combinatorial problems of formidable complexity, solved with an elegance that commands admiration.

Further north, in the Maghreb, another computational tradition was perpetuated. The "Fez numerals"—a mathematical notation predating Islam—coexisted with the Arabic numerals we use today. Ibn al-Banna, a fourteenth-century mathematician, wrote manuals explaining their principles. Al-Hassar, in the twelfth century, invented the modern fraction notation with the horizontal bar separating numerator and denominator. Al-Qalasadi perfected algebraic symbolism. These innovations crossed the Mediterranean through Toledo and Sicily, carried by translators like Constantine the African, born in Carthage, or Gerard of Cremona, who translated more than eighty works from Arabic to Latin.

In Tunis, in 1332, Ibn Khaldun was born. Trained in logic and mathematics by Al-Abili of Tlemcen, he became what economist Paul Krugman called "the fourteenth-century philosopher who essentially invented the social sciences." His Muqaddimah, completed in 1377, proposed a rational methodology for understanding history—not as a succession of events, but as a system of causes and effects analyzable by reason. North Africa was not content with calculation. It theorized the very conditions of knowledge.

In Ethiopia, monasteries perpetuated a distinct scholarly tradition. Emperor Zar'a Ya'eqob commissioned sophisticated calendrical calculations, recorded in manuscripts in the Ge'ez language. The Ethiopian Computus made it possible to predict the dates of liturgical feasts for centuries. Partial translations of Ptolemy's Almagest circulated. Monks calculated church dimensions with rigorous geometric principles.

We long believed that medieval Africa was an age of darkness. It was an age of light—but that light did not reach us.

Today — Algorithms in the Sand

If Timbuktu represented the visible library, another form of knowledge was transmitted in the royal courts and villages of West Africa: the library of bodies and voices.

The griots—those hereditary historians, musicians, and genealogists—constituted an information storage system of remarkable sophistication. A Mandinka proverb states: "When a griot dies, it is as if a library has burned." This is not a metaphor. A griot memorized the genealogies of entire villages over centuries, founding epics like that of Sundiata Keita, diplomatic protocols, the secrets of ruling families. Training began in childhood and could last decades. Music—kora, balafon, ngoni—served as a mnemonic aid, rhythm anchoring words in bodily memory.

This system foreshadows what computer scientists today call distributed memory. Each griot was a node in a network. Information was not centralized in a single place—it was distributed across a human fabric, resilient to local catastrophes. When the Mali Empire collapsed, the griots continued. When the manuscripts of Timbuktu were threatened, families hid them. Redundancy ensured survival.

But it was perhaps in sand that medieval Africa developed its most troubling innovations for the history of artificial intelligence. The Ifá system of the Yoruba, which had existed since Antiquity, underwent decisive expansion during the Middle Ages. Toward the end of the fifteenth century, Arugba, mother of the eighth Alaafin of Oyo, introduced it to the royal court. The system became structured, formalized, transmitted.

Recall its logic: two hundred fifty-six configurations obtained through binary combination—the exact equivalent of an eight-bit code. The babalawo does not divine randomly. He executes an algorithm. He generates a binary sequence, then consults a corpus of memorized verses to interpret it. Ethnomathematician Ron Eglash recognized in it a "pseudo-random number generator" and a "digital feedback loop."

Bamana geomancy, practiced from Senegal to Nigeria, pushed this logic further still. Eglash described it as "the most complex example of a fractal algorithm" he had encountered in his research. The diviner traces lines in the sand, groups them two by two, and generates figures according to precise rules. The "inspired" part of the consultation ends there. What follows is pure calculation—a reproducible, deterministic procedure that anyone possessing the rules could execute.

These African systems were transmitted to Europe in the twelfth century, via Muslim Spain. Ilm al-raml—"the science of sand" in Arabic—became Latin geomancy. The Yoruba sign Ọse-Tura was known to European geomancers as "Morning Star." In 1390, a geomantic treatise was presented to King Richard II of England. And when Leibniz, in the seventeenth century, formalized the binary system in his De Combinatoria, he knew these traditions. Binary was not born in European universities. It traveled—from African sand to silicon circuits, by way of royal courts and philosophers' libraries.

Beyond — Memory as Technology

Our modern artificial intelligences rely on air-conditioned data centers, undersea cables, server farms consuming the electricity of entire cities. They are powerful but fragile. An outage, a war, an economic collapse, and decades of data could disappear.

Medieval Africa had solved this problem differently. Its storage technologies depended neither on electricity, nor paper, nor even writing. They relied on what humans possess most robustly: body, voice, community. The griots transmitted their knowledge through conquests, epidemics, empire collapses. The babalawos have perpetuated the Ifá system for more than two millennia. The manuscripts of Timbuktu, hidden by families during the jihadist occupation of 2012, survived because knowledge was distributed, not centralized.

This resilience teaches us something essential. Intelligence—whether human or artificial—is not only a question of computing power. It is a question of architecture. A centralized system can be destroyed in one blow. A distributed system survives its parts. The griots understood this. Blockchain designers are rediscovering it.

Medieval Africa also reminds us that the algorithm does not need a machine to exist. An algorithm is a procedure—a sequence of reproducible steps that transforms an input into an output. Bamana geomancers executed algorithms in sand. Babalawos still execute them, with their palm nuts and divination chains. Ahmad Baba of Timbuktu wrote sixty works on logic and mathematics without ever touching a computer. Ibn Khaldun formalized a rational method for historical analysis four centuries before Auguste Comte.

The history of artificial intelligence, as usually told, jumps from Aristotle's syllogism to Turing's machine. It forgets the libraries of sand. It forgets Timbuktu. It forgets the griots.

This amnesia is not only an injustice. It is an intellectual error. For to understand what artificial intelligence could become, we must first understand all the forms intelligence has taken in human history. Medieval Africa invented several—some in paper, others in words, still others in grains of sand aligned according to rules that Leibniz himself recognized.

The sand fades, but thought endures—when it has found the right architecture for transmission.