AI engineering concepts, explained simply
AI engineering is the work of building reliable software on top of large language models: choosing a model, giving it the right context, connecting it to tools and data, and measuring whether it actually works. These pages explain each core concept in plain English, in the order you would learn them.
Getting started
What the job is and the order to learn it in.
- AI Engineer RoadmapThe fastest route to AI engineering for a working developer is: understand how LLMs work, learn prompting and context design, connect models to tools, add retrieval, build agents, then learn to evaluate and run them in production. You do not need to train models or study advanced maths first.4 min read
- AI Engineer vs ML EngineerA machine learning engineer builds, trains and deploys models from data. An AI engineer builds applications on top of existing foundation models, working mostly on prompts, context, retrieval, tools, agents and evaluation. The roles overlap, but they start from opposite ends of the model.3 min read
How LLMs work
The mechanics every other topic builds on: tokens, attention, training and why models get things wrong.
- Large Language Model (LLM)A large language model (LLM) is a neural network trained on a very large amount of text to predict the next token in a sequence. By repeating that prediction one token at a time, it can answer questions, write code, summarise documents and follow instructions. GPT, Claude, Gemini and Llama are all LLMs.3 min read
- Tokens and TokenizationA token is the unit of text a language model reads and writes. It is often a whole common word, a piece of a longer word, a punctuation mark or a space. In English, one token averages about four characters, or roughly three quarters of a word, and API usage is priced and limited by token count.4 min read
- EmbeddingsAn embedding is a list of numbers, a vector, that represents the meaning of a piece of text, an image or other data. Texts with similar meanings get vectors that are close together, which lets software search by meaning, group similar items and find the right documents for retrieval-augmented generation.3 min read
- Transformer and AttentionA transformer is the neural network architecture behind modern large language models. Its key idea, self-attention, lets every token in the input look at every other token and decide which ones matter for understanding it. Introduced by Google researchers in 2017, it replaced older sequential designs because it trains efficiently in parallel.3 min read
- Context WindowA context window is the maximum amount of text, measured in tokens, that a large language model can take into account at one time. Everything counts against it: the system prompt, the conversation so far, any pasted documents or tool results, and the answer the model is writing.5 min read
- Temperature and SamplingTemperature is a setting that controls how much randomness a language model uses when choosing each next token. A low temperature makes it pick the most likely tokens, giving focused and repeatable answers. A higher temperature spreads the choice across less likely tokens, giving more varied and creative, but less predictable, output.3 min read
- AI HallucinationAn AI hallucination is output from a language model that sounds confident and fluent but is false, unsupported or made up, such as an invented citation, a wrong date or a function that does not exist. It happens because models are trained to produce likely text, and a plausible falsehood can be very likely.3 min read
- Fine-TuningFine-tuning is continuing to train a pretrained language model on a smaller set of your own examples so it behaves differently: following a format, adopting a style or getting better at a narrow task. It changes the model's weights, unlike prompting or retrieval, which only change what the model sees.3 min read
- RLHFRLHF, reinforcement learning from human feedback, is a training method that makes a language model behave the way people prefer. Humans compare pairs of model answers, a reward model learns to predict their preferences, and the language model is then trained to produce answers that score highly. It is a big part of why chat assistants are helpful rather than just fluent.3 min read
- Reasoning ModelsA reasoning model is a large language model trained to spend extra computation thinking through a problem, usually as a long chain of intermediate reasoning, before giving its final answer. OpenAI's o1, DeepSeek-R1 and models with extended thinking modes from Anthropic and Google are examples. They do much better on maths, coding and multi-step problems, at the cost of more time and tokens.3 min read
- Scaling LawsScaling laws are empirical findings that a language model's performance improves smoothly and predictably as you increase its size, its training data and the compute used to train it. They let labs forecast how good a model will be before training it, and they explain why AI models have grown so quickly.3 min read
Prompting and context
Getting the output you want by controlling what the model sees.
- Prompt EngineeringPrompt engineering is the practice of writing and refining the instructions, context and examples you give a language model so that it reliably produces the output you need. For engineers it is closer to writing a specification than to finding magic words: be clear about the task, supply the right information, show the format, and test the result.4 min read
- System PromptA system prompt is a set of instructions given to a language model separately from the user's messages, usually at the start of every request. It sets the model's role, the rules it should follow, the tone and the output format for the whole conversation. Chat apps and AI products use system prompts to turn a general model into a specific assistant.3 min read
- Few-Shot PromptingFew-shot prompting means including a small number of worked examples, pairs of inputs and the outputs you want, inside the prompt before the real input. The model picks up the pattern from the examples and applies it, which is often the fastest way to get a consistent format, tone or labelling scheme without any training.3 min read
- Chain-of-Thought PromptingChain-of-thought (CoT) prompting asks a language model to write out its intermediate reasoning steps before giving a final answer. Because each generated step becomes context for the next, the model can break a hard problem into easier pieces, which improves accuracy on maths, logic and multi-step questions.3 min read
- Structured OutputStructured output means getting a language model to return data in an exact, machine-readable format, usually JSON that matches a schema you define, instead of free text. It is how LLM output becomes usable by code: extracting fields from documents, classifying records or producing arguments for another system.3 min read
- Context EngineeringContext engineering is the practice of deciding exactly what information goes into a language model's context window at each step: the instructions, conversation history, retrieved documents, tool definitions, tool results and saved memory. It extends prompt engineering from writing one good prompt to managing a limited, changing working memory across long tasks and agents.3 min read
- Prompt CachingPrompt caching lets a model provider reuse the work of processing the beginning of a prompt when later requests start with exactly the same content. Repeated system prompts, tool definitions, documents and conversation history are then billed at a steep discount and processed faster. It works on prefixes, so the order of your prompt matters.3 min read
Tools, MCP and agents
Letting a model call functions, reach real systems and work in loops.
- Tool Calling (Function Calling)Tool calling, also called function calling, lets a language model request that your application run a specific function, such as searching the web, querying a database or sending an email, with arguments the model chooses. Your code runs the function and returns the result, and the model uses it to continue. The model never runs anything itself.3 min read
- Model Context Protocol (MCP)The Model Context Protocol (MCP) is an open standard for connecting AI applications to external tools, data and services. An MCP server exposes capabilities such as tools, resources and prompts in a standard way, and any MCP-compatible application, such as Claude, ChatGPT, Cursor or VS Code, can connect to it without custom integration code.3 min read
- MCP ServerAn MCP server is a program that exposes capabilities, mainly tools, resources and prompts, to AI applications using the Model Context Protocol. It usually wraps something that already exists, such as a database, a SaaS API or your file system, so that any MCP-compatible assistant or agent can use it without custom integration code.4 min read
- AI AgentsAn AI agent is a system in which a language model directs its own work in a loop: it decides on an action, usually a tool call, observes the result, and chooses the next step, until the task is complete or it needs help. Coding assistants that edit and test code, and research tools that search and read many sources, are common examples.3 min read
- Agent SkillsAgent Skills are packaged sets of instructions, scripts and reference files that an AI agent can discover and load when a task calls for them. Each skill is a folder with a SKILL.md file whose name and description tell the agent when to use it. Introduced by Anthropic for Claude in 2025 and published as an open standard, skills are now supported by many agent tools.3 min read
- Subagents and Multi-Agent SystemsA subagent is a separate instance of an AI agent, with its own context window, instructions and tools, that a main agent hands a self-contained task to. The subagent does the work, then returns a short result, keeping the main agent's context clean. Systems built from a lead agent and several subagents are called multi-agent systems.3 min read
Retrieval and RAG
Giving a model the right documents at answer time.
- Retrieval-Augmented Generation (RAG)Retrieval-augmented generation (RAG) is a technique where an application first searches a collection of documents for passages relevant to a question, then gives those passages to a language model along with the question, so the model answers from that material. It lets a model use private, recent or specialised information it was never trained on, and cite its sources.3 min read
- Vector DatabaseA vector database stores embeddings, lists of numbers that represent meaning, and quickly finds the stored vectors most similar to a query vector. It is the search engine behind semantic search and most RAG systems. Examples include Pinecone, Weaviate, Qdrant and Milvus, and many general databases such as Postgres with pgvector now offer vector search too.3 min read
- Chunking for RAGChunking is splitting documents into smaller passages before embedding and indexing them for retrieval. Each chunk should be small enough to be specific and cheap to include in a prompt, yet complete enough to make sense on its own. How you chunk often matters more to RAG quality than which model or vector database you use.3 min read
- Hybrid Search and RerankingHybrid search runs keyword search, usually BM25, and vector (semantic) search together and merges the results, so a system finds both exact matches like product codes and passages that match by meaning. Reranking then takes the top candidates and reorders them with a slower but more accurate model. Together they are the standard way to improve retrieval quality in RAG.3 min read
Evaluation and production
Measuring quality, keeping systems safe, and paying less for them.
- LLM EvalsLLM evals are repeatable tests that measure how well a language model application performs on the tasks it is meant to do. An eval runs a set of realistic inputs through the system, scores each output with code, a model-based judge or a human, and reports a result you can compare across changes to prompts, models and retrieval.3 min read
- LLM-as-a-JudgeLLM-as-a-judge is an evaluation method in which a language model scores or compares another model's outputs, following a rubric you write. It makes it possible to evaluate open-ended outputs, such as summaries, answers and conversations, at a scale human review cannot match, provided the judge is checked against human judgement.3 min read
- LLM GuardrailsLLM guardrails are checks placed around a language model that inspect what goes in and what comes out, and block, fix or flag anything that breaks your rules. They catch unsafe or off-topic requests, leaks of personal data, unsupported claims and malformed output. Unlike instructions in a prompt, guardrails are enforced by code or separate models, so the main model cannot talk its way past them.3 min read
- Prompt InjectionPrompt injection is an attack in which text supplied to a language model, either by a user or hidden inside content the model reads such as a web page, email or document, contains instructions that override the developer's intended behaviour. It is the top risk in the OWASP Top 10 for LLM applications and is especially dangerous for agents with tools.3 min read
- LLM Cost and LatencyLLM cost is driven mainly by the number of input and output tokens and the price of the model, and latency mainly by model size and how many output tokens it generates. The biggest savings usually come from sending fewer tokens, caching repeated prompt prefixes, routing easy requests to smaller models, batching work that is not urgent, and streaming responses.3 min read
How are these topics organised?
The groups above follow the order most engineers learn this material in. Start with how language models work, because almost every practical problem later on (a hallucinated answer, a prompt that ignores an instruction, a slow and expensive agent) traces back to tokens, attention or the context window. Then move to prompting and context, then tools and agents, then retrieval, and finish with evaluation and production concerns.
Each page answers one question in its first paragraph, then goes further: how the idea works, where it breaks, and what to do about it. Where one of the free solidcoder guides covers a topic in depth, the page links to the exact chapter.
Frequently asked questions
What is AI engineering?
AI engineering is building software products on top of foundation models such as large language models. It covers prompting, context and retrieval design, tool integration, agents, evaluation, cost and safety, rather than training new models from scratch.
What does an AI engineer do day to day?
An AI engineer designs prompts and context, connects models to data and tools through APIs or MCP, builds evaluation sets to measure quality, and tunes systems for cost, speed and reliability. Most of the job is software engineering with a model as one component.
Do I need a machine learning background to become an AI engineer?
No. Most AI engineering work uses models through an API, so strong programming skills matter more than maths. Understanding how models work at a conceptual level, such as tokens, attention and sampling, makes debugging much easier.
Where should a beginner start?
Start with what a large language model is, then tokens and the context window, then prompt engineering. Those three ideas explain most of the surprising behaviour beginners run into, and every later topic assumes them.
Are these explainers free?
Yes. Every topic page and every chapter of the related guides is free to read, with no account or sign-up.