Learn AI & LLM fundamentals

How large language models work, prompting, tools, agents, RAG and safety

24 lessons · 5 hours · 4 levels · covers AI & LLM fundamentals as of Oct 2026

A vendor-neutral foundation for working with large language models such as ChatGPT, Claude and Gemini, whether in a chat app, a no-code automation tool or your own code. It covers what models do and where they fail, how to prompt them, structured output and tool calling, agents and retrieval (RAG), and the production concerns of evaluation, cost and security. No programming background is needed for the Essentials.

How deep do you want to go?

1. EssentialsRead and write simple code, do the everyday basics8 lessons · 1 hour in total
2. PracticalUse it productively at work, with the usual idioms16 lessons · 3 hours in total
3. AdvancedThe less common features, performance and trade-offs21 lessons · 4 hours in total
4. ExpertInternals and the edge cases experts know24 lessons · 5 hours in total

The AI & LLM fundamentals tree

AI & LLM fundamentalsWhat a large language model isWhat a largelanguage model isTokensTokensPrompts, messages and rolesPrompts, messagesand rolesTemperature: why answers varyTemperature: whyanswers varyHallucinations and other limitsHallucinations andother limitsThe context windowThe context windowWriting clear promptsWriting clear promptsCalling a model through an APICalling a modelthrough an APISystem prompts and instructionsSystem prompts andinstructionsExamples in prompts (few-shot)Examples in prompts(few-shot)Reasoning and thinking modelsReasoning andthinking modelsStructured output (JSON)Structured output(JSON)Tool calling (function calling)Tool calling (functioncalling)What an AI agent isWhat an AI agent isEmbeddings and semantic similarityEmbeddings andsemantic similarityRetrieval-augmented generation (RAG)Retrieval-augmentedgeneration (RAG)
Essentials and Practical shown (16 of 24 lessons); the full list is below. Click a lesson to read it.

All 24 lessons, in order

How LLMs work

  1. What a large language model is · Essentials · 8 min

    A large language model is a program that writes text by predicting, piece by piece, what is most likely to come next.

  2. Tokens · Essentials · 7 min

    Models read and write text in small pieces called tokens; limits and prices are counted in tokens, not words.

  3. Temperature: why answers vary · Essentials · 7 min

    The model picks each next token with some randomness; temperature controls how adventurous that choice is.

  4. Hallucinations and other limits · Essentials · 9 min

    Models sometimes state false things confidently; learn why it happens, where it is likely, and how to check answers.

  5. The context window · Essentials · 8 min

    The context window is the maximum number of tokens a model can consider at once: instructions, conversation, documents and its own answer.

Prompting

  1. Prompts, messages and roles · Essentials · 9 min

    A chat with a model is a list of messages, each with a role: system (instructions), user (you) and assistant (the model).

  2. Writing clear prompts · Essentials · 12 min

    Write prompts like a brief for a smart new colleague: the goal, the context, the constraints and the format you want.

  3. System prompts and instructions · Practical · 10 min

    Use the system prompt for stable rules (role, audience, tone, boundaries) and keep per-request material in user messages.

  4. Examples in prompts (few-shot) · Practical · 9 min

    Show the model a few input-and-output examples of exactly what you want; it copies the pattern more reliably than it follows a description.

  5. Reasoning and thinking models · Practical · 11 min

    Some models 'think' before answering by writing hidden reasoning tokens first; this helps on hard problems and costs time and tokens.

Using models through APIs

  1. Calling a model through an API · Essentials · 12 min

    What an API, an API key, a request and a response are, and how apps and automation tools use them to talk to a model.

  2. Structured output (JSON) · Practical · 12 min

    Make the model reply in an exact JSON shape you define, so other programs and automation steps can use the answer reliably.

Tools and agents

  1. Tool calling (function calling) · Practical · 14 min

    Describe tools to a model; it replies with a request to run one with specific inputs, your code runs it, and you send back the result.

  2. What an AI agent is · Practical · 11 min

    An agent is a model running in a loop: it picks a tool, sees the result, and decides the next step until the goal is reached.

  3. Workflows vs agents: common patterns · Advanced · 14 min

    Choose between fixed workflows (you define the steps) and agents (the model defines them), and learn the standard patterns in between.

  4. Multi-agent systems · Advanced · 12 min

    Split work across several agents, usually a lead agent delegating to sub-agents with their own context, and know when that is worth it.

  5. Memory for agents · Advanced · 12 min

    Short-term memory is what is in the context window now; long-term memory is information saved outside it and loaded back when needed.

  6. Context engineering for long-running agents · Expert · 16 min

    Curate what enters the context window at every step: just-in-time retrieval, compaction, notes outside the context and sub-agents.

Retrieval

  1. Embeddings and semantic similarity · Practical · 11 min

    An embedding turns a piece of text into a list of numbers so that texts with similar meaning get similar numbers.

  2. Retrieval-augmented generation (RAG) · Practical · 14 min

    Before answering, find the most relevant passages from your own documents and put them in the prompt, so the model answers from them.

Production and safety

  1. Evaluating LLM output (evals) · Advanced · 15 min

    Build a set of test cases with a way to grade answers, so you can measure whether a prompt or model change really helped.

  2. Cost, latency and choosing a model · Advanced · 13 min

    Balance quality, speed and cost: pick model size and reasoning effort per task, keep prompts lean, and use caching and batching.

  3. Prompt injection and agent security · Expert · 16 min

    Text from outside (web pages, emails, documents, tool results) can carry instructions that hijack a model; design so that cannot do damage.

  4. Guardrails, permissions and human oversight · Expert · 15 min

    Layer checks around the model: input and output filters, scoped permissions, action approval, limits, and audit logs.