All AI resources

AIMates resources

AI Notes

One-page explainers of the core AI ideas: what it is, how it works step by step, and what to remember.

How LLMs work

A large language model reads text as tokens and predicts the most likely next token, again and again. Training on huge amounts of text gives it grammar, facts and patterns; extra training with human feedback makes it more helpful.

How it works

  1. 1Text is split into tokens
  2. 2Tokens become numbers (embeddings)
  3. 3Transformer layers use attention to weigh context
  4. 4The model scores every possible next token
  5. 5One token is picked, added, and the loop repeats

Remember

  • • It predicts likely text; it does not look facts up unless you give it tools or documents
  • • Temperature changes how adventurous the picks are
  • • Everything must fit in the context window
Play Be the LLM

Prompting that works

Good prompts read like a brief to a smart new colleague: who they are, what to do, what they need to know, and what the result should look like.

How it works

  1. 1Give a role and the audience
  2. 2State the task in one sentence
  3. 3Add the context and data
  4. 4Set constraints: length, tone, must-nots
  5. 5Specify the output format, with an example

Remember

  • • Clear beats clever
  • • Examples fix format problems fast
  • • Iterate: test on real inputs and adjust
Prompt Engineering for Real Work

Embeddings and semantic search

An embedding turns text into a list of numbers that captures its meaning. Texts with similar meaning get similar numbers, so you can search by meaning instead of exact words.

How it works

  1. 1Split documents into chunks
  2. 2Turn each chunk into an embedding
  3. 3Store them in a vector database
  4. 4Embed the user's question
  5. 5Return the closest chunks

Remember

  • • Use the same embedding model for documents and questions
  • • Chunk size affects quality: test it
  • • Combine with keyword search for names and codes
Vector databases

RAG in one page

Retrieval-augmented generation finds relevant passages from your documents first, then asks the model to answer using only those passages. It keeps answers current and checkable without retraining the model.

How it works

  1. 1User asks a question
  2. 2Retrieve the most relevant chunks
  3. 3Put them in the prompt with clear instructions
  4. 4The model answers and cites sources
  5. 5Log and evaluate the results

Remember

  • • Bad retrieval means bad answers: measure it
  • • Always show sources
  • • Tell the model to say "I don't know" when the context lacks the answer
RAG Explained for Beginners

AI agents

An agent is a model in a loop: it decides the next step, calls a tool, looks at the result, and continues until the goal is reached or it stops.

How it works

  1. 1Receive a goal
  2. 2Plan the next step
  3. 3Call a tool (search, database, email…)
  4. 4Read the tool result
  5. 5Repeat or finish and report

Remember

  • • Give each tool the smallest permissions
  • • Ask a human before risky actions
  • • Cap steps and cost, and log every call
Build Your First AI Agent

Evaluating AI systems

Evals are repeatable tests that show whether your AI feature is good enough and whether a change made it better or worse.

How it works

  1. 1Define what a good answer looks like
  2. 2Collect real test cases, including edge cases
  3. 3Score with rules, references or human review
  4. 4Run before every prompt or model change
  5. 5Sample live traffic regularly

Remember

  • • No evals means you are guessing
  • • Include attacks and tricky inputs
  • • Track results over time, not just once
AI Security Basics