AI Fundamentals cheat sheet
125 commands from every lesson of AI Fundamentals — How Modern AI Works, on one page.
The terms
Artificial intelligence (AI) | Any technique that makes a computer do something we would call intelligent |
Machine learning (ML) | AI that learns patterns from examples instead of following hand-written rules |
Deep learning | Machine learning with large neural networks of many layers |
Generative AI | Models that create new content: text, images, audio, code |
Large language model (LLM) | A generative model trained on huge amounts of text to predict the next piece of text |
Foundation model | A large general-purpose model that many products are built on |
Model | A file of learned numbers (parameters) plus the program that uses them |
Training | Adjusting the parameters from examples; slow and expensive, done rarely |
Inference | Using a trained model to get an answer; done every time you ask |
Terms
Token | A piece of text the model reads and writes: a word, part of a word, or punctuation |
Tokenizer | Turns text into token numbers and back |
Next-token prediction | The model's only basic skill: given the text so far, score every possible next token |
Parameters (weights) | The learned numbers inside the model; billions of them |
Transformer | The neural-network design behind modern LLMs |
Attention | How the model weighs every earlier token when predicting the next one |
Pre-training | Learning to predict text from a huge general collection |
Fine-tuning / instruction tuning | Further training on examples of good instructions and answers |
RLHF | Reinforcement learning from human feedback: people rank answers, the model learns their preferences |
Reasoning model | A model trained to work through steps before giving its final answer |
Terms
Prompt | Everything sent to the model for one request |
System prompt | Instructions from the application, sent first: role, rules, tone, format |
Context window | The maximum number of tokens the model can consider at once (input plus output) |
Input / output tokens | Tokens sent to the model / tokens it writes; both are usually billed |
Temperature | How much randomness is used when choosing the next token |
Few-shot prompting | Including a few worked examples in the prompt |
Stateless | The model keeps nothing between requests; the app re-sends the history |
Prompting habits that work
Say who and why | Who the answer is for and what it will be used for |
Give the material | Paste the log, document or data instead of describing it |
Show the format | An example of the output you want |
Allow 'I don't know' | Tell it to say so when the material does not contain the answer |
Failure modes
Hallucination | Fluent, confident output that is false or invented |
Knowledge cut-off | The model knows nothing after its training data was collected |
Bias | Patterns in training data (including unfair ones) show up in answers |
Sycophancy | Tendency to agree with the user, even when the user is wrong |
Non-determinism | The same question can produce different answers |
What reduces them
Grounding (RAG) | Give the model the source documents and ask it to answer only from them |
Tools | Let it look things up or calculate instead of guessing |
Citations | Ask for the source of each claim so a person can check |
Verification | Tests, policy checks and human review before anything important |
Terms
Vector | An ordered list of numbers, e.g. [0.12, -0.53, 0.88, …] |
Embedding | A vector that represents the meaning of a text (or image, or audio) |
Dimensions | How many numbers in the vector; commonly a few hundred to a few thousand |
Embedding model | A model whose job is to turn text into embeddings (not to chat) |
Cosine similarity | A score for how closely two vectors point the same way; near 1 = similar meaning |
Semantic search | Finding text by meaning instead of by matching words |
Terms
Vector database | Stores vectors with their text and metadata, and finds the nearest ones to a query vector |
Nearest-neighbour search | Find the stored vectors closest to the query vector |
ANN (approximate nearest neighbour) | Very fast search that returns almost-always the true nearest results |
Index (e.g. HNSW) | The structure that makes ANN fast, like a map of shortcuts between points |
Top-k | How many nearest results to return, e.g. the best 5 |
Metadata filter | Restrict results by fields such as product, date, language, or who may see them |
Hybrid search | Semantic (vector) search combined with keyword search |
Common options
pgvector | Extension that adds vector search to PostgreSQL |
OpenSearch / Elasticsearch | Search engines with vector search alongside keyword search |
Qdrant, Weaviate, Milvus, Chroma | Purpose-built vector databases, self-hosted or managed |
Pinecone and cloud services | Fully managed vector search |
The pipeline
Ingest | Collect documents, clean them, split into chunks |
Embed and store | Turn each chunk into a vector; store with text and metadata |
Retrieve | Embed the question; find the nearest chunks (with permission filters) |
Augment | Put the chunks into the prompt with instructions |
Generate | The LLM answers from the chunks and cites them |
Quality levers
Chunk size and overlap | Small enough to be specific, large enough to keep context |
Hybrid search | Add keyword search for codes, names and exact terms |
Re-ranking | A second model re-orders retrieved chunks by relevance |
'Answer only from the sources' | Instruction that reduces made-up answers |
Evaluation set | Real questions with known answers, run after every change |
Terms
Tool / function | Something the application can do on the model's request: search, query, calculate, create a ticket |
Tool definition | Name, description and input fields the model is shown |
Tool call | The model's structured request: which tool, with which inputs |
Tool result | What the application sends back after running the tool |
Structured output | Asking the model to reply in an exact format such as JSON |
Permission levels
Read-only | Search, look up, list: usually safe to run automatically |
Reversible write | Create a draft, add a label: run with logging |
Irreversible or external | Send, pay, delete, deploy: ask a human first |
Terms
Agent | A model in a loop that chooses and uses tools until a goal is done |
Agent loop | Think → act (tool call) → observe (result) → repeat |
Planning | Breaking a goal into steps, and revising the plan as results arrive |
Short-term memory | The working context of the current task |
Long-term memory | Notes saved outside the model and loaded into later tasks |
Multi-agent | An orchestrator hands parts of the work to specialised sub-agents |
Human in the loop | A person approves risky steps or reviews the result |
Questions to ask about any agent
Goal | What exactly is 'done', and how is it checked? |
Tools | Which tools, with which permissions? |
Limits | Maximum steps, time and cost |
Approvals | Which actions need a person? |
Audit | Is every step logged? |
Parts
Host | The AI application the person uses: a chat app, an IDE, a coding agent |
MCP client | The part of the host that talks to one MCP server |
MCP server | A small program that exposes a system (tickets, database, cluster) through MCP |
Tools | Actions the server offers, e.g. search_tickets, create_issue |
Resources | Data the server offers for reading, e.g. a file or a record |
Prompts | Ready-made prompt templates the server offers |
Before connecting a server
Who wrote it? | Install only from sources you trust, pinned to a version |
What can it do? | List its tools; prefer read-only |
Whose credentials? | Scoped, least-privilege, ideally per user |
What needs approval? | Writes and anything outward-facing |
Terms
Hosted (API) model | Run by a provider; you send requests and pay per token |
Open-weight model | Parameters are published; you can run it on your own hardware |
Self-hosting tools | Ollama for laptops and small servers; vLLM and similar for production GPU serving |
Quantisation | Storing parameters with fewer bits so a model fits on smaller hardware, with a small quality loss |
Latency | Time to first token and tokens per second |
Fine-tuning | Further training a model on your examples to change its behaviour |
LoRA | A cheap way to fine-tune by training a small add-on instead of the whole model |
Questions for a provider
Training on our data? | Is it used for training, and can that be switched off? |
Retention | How long are prompts and outputs stored? |
Location | Which regions process and store the data? |
Compliance | Certifications and contracts you need |
Risks
Prompt injection | Input that makes the model ignore its instructions |
Indirect prompt injection | Instructions hidden in content the model reads: a web page, email, document, tool result |
Data leakage | Sensitive data in prompts, logs, answers or retrieved documents reaching the wrong people |
Excessive agency | A model with more tools or permissions than the task needs |
Over-reliance | People accepting output without checking |
Controls
Least privilege | Only the tools and data the task needs, with the user's own permissions |
Human approval | For irreversible or outward-facing actions |
Input and output filters | Detect secrets, personal data, unsafe content |
Evaluation set | Fixed questions with expected results, run on every change |
Red teaming | Deliberately trying to break it before attackers do |
Review checklist for any AI feature
Purpose | What job, for whom, and what does a good answer look like? |
Model | Which one, hosted or self-hosted, and why; where does data go? |
Knowledge | Which sources, how kept fresh, permission-filtered? |
Tools | Which ones, read or write, whose credentials? |
Approvals | Which actions need a person? |
Guard-rails | Injection, data leakage, output filters, limits |
Evaluation | Test set, scores, who reviews, how often |
Operations | Logs, cost, latency, feedback, incident plan |