Artificial Intelligence (AI)

What AI is at the first layer: human decisions turned into computer rules — before machine learning enters the picture.

What Is AI?

Artificial intelligence is a goal, not a technique. It is the name for getting a computer to do a job that used to need a person — and nothing in the phrase says how.

That goal shows up everywhere: sorting mail, flagging fraud, suggesting the next word, routing a delivery van. Some of those systems follow rules a human wrote. Some learn from examples. The word AI covers all of them. This page stays at the first layer — judgment turned into code — before anything starts learning on its own.

The decision loop

Strip the marketing away and most AI systems share one shape. Something in the world changes. The program notices, checks what it was told to do, reaches a conclusion, and acts. That cycle — observe, match rules, infer, act — is the whole job, whether the rules fit on a napkin or fill a server rack.

Observeread the situationMatch ruleswhich ones apply?Inferreach a conclusionActdo somethingrepeat

A thermostat does exactly this. It reads the room, compares the number to thresholds somebody chose, decides heat or off, and flips a relay. A person used to walk over and turn a dial; now the loop runs a thousand times a day without anyone in the room. The intelligence — if you want to call it that — lives in the rules and in whoever wrote them.

From human judgment to computer rules

Before computers, decisions lived in people. A clerk sorted mail by hand. A mechanic listened for a knock. A nurse noticed a fever. Each case was a little different, and experience filled in the gaps — the things nobody had written down.

Software forced a trade. To automate a job you had to say what to do in every situation you cared about. Experts sat down, named the signals that mattered, and wrote the tests: if the temperature is below eighteen, turn the heat on. Readable, testable, and only as good as the expert’s list.

What the human brought

Context, exceptions, and the ability to notice something nobody thought to write a rule for. That is why a junior hire and a twenty-year veteran can read the same policy and reach different answers.

What the computer got

Speed, consistency, and the ability to run the same loop at midnight on a holiday. The rules do not get tired, but they also do not improvise — they only fire when a case matches something on the list.

Hand-written rule systems were called AI for decades because they replaced human judgment at scale. Chess programs built from heuristics, spam filters built from if statements, credit checks built from score thresholds — same loop, different domain. None of them learned anything; they just executed what someone typed.

Rules as code

The thermostat example in TypeScript is almost embarrassingly small. That is the point: the entire decision is visible in one function, and you can argue about every line.

decide.tsTypeScript
type Mode = "heat" | "off" | "cool";

function decide(temperatureC: number): Mode {
  if (temperatureC < 18) return "heat";
  if (temperatureC > 24) return "cool";
  return "off";
}

decide is the infer step from the diagram. The observe step is whatever reads the sensor; the act step is whatever switches the relay. Change 18 to 20 and every room behaves differently — which is the blessing and the curse of rule-based AI. You always know why it did something, because you wrote the reason.

Automation is not the same as AI

A cron job that emails a report every Monday is automation. A script that deletes files older than ninety days is automation. Neither one observes, infers, or chooses — it runs the same steps on a schedule. AI, in the sense this page uses, means the output depends on what came in: different email, different temperature, different answer.

This page is the first layer only. When the rule list gets too long to maintain — or nobody can write the rule in the first place — teams reach for machine learning, where examples replace hand-written tests. The vocabulary for that shift lives on the Terms tab; worked cases that run the loop on real inputs are on Examples.

Related concepts

TopicDescription
Machine LearningHow a model improves from examples: labels, features, training, and the difference between fitting data and predicting on new data.
Deep LearningMachine learning with stacked neurons and ReLU layers: how a deep network builds a price guess from house features in TypeScript.