An important aspect of the phrase "Artificial Intelligence" is the ever-moving goalposts. In the mid 20th century, a machine that could follow and perform mathematical instructions was an insane and exciting dream of intelligent machines. Then we got the first computers, and people went "yeah okay but they're not intelligent" and the research of AI went into machines that could make useful decisions. Then we got programmable algorithmic machines, which clearly were "cool but not intelligent like us yes?" and the dream of AI became machines that could learn. Then machines that could imagine. Then machines that could conceivably impersonate humans. Right now the next goalpost is a bit up in the air with everything from "must have deep understanding" and "must have agency" to "must have soul", but the most workable contender seems to be "can know truth".
ANYWAY
So using the late-middle-of-AI-history definition of AI, we have machines that can make decisions and learn, taking over some human tasks.
The same basic concept, the "Centrifugal Governor" or "PID controller" has been invented independently since at least the 17th century. A full PID has the capacity to look at the state of a system (Proportional), estimate how the system will change (Derivative), and remember how the system responds to change (Integral).
The first controllers like the mechanisms used by windmills, and later the "centrifugal governor" invented for steam engines, mechanically changes how high the windmill stone should be or how much steam should be let out of the boiler, based on how fast the machine is running. While simple, it literally replaced human labor and was more effective than the person standing around and moving the lever whenever something seemed to go faster or slower. These did the equivalence of multiplication using only gears, levers and centrifugal force.
Then later, we have machines that could perform derivation! Whitehead torpedoes from the 19th century used pressure sensors and gravity-aligned levers to determine how deep a torpedo was in the water, and whether it was gaining depth (tilted down) or gaining height (tilting up). Still purely mechanical, these could be programmed to remain at a fixed depth, and gently steer themselves to the correct one if they were off. This meant you could just throw them into the water pointing the right direction and away they went.
Later again, and still before electronics we had the first instance of - via very strict use of definitions here - machine learning. A pneumatic PID controller would calculate an integration over all error values. It was used by American warships as an auto-pilot of sorts. It steered the rudder to maintain a course, and "learned" via an inflated balloon whether its steering was sufficient or not. The latter part was necessary because wind or streams would turn the ship in a way that pure calculation could not predict.
Today we use PIDs everywhere to control temperatures and hobby drone balance and a million other things, and they tend to be electronic. But, you might still find a mechanical PD controller in your chainsaw if you open it up.
Some more source material to dig into: https://en.wikipedia.org/wiki/Centrifugal_governor