The Agentic AI Codex
Ch 01 · Foundations of AI
Chapter 01 · Theory

Foundations of Artificial Intelligence

Before any framework, before any prompt — there is a map. This chapter draws that map: what AI is, what it isn’t, how its sub-fields nest, the timeline that produced today’s LLMs, and the precise place where agents sit in this universe.

1.1 · What is AI, exactly?

Artificial Intelligence is the engineering discipline of building systems that perform tasks normally associated with human cognition — perception, reasoning, learning, planning, and decision-making — and that improve at those tasks with data, experience, or feedback.

Working definition
AI is a computational artefact that maps inputs to actions using knowledge that is at least partly learned from data, with the goal of optimizing some objective (accuracy, reward, user satisfaction, etc.).

Three test questions help you decide whether something deserves the label "AI":

  1. Is there an objective? If the system optimizes nothing, it’s automation, not AI.
  2. Is the behavior learned? A hand-written if/else tree is not AI just because it makes decisions.
  3. Does it generalize? If it only works on inputs it has seen, it’s memorization, not intelligence.

1.2 · The AI hierarchy — nested sets

The single most useful diagram in this entire book is the nested-circle view of AI’s sub-fields.

Artificial Intelligence Machine Learning Deep Learning Generative AI LLMs Agents = LLMs + Tools + Memory + Planning
LayerWhat it addsExample
AIAny system that exhibits intelligent behaviourChess engine, route planner
Machine LearningSystems that learn from dataSpam filter, fraud scorer
Deep LearningML using multi-layer neural networksImage classifier, speech-to-text
Generative AIDL that produces new contentImage diffusion, text generation
LLMsGenerative models specialized for languageGPT, Claude, Llama, Gemini
AgentsLLMs given tools, memory, goalsCoding agent, research agent

1.3 · Types of AI — three useful axes

The capability axis

ClassDescriptionStatus (2026)
Narrow AI (ANI)Excellent at one task. All deployed AI today.Mature
General AI (AGI)Matches or exceeds humans across most cognitive tasks.Active research
Superintelligence (ASI)Strongly exceeds the best humans at all cognitive work.Speculative
Watch the labels
Marketing teams call frontier LLMs "almost AGI". Researchers do not. For this book, everything we build is narrow AI — even when it feels uncannily general.

The functional axis (Arend Hintze, 2016)

  1. Reactive machines — no memory, pure stimulus → response. Deep Blue.
  2. Limited memory — uses recent history. Self-driving cars, most LLMs in a chat.
  3. Theory of mind — models other agents’ beliefs. Research only.
  4. Self-aware — has internal states it can reason about. Hypothetical.

The autonomy axis — six levels (this book’s scale)

LevelNameHuman role
L0SuggestionHuman does everything. AI ranks options.
L1Co-pilotHuman drives. AI completes lines / drafts.
L2AssistantAI takes one full subtask under supervision.
L3AgentAI plans + executes; human reviews artefacts.
L4Autonomous workerAI runs end-to-end; human audits weekly.
L5Autonomous organizationMulti-agent system with internal supervisors.

1.4 · The 75-year timeline

You don’t need every date — you need the five turning points that explain the present.

1950Turing Test 1956"AI" coinedDartmouth 1986BackpropNNs revive 2012AlexNetDL takeoff 2017Transformer“Attention is all you need” 2022→AgentsChatGPT → tool use → MCP
The Symbolic Era · 1956 – 1986
Idea: intelligence is rules + symbols + logic.
Wins: theorem provers, expert systems (MYCIN, XCON), Lisp ecosystem.
Why it stalled: the world is messy; rules don’t scale, and knowledge engineering is expensive.
Legacy alive today: tool schemas, planners, formal verification.
The Statistical Era · 1986 – 2012
Backpropagation (1986) made multi-layer networks trainable; SVMs, random forests, boosting dominated industry. Probabilistic graphical models gave a unifying language. Speech and search became real businesses.
The Deep Learning Era · 2012 – 2017
AlexNet on ImageNet halved error rates overnight. GPUs + bigger datasets + ReLU + dropout = a decade of rapid progress on vision, speech, translation.
The Transformer Era · 2017 – 2022
The Transformer replaced recurrence with attention. Suddenly sequence models could be parallelized at training time, and scaling laws revealed: bigger model + more data + more compute → better generalization.
The Agentic Era · 2022 → today
ChatGPT made LLMs mainstream. Tool-use, function calling, and protocols like MCP turned chat models into agents that can read files, call APIs, and run code. This is the era we build in.

1.5 · Three learning paradigms

Supervised

Learn from labels

Given (x, y) pairs, learn a function f so that f(x) ≈ y.

Used by: classifiers, regressors, language model fine-tuning (SFT).

Unsupervised

Learn from structure

Given only x, find structure — clusters, manifolds, factorizations, density.

Used by: embeddings, clustering, pre-training (next-token prediction is self-supervised).

Reinforcement

Learn from reward

An agent acts in an environment, receives reward, and updates its policy to maximise long-run reward.

Used by: game-playing, robotics, RLHF/DPO for LLM alignment.

Today’s LLMs use all three: self-supervised pre-training, supervised fine-tuning, and reinforcement-from-human-feedback. We unpack each in Chapter 6.

1.6 · Why agents — and why now?

For 50 years, AI research had three blocking constraints:

  1. Knowledge bottleneck — hand-coded rules cannot capture the world.
  2. Compute bottleneck — even good algorithms needed GPUs that didn’t exist.
  3. Interface bottleneck — every new task required a new model and a new API.

LLMs broke all three at once:

  • They compress the world into weights — a single model carries broadly useful knowledge.
  • They read natural language — instructions, schemas, and outputs use the same medium.
  • They plan and call tools — turning one model into a workforce for many tasks.
The agent definition we use in this book
An agent is a software entity that perceives its environment (inputs), reasons about goals, chooses actions (often via tool calls), and updates its state — typically powered by an LLM acting as the controller.

The minimum agent loop

Goal / Input→ Plan→ Act (tool)→ Observe→ Reflect→ Done?

Repeat until the goal is met or a budget is exhausted.

1.7 · Vocabulary you’ll see everywhere

term
Inference
definition
Running a trained model on new inputs. The expensive runtime step.
term
Training
definition
Adjusting model weights using a loss signal computed from data.
term
Embedding
definition
A learned vector that places similar inputs near each other in space.
term
Context window
definition
The max number of tokens an LLM can see in a single call.
term
Hallucination
definition
A confident but false generation. The single biggest agent failure mode.
term
Latency / TTFT
definition
Time to first token — the UX metric users actually feel.

Click any card to flip.

1.8 · Five myths to drop before Chapter 2

  1. “LLMs understand language.” They model statistical regularities of language. Useful, not the same.
  2. “Bigger is always better.” Bigger models help; great data, great prompts, and great tools help more.
  3. “Agents will replace engineers.” They replace tasks, not engineers. Engineers wield agents.
  4. “You need a PhD to build agents.” You need patience, system design, and product taste.
  5. “Frameworks are the moat.” Patterns are the moat. Frameworks change every six months.

1.9 · Self-check

Q1 · Which sub-field is a subset of all the others?
Machine Learning
Deep Learning
LLMs
Generative AI
Q2 · Which best matches our definition of an agent?
An LLM by itself
A chatbot
An LLM with tools, memory and a planning loop
A workflow with hard-coded steps
Q3 · Why are agents practical only now?
Cheaper compute alone
LLMs broke the knowledge + interface bottlenecks simultaneously
The cloud
Open-source datasets
Up next
We earn the right to talk about training and gradients by first learning the language they’re written in: linear algebra, probability, statistics and calculus.