A Waqf Begins with a Plan: What Does AI Add to Waqf Engineering?
Before a mosque or a school is endowed, its plan is drawn. Can AI save donors the cost of drawing, and where does its ability end?

The Nano capsuleOne minute
Every built waqf begins with a plan, and the cost and quality of that plan govern the later cost. Today AI can suggest preliminary room layouts from a simple diagram of the relationships between rooms, and researchers have trained a model on 117,000 house plans for this purpose. But it draws a draft; it knows neither the site's conditions, nor the requirements of the Saudi Building Code, nor the needs of worshippers or students. So the more useful idea is a waqf library of engineer-reviewed plans, with the tool used to adapt them and a licensed engineer approving them. That is a proposed idea, not yet shown by our sources.
Read the full article Collapse the article
Historical sources relate that Fatima al-Fihri spent her inheritance on building a mosque in the city of Fez, called al-Qarawiyyin, and circulating accounts date it to about 859 CE, though some historians doubt details of her biography. What concerns us is that the mosque was not built all at once; expansion and restoration followed over centuries, including a major enlargement between 1134 and 1143 under the Almoravids. A built waqf extends through time, and a good plan is what makes that extension possible.
From a mosque to a university
In 1963 the scholarly institution attached to the mosque became a state university, and teaching moved from the mosque to a new campus. Some describe al-Qarawiyyin as the oldest university in the world, a description that some repeat and encyclopaedic sources attribute to bodies such as UNESCO, while many researchers hold that the idea of a university is European in origin, and that the institution was closer to a madrasa before its restructuring. The lesson for today's endowers is that a waqf changes its use and grows across generations, so its plan is best drawn to allow expansion.
The plan before the stone
Pricing of building materials usually begins with one question: how many square metres? The answer is written in the plan. From the plan, quantities of materials are counted, cost is estimated and alternatives are weighed. The endower pays the price when the plan changes after work has begun, and when it is drawn without prior experience of what a mosque or school needs by way of facilities. Every endowed riyal spent on an amendment that could have been avoided is a riyal denied to the beneficiaries, and endowed money is a trust to be safeguarded.
What can AI do?
In 2020 researchers published a model called House-GAN. It takes a simple diagram specifying the number and types of rooms and which are adjacent, and proposes a preliminary layout for them as rectangles. It was trained on 117,000 house plans, and measured on realism, diversity and compatibility with the constraints. This is research on dwellings, not on mosques, schools or hospitals. Its output is rectangles standing for rooms: a draft for starting discussion, and neither a structural drawing nor a construction plan. It is useful at the stage of first ideas, when the endower wants to see more than one possible layout before paying for detailed design fees.
And what can it not do?
The model does not know your land: the direction of the qibla, site levels, setbacks and municipal requirements. Nor does it by itself read the requirements of the Saudi Building Code, whose application law was issued by royal decree in 2017 and whose provisions cover design, construction, operation and maintenance, and whose application was approved in phases, the last of which began in July 2022. The Code also applies to renovation, change of use and extension, which are common situations in waqfs. If a plan goes wrong, responsibility lies with the signing engineer, not with a tool.
A waqf library of plans: an idea awaiting a trial
The proposed idea is to set up an open store of model plans for recurring waqf facilities, such as a mosque, a school, a hall and a Quran-memorisation centre, reviewed by licensed engineers and copied in publicly declared versions. The small endower benefits from it, and AI is used to adapt a plan to the plot of land. The trial begins with one model for one common facility, whose cost and completion time are measured, and then a decision is made on expanding. Before implementation, several points must be settled:
- Who reviews the plan and bears responsibility for it?
- Who maintains the library and updates its versions as the Code changes?
- How are the designer's rights preserved and his contribution credited?
What is done for God's sake is best done well; the quality of the plan is part of the quality of the waqf.

