A RAG Primer

TXLF 2026

Slides at ian.im/txlf26

Inspired by this morning's Ollama/RAG/Lima workshop

Ian Littman / @ian@phpc.social / @ian.im / @iansltx

What do RAGs (retrieval augmented genEration) do?

  • Feeding the right context into LLMs at the right time
  • Prompt injection, but in a good way

How do you pick the context?

  • Search for it
  • Compare a transform of the query with a transform of the material to search
  • The comparison: cosine similarity
  • The transformation: embedding models
  • Can use a specialized model (reranker) to pick results differently

The WOrkflow

​Setup

  1. Chunk your corpus
  2. Run the chunks through an embedding model
  3. Save the chunks to a vector store

 

Usage

  1. Run the prompt through an embedding model
  2. Search via embeds in the vector store
  3. Inject top results into the prompt before passing to the LLM

FAQ

  • Can't you just use semantic search on its own without an LLM?
    Yes.
  • Can't you just throw everything in the context window?
    Maybe. Depends on how big "everything" is.
  • Can you do all this on The Cloud?
    Yes.
  • Can you do all this locally?
    Yes.

The Long Version

A RAG Primer - TXLF 2026

By Ian Littman

A RAG Primer - TXLF 2026

  • 8