You hear "AI" in every meeting, every product launch and every second post in your feed. People say models, tokens, agents and RAG as if everyone already knows. This course starts at zero and takes you all the way to how today's AI really works.
Each chapter builds on the one before. The main text gives you the idea. Open Go deeper at the end of a chapter when you want the detail underneath.
This morning your phone unlocked when it saw your face. Your inbox quietly hid a dozen spam emails. Your maps app said the drive would take 34 minutes, and it did. All three are AI. You've been using it for years.
So what is it? Here's the simplest definition that holds up:
Normal software runs on rules. A programmer writes: "If an invoice is more than 30 days late, send a reminder." The computer follows that rule exactly, every time. It does only what someone spelled out.
That works perfectly for clear tasks. It falls apart for fuzzy ones. Try writing rules for "is this a photo of a cat?" Pointy ears? Foxes have those. Whiskers? So do seals. You could write rules for a year and still miss the cat curled up in a cardboard box.
AI flips the approach. You show the computer thousands of photos labelled "cat" and "not cat". It works out the patterns itself. Then it can judge photos it has never seen.
Traditional software is a recipe: precise, repeatable, and stuck the moment an ingredient is missing. AI is closer to a cook who has made a dish a thousand times and adjusts by taste. The cook is flexible and usually right. Occasionally the cook gets it wrong with total confidence. Keep that in mind; it comes back in Chapter 7.
These terms sit inside each other, like nesting boxes:
When people say "AI" today, they usually mean the innermost box: generative AI.
AI is strongest at spotting patterns in large amounts of data, at working with language, and at any task where "fast and nearly right" is useful: a first draft, a summary, a guess at which leads are worth calling first. It is weakest where it has no examples to learn from, and where one mistake is expensive.
AI learns patterns from examples, so it can handle fuzzy tasks nobody could write rules for.
Every AI you use today is "narrow": trained for particular kinds of tasks, even if that range is now very wide. Artificial general intelligence (AGI) means a system that matches people at almost any mental task. Several labs say it's their goal. Experts disagree sharply on when it might arrive, and on how you'd even know.
Think about how your best sales rep learned to spot a good deal. Nobody handed them a rulebook. They saw hundreds of deals, noticed which ones closed, and built a gut feel. Ask why a deal feels shaky and they'll say "the champion went quiet" or "we still haven't talked budget".
Machine learning works the same way. Swap the gut feel for a lot of arithmetic.
Take a spam filter learning from a million old emails:
Training happens up front. It's slow and expensive. Using the finished model is called inference. Every time you ask a chatbot something, that's inference. Training is the years at school; inference is answering a question at work.
| Supervised | Unsupervised | Reinforcement | |
|---|---|---|---|
| What it gets | Examples with the right answers | Examples with no answers | A goal and a score |
| What it learns | To predict the answer | Hidden groups and patterns | Which actions win |
| You've seen it in | Spam filters, deal-win scores, face unlock | Grouping customers into segments | Game-playing AI, robots, and polishing chatbots (Chapter 5) |
Memorising instead of learning. A student who memorises last year's exam answers scores 100% on last year's paper and fails this year's. Models do the same. It's called overfitting. The fix is to always test a model on examples it never saw in training.
Learning the wrong lesson. A model only knows what its data shows. If every deal you won last year came from one city, a model may decide the city is what matters. Gaps and bias in the data become gaps and bias in the model. People call this "garbage in, garbage out".
A model learns by guessing, checking and nudging its settings, over and over, until its guesses on new examples are good.
Teams split their examples into three piles. The training set is what the model learns from. The validation set is used to tune choices along the way. The test set is locked away until the very end and used once, for an honest final score.
Say 1 in 100 payments is fraud. A model that always answers "not fraud" is 99% accurate, and catches nothing. So teams also ask two plainer questions. Precision: when it flags fraud, how often is it right? Recall: of all the real fraud, how much did it catch? Pushing one up usually pulls the other down, and the right balance depends on what a miss costs you.
When a new lead lands in your inbox, you size it up in seconds. Big company? Good sign. Job title says "intern"? Weaker. They booked a demo on their own? Strong. You give each signal a weight in your head, add them up, and decide.
That's a neuron. The building block of modern AI does exactly this.
Picture each weight as a dial. Learning means turning the dials.
One neuron can only learn simple patterns. Wire thousands together in layers, each feeding the next, and they can learn very complicated ones.
In an image model, the first layers learn to spot edges. Middle layers combine edges into shapes: an eye, a wheel, a letter. Later layers combine shapes into whole things: a face, a car, a word. Nobody programs these layers. They emerge from training. The "deep" in deep learning simply means many layers.
Imagine you're on a hillside in thick fog and you want to reach the valley floor. You can't see it. You can feel which way the ground slopes under your feet. So you take a small step downhill, feel again, and step again.
That's how a network learns. The height of the hill is how wrong its answers are, called the error or loss. Each training step works out which way to turn every dial to bring the error down a little, then turns them all a tiny amount. The technical name is gradient descent: gradient means slope, descent means going down.
When you read that a model has "175 billion parameters", that's 175 billion dials, each set by training. That number belonged to GPT-3 in 2020. Today's leading models are larger, though most companies no longer publish exact counts. More dials can hold more patterns. They also need more data and far more computing power to set.
Training means multiplying huge grids of numbers, billions of times over. Graphics chips (GPUs), first built for video games, can do thousands of those sums at once. That's why demand for AI chips turned Nvidia into one of the most valuable companies in the world.
The name "neural network" comes from a loose resemblance to brain cells. In practice it's one very large calculation: numbers go in, numbers come out.
A neural network is layers of weighted sums; training turns billions of dials until the answers come out right.
Type "See you" on your phone and the keyboard offers "tomorrow", "soon", "there". It's guessing the next word from what usually follows. ChatGPT and Claude run on the same idea, at a scale that changes what it can do.
Models read tokens, which are common words or pieces of words. A short common word is usually one token. A long or rare word gets split into a few. In English, 100 tokens is roughly 75 words.
Tokens matter for two practical reasons: they measure how much a model can hold in mind (Chapter 6), and they're how AI is priced (Chapter 10).
The model reads everything so far and gives every possible next token a probability.
The model picks a token, usually a likely one with a little randomness, adds it to the text, and predicts again. One token at a time, until the answer is finished. That's why replies appear word by word on your screen: you're watching them being generated.
Before it can chat, the model reads an enormous amount of text: public web pages, books, articles and code. Its only job is to predict the next token, trillions of times. This phase is called pretraining.
Predicting well forces it to pick up a great deal along the way. To finish "The capital of Japan is", it needs a fact. To finish a line of a sum, it needs to follow the steps. To continue a condolence letter, it needs the right tone. Grammar, facts, reasoning patterns and writing styles all come along as side effects of getting good at prediction.
Older models read left to right and lost track of long sentences. The transformer, published in 2017, takes in the whole passage at once. For every word, it works out which other words are relevant to it. This is called attention.
Read this: "The client cancelled the meeting because it clashed with their board review." You know at once that "it" means the meeting. Attention is how the model makes that link: "it" pays strong attention to "meeting". Stack dozens of attention layers and the model can follow who did what across many pages.
People genuinely disagree. Two things are clear. It has learned patterns of language and knowledge rich enough to explain, summarise, translate, write code and work through problems. And it builds every answer from those patterns, which is why it can sound certain and still be wrong. Chapter 7 is all about that.
A language model splits text into tokens and predicts the next one, again and again; reading a vast library makes those predictions smart.
Generative: it creates new text. Pre-trained: it did the big reading phase first. Transformer: the design underneath. The name belongs to OpenAI's models, but almost every chatbot today follows the same recipe.
Around 2020, researchers showed that models improve predictably as you add more data, more parameters and more computing power. That finding, often called "scaling laws", is why companies have spent so heavily on ever-larger training runs. It's also why new abilities keep appearing in bigger models that smaller ones lack.
The model you get straight out of pretraining is called a base model. It knows a lot and follows no instructions. The next chapter covers how it becomes an assistant.
Ask a fresh base model "What's a good subject line for a follow-up email?" and it might reply with three more questions. It has read so many FAQ pages that it assumes you're writing one. It's a brilliant mimic that has no idea its job is to help you.
A few more stages of training turn that mimic into an assistant.
The app quietly assembles one long piece of text and hands it to the model:
The model reads all of it and predicts a reply, token by token.
This surprises most people. Once training ends, a model's dials are frozen. It seems to remember earlier messages because the app re-sends the whole conversation every single time. Start a new chat and it starts fresh.
"Memory" features work the same way: the app saves notes about you and slips them into the conversation. The model itself learns nothing from talking to you. Whether a company uses your chats to train its next model is a separate question, covered in Chapter 10.
Newer reasoning models write out working steps before they reply, like scribbling on scrap paper. You may see this as "Thinking…" in the app. It takes longer and costs more, and it clearly improves maths, coding, planning and tricky questions. Many apps let you switch it on or choose how much thinking to allow.
Pretraining gives a model knowledge; examples and human feedback teach it to use that knowledge to help you.
Feedback training rewards answers people like. People tend to like being agreed with. So models can drift toward telling you your plan is great. This is called sycophancy, and labs actively train against it. You can counter it yourself by asking, "What's wrong with this?"
Companies can fine-tune a model further on their own examples, for instance thousands of past support replies, so it reliably matches a format or style. It's good for teaching how to answer. It's a poor way to teach facts that change, which is why Chapter 8 exists.
Imagine you hire a sharp freelancer and your whole brief is "write an email". You'd get something generic. Now imagine you tell them who it's for, what happened, what worried the client and how long it should be. You'd get something you could send.
AI is that freelancer. Fast, capable, and knows nothing about your situation until you tell it.
The model only knows two things: what it learned in training, and what's in the context. The context is the part you control. It's the biggest lever you have.
"Write a follow-up email."
Result: polite, generic, and about nobody.
"Write a follow-up to Priya, head of sales at a 40-person logistics firm. We demoed on Tuesday. She liked the pipeline view and worried about how long migration takes. Under 120 words, warm, and offer two times for a call next week."
Result: a draft you could send after a quick read.
Every model has a limit on how much it can take in at once, called the context window, measured in tokens. Today's larger models can hold hundreds of thousands of tokens, roughly a few novels' worth. Everything has to fit inside it: instructions, chat history, attachments and the reply.
In very long chats, early details can get less attention and the model may lose the thread. When a chat starts drifting, open a new one and paste in a short summary of what matters.
When the model picks its next token, it doesn't always take the top choice. A setting called temperature controls how adventurous it is. Low temperature gives predictable, near-identical answers. High temperature gives more varied, creative answers that wander more. Chat apps choose a middle setting for you.
AI knows only its training plus what you tell it; a clear, specific brief is the biggest lever you have.
You ask a chatbot for a prospect's annual revenue. It answers instantly: "$48 million, up 12% last year." It sounds sure. It's specific. And it may be entirely made up.
This is the most important chapter in the course. Knowing how AI fails is what lets you use it with confidence.
Remember how the model works: it predicts plausible next tokens. Plausible and true overlap most of the time, which is why it's so often right. When it lacks the facts, it still produces plausible text, because that's what it does. No alarm goes off inside it. This is called hallucination. Invented statistics, quotes nobody said and links to pages that don't exist are the classic signs.
| What happens | Why | What you do |
|---|---|---|
| Out of date | Training stops at a knowledge cutoff date. Anything later is unknown to it. | Use web search, or paste in current information. |
| Blind to your world | It can't see your inbox, CRM or files unless they're connected or pasted in. | Give it the material (Chapter 8). |
| Shaky counting | It sees tokens, not single letters or digits. Models famously miscounted the r's in "strawberry". | Ask it to use a calculator or code tool, or check yourself. |
| Too agreeable | Feedback training rewards answers people like. | Ask it to argue the other side. |
| Bias | It absorbs patterns from human writing, unfair ones included. | Review anything that affects people: hiring, credit, pricing. |
| Hidden instructions | Text inside a web page or email can carry commands the model follows. | Covered in Chapter 9. |
| Stakes | Examples | How to treat it |
|---|---|---|
| Low | Brainstorming, first drafts, rewording, summarising a document you've provided | Use freely, skim the result |
| Medium | Facts, figures, names, quotes, anything a customer will read | Check every claim that matters |
| High | Legal, medical, financial, contracts, anything costly to get wrong | Expert review before acting |
AI produces plausible text, and plausible is usually true but not always; give it sources and check what matters.
Each new generation of models hallucinates less. Three things help most: grounding (answering from documents you supply, Chapter 8), search (looking up current facts), and reasoning (checking its own working before answering). Models are also being trained to say "I don't know" more often.
Because every answer is still a prediction, the risk shrinks without reaching zero. The practical stance: treat AI like a brilliant new colleague. You'd trust their draft and still read it before it goes to a customer.
You want an assistant that can answer "What did we promise Northwind about onboarding?" or "Which help article covers bulk import?" The model has never seen your contracts, your CRM or your help centre. Its training ended long before you asked.
You have three ways to give it your knowledge.
| Paste it in | Retrieval (RAG) | Fine-tuning | |
|---|---|---|---|
| How it works | Attach the documents to your chat | The system finds the relevant passages and adds them for you | Train the model further on your examples |
| Best for | Questions about a few files | Large, changing knowledge: help centres, wikis, CRM notes | A consistent style, format or specialist task |
| Keeps up with changes? | Yes, paste the latest | Yes, automatically | Only after retraining |
| Effort | None | Medium, usually built into a product | High |
For most business knowledge, retrieval is the right choice. To see how it works, you need one more idea.
An embedding turns a piece of text into a long list of numbers that captures what it means. Think of it as a map where every sentence gets a spot. Sentences with similar meanings sit close together, even when they share no words at all.
Set up once
For every question
This is RAG, short for retrieval-augmented generation: retrieve the right passages, then generate an answer from them.
When RAG gives a bad answer, the search step is usually the culprit: it fetched the wrong passage and the model worked from that. Messy, duplicated or outdated documents lead to messy answers, so tidy sources pay off.
Embeddings place text on a map of meaning; RAG uses that map to find your relevant documents and hand them to the model.
You finish a call and say: "Log this call, move the deal to Proposal and book a follow-up for next Thursday." A plain chatbot can write you a lovely paragraph about doing those things. It produces text, so text is all you get.
Tools change that.
The app around the model offers it a menu of tools, each with a name and a plain description. For example: "update deal stage", "book calendar slot", "search the web". The model chooses when to use them.
That split keeps you in control. The model asks; the app decides what's allowed and what needs your approval.
An agent is a model that keeps going until a goal is met. It plans, acts, looks at the result, decides the next step, and repeats.
Say you ask: "Prepare me for tomorrow's call with Northwind." An agent might look up the account in your CRM, read the last three call notes, check recent news, notice a new VP of Sales, look up her background, and write you a one-page brief. You gave one instruction. It chose six steps on its own. Coding assistants, research assistants and CRM assistants all work this way.
Connecting an AI app to each tool used to need custom work every time. The Model Context Protocol (MCP), an open standard Anthropic introduced in 2024, works like USB-C for AI. A tool built once as an "MCP server" works with any AI app that supports MCP. That's why assistants can now connect to email, calendars, Slack, Notion or a CRM in a few clicks.
Tools let a model act; an agent is a model using tools in a loop until the job is done.
Claude, GPT, Gemini, Llama, Mistral, DeepSeek. Opus, Sonnet, mini, flash. Names arrive faster than anyone can learn them. You don't need to know them all. You need a way to sort them.
A model is the engine. An app is the car built around it. ChatGPT is an app; GPT models are the engine inside. Many products you already use, from writing tools to support bots to CRMs, run on one of a handful of engines underneath.
| Company | Model family | Where you'll meet it |
|---|---|---|
| OpenAI | GPT | The ChatGPT app, and many products built on it |
| Anthropic | Claude | The Claude app, and many coding and business tools |
| Gemini | The Gemini app, Gmail, Docs and Search | |
| Meta | Llama | Meta AI in WhatsApp and Instagram, and free downloads for builders |
| Others | Mistral, DeepSeek, Qwen, Grok | Fast-moving alternatives, many of them free to download |
Closed or open-weight. Closed models are used through the maker's app or service; you can't download them. Open-weight models publish their trained dials, so anyone can run them on their own computers. Open-weight gives you control and privacy. Closed models have often led on top-end ability.
Big or small. Most families come in sizes. Anthropic's Claude comes as Opus (largest), Sonnet (middle) and Haiku (smallest, fastest). Others use names like "mini", "flash" or "nano". Big means smarter, slower and pricier. Small means quick and cheap, ideal for simple tasks done in high volume.
Text only or multimodal. Most leading models now read images, PDFs, charts and screenshots, and some listen and speak. Image and video generators mostly use a different method called diffusion: start from random noise and remove it step by step, guided by your description, until a picture appears.
| If you need | Look for |
|---|---|
| Everyday writing and questions | Any leading assistant app; choose the one you enjoy using |
| Current events | One with web search turned on |
| Answers from company documents | A tool that uses RAG over your files and shows sources |
| Hard analysis, code or planning | A large model with thinking turned on |
| Simple tasks at high volume | A small, fast model |
| Data that must stay in-house | An open-weight model your team hosts |
The most reliable test is your own work: run the same real task through two or three options and compare the results side by side.
Before you put work information into any AI tool, find out three things. Does the provider use your conversations to train future models, and can you switch that off? Business and developer plans often exclude your data from training by default, while personal plans vary. How long is your data kept? And does your company already have an approved tool? Each provider's privacy terms answer the first two.
Assistant apps usually charge a monthly fee per person, often with a free tier. Builders who connect to a model directly pay per token, quoted per million tokens. Output tokens usually cost more than input tokens, and bigger models cost more per token than smaller ones. Prices change often, so please confirm on each provider's pricing page before signing up.
Sort models by maker, open or closed, and size; then choose by testing them on your real work.
You now understand AI better than most people who use it every day. It learns patterns from examples. It predicts text one token at a time. It knows only its training and your context. It can be confidently wrong. It can read your documents through retrieval, and act through tools.
Part two can take you further: measuring AI quality properly, building with AI directly, AI across sales and customer work, safety and regulation, and where the field is heading.