Life is the greatest university on this universe. Trying to learn from it till fees are paid. I take interest in philosophy, literature, technology, psychology and in nuances of human emotions. If you like it then we can be friends.

AI Concepts

AI is easier to understand as a stack of layers than as a list of buzzwords. Each layer builds on the ones beneath it: models are trained on data, language models turn that training into fluent text, retrieval and tools connect them to real knowledge, and evaluation and governance keep the whole thing trustworthy.

This page is the map. Every concept gets a plain-language definition, and wherever I have written an in-depth guide, the concept links straight to it. New guides will be added here as they are published.

The AI stack: seven layers from Foundations at the bottom to Quality and safety at the top07060504030201Quality & safetyAgents & toolsCustomising modelsKnowledge & retrievalWorking with modelsLanguage modelsFoundationsevals · guardrails · governancetool use · agents · MCPfine-tuning · LoRA · RLHFembeddings · RAG · GraphRAGprompting · reasoning · contexttokens · transformers · context windowAI · machine learning · deep learning↑ BUILD FROM THE BOTTOM UP · EACH LAYER RELIES ON THE ONES BENEATH IT

New to AI?

Start at the bottom of the stack with Foundations and Language models. Everything above depends on them.

Building something?

Jump to Knowledge & retrieval and Agents & tools, where most enterprise AI work happens today.

Taking it to production?

Read Quality & safety: evaluation, guardrails and governance decide whether a demo becomes a dependable system.


Deep dives

In-depth guides on individual concepts, written from basic to advanced.

Knowledge & retrieval · Basic to advanced

RAG: Retrieval-Augmented Generation

How to connect a language model to your own knowledge so it answers from evidence, cites its sources and says so when the evidence isn’t there. The guide starts from first principles and goes through chunking, embeddings, hybrid search, reranking and metadata filters, then on to agentic RAG, GraphRAG, evaluation, security and running it in production.

How RAG works: an indexing pipeline prepares documents into a shared index, and a question pipeline retrieves from it to generate a cited answerINDEXING · OFFLINE, AHEAD OF TIMEQUESTION · EVERY REQUESTsearch the indexDocumentsParse & chunkEmbedShared indexQuestionRetrieveAugmentGeneratepolicies, contracts,notes, ticketssplit, then attach source,version and accesstext becomes vectorsof meaningvector + keywordsearch“What is our appealdeadline?”filter, search,rerank top chunksrules + evidence+ questioncited answer, or“not enough evidence”The rule: the model is only as good as the evidence it is given.

Three ways in: read the guide, follow the interactive 60-minute workshop, or build a small RAG app yourself in the hands-on lab (runs in your browser, no sign-in).


The concept map

The seven layers of the stack, bottom to top. Where a concept is covered in depth, the last column links to the guide.

01 · Foundations

What AI is, and how machines learn from data rather than from hand-written rules.

ConceptIn plain words
Artificial intelligenceSystems that perform tasks that normally need human judgement: recognising, predicting, generating and deciding.
Machine learningLearning patterns from examples instead of following rules a programmer wrote by hand.
Deep learningMachine learning with many-layered neural networks. It powers modern vision, speech and language models.
Neural networkLayers of simple connected units. Training adjusts the strength (weight) of each connection until the outputs are useful.
Supervised, unsupervised, reinforcement learningLearning from labelled examples, from structure in unlabelled data, and from rewards for good actions.
Training vs inferenceTraining sets the model’s weights from data: expensive and occasional. Inference uses the finished model to answer: cheap and constant.

02 · Language models

The engine behind chat assistants: what a large language model is, and the limits that shape how you use it.

ConceptIn plain words
Large language model (LLM)A model trained on vast amounts of text to predict the next piece of text. Scale gives it broad language, knowledge and reasoning ability.
TokenThe unit a model reads and writes, roughly a word or part of a word. Limits and pricing are counted in tokens.
Transformer and attentionThe architecture behind modern LLMs (introduced in 2017). Attention lets every token weigh the relevance of every other token in the input.
Context windowThe maximum amount of text the model can consider at once: instructions, documents, conversation and its own answer.
TemperatureHow much randomness goes into word choice. Low for consistent, factual work; higher for variety and brainstorming.
Knowledge cutoffThe date after which the model’s training data stops. Anything later is unknown to it unless supplied.
HallucinationFluent, confident output that isn’t supported by facts or sources.
Multimodal modelA model that works with more than text: images, audio, documents or video, as input, output or both.

03 · Working with models

How to get reliable results from a model without changing the model itself.

ConceptIn plain words
Prompt engineeringWriting clear instructions with the right context, examples and output format. The fastest, cheapest lever you have.
System promptStanding instructions that set the model’s role, rules and tone for a whole conversation or application.
Zero-shot and few-shotAsking with no examples, versus including a few worked examples of the task in the prompt.
Chain of thought and reasoning modelsWorking step by step before answering. Reasoning models do this internally, trading speed for accuracy on hard problems.
Structured outputAsking for JSON or another fixed format so that software, not just people, can use the answer.
Context engineeringDeciding what goes into the context window, in what order: instructions, documents, history and tools.

04 · Knowledge & retrieval

Connecting models to knowledge they were never trained on: your documents, policies and data, kept current and permissioned.

ConceptIn plain wordsGo deeper
EmbeddingsNumbers that capture the meaning of text, so similar ideas sit close together even when the words differ.RAG guide §2
Vector databaseA store built to find the embeddings nearest to a query, quickly and at scale.RAG guide §2
Retrieval-Augmented Generation (RAG)Find relevant evidence first, then ask the model to answer from it, with citations.Full guide
Hybrid search and rerankingCombining meaning-based and keyword search, then re-ordering the shortlist for relevance.RAG guide §4
Knowledge graphs and GraphRAGStoring entities and their relationships, so questions that span documents can be answered by following the links.RAG guide §5
Long context vs retrievalPasting everything in works for a few known documents; retrieval is needed for large, changing or permissioned collections.RAG guide §1

05 · Customising models

Changing how a model behaves, rather than what it can see. A useful rule: customise for how it should answer, retrieve for what it should know.

ConceptIn plain words
Fine-tuningFurther training on your own examples to change style, format or skill at a specific task.
LoRA and parameter-efficient tuningTraining a small set of add-on weights instead of the whole model: far cheaper, and easy to swap in and out.
RLHF and preference tuningTraining on human (or AI) judgements of which answer is better, to make a model more helpful and safer.
DistillationTraining a smaller, faster model to imitate a larger one on the tasks you care about.
QuantisationStoring a model’s numbers at lower precision so it runs faster and cheaper, with a small loss in quality.
Open-weight vs hosted modelsDownloading and running a model yourself, versus calling a provider’s model through an API.

06 · Agents & tools

Models that act, not just answer: calling tools, working through multi-step tasks and checking their own progress.

The agent loop: plan, act, observe, reflect, around a goal and a model, repeating until the goal is metGoal + modelreasons at each stepPlanActObserveReflectbreak into stepscall a tool or searchread the resultdone, or try again?Tools: search · databases · APIs · code · MCP servers
ConceptIn plain wordsGo deeper
Tool use (function calling)The model asks, in a structured way, for a function or API to be run. The application runs it and hands back the result.
AI agentA model working in a loop of plan, act, observe and reflect until a goal is met or a human is needed.
Model Context Protocol (MCP)An open standard, introduced by Anthropic in 2024, for connecting AI applications to tools and data sources through one common interface.
Agentic RAGAn agent that plans its searches, routes them to the right sources and re-queries when evidence is missing.RAG guide §5
Multi-agent systemsSeveral specialised agents, such as a planner, a researcher and a reviewer, coordinating on one task.
Human in the loopApproval checkpoints before an agent takes consequential or irreversible actions.

07 · Quality & safety

What turns an impressive demo into a system people can depend on.

ConceptIn plain wordsGo deeper
Evaluations (evals)Repeatable tests of a system against a set of questions with known good answers, run whenever anything changes.RAG guide §6
LLM-as-judgeUsing a model to grade outputs at scale. Useful, but calibrate it against human reviewers.RAG guide §6
Grounding and citationsTying every claim to a source the reader can check, and allowing “I don’t have enough evidence”.RAG guide §2
GuardrailsChecks on what goes into and comes out of a model: content filters, policy rules, format validation.
Prompt injectionMalicious instructions hidden in content the model reads, such as a web page or document, that try to hijack its behaviour.RAG guide §7
ObservabilityTracing each request, with its inputs, sources, cost, latency and feedback, so failures can be reproduced and fixed.RAG guide §8
Responsible AI and governanceFairness, privacy, transparency and accountability, guided by frameworks such as the NIST AI Risk Management Framework and the EU AI Act.

One principle across every layer

Most AI failures are not model failures. They start in the data, the retrieval, the instructions or the missing checks around the model. Understanding the layers is what lets you find the real cause, instead of reaching for a bigger model.

Latest Notes

View Archive [ -> ]