theNotebook

Topic

Retrieval and context

RAG, embeddings and context engineering. How a model finds the right facts before it answers.

9 daily entries · 4 concepts

Kitchen table

Before a helper answers, it looks things up. If it grabs the wrong page, the answer is wrong too. These pages are about looking things up well.

Whiteboard

Retrieval decides what the model sees. Chunking, embeddings, reranking and compression each drop something. These entries show what gets lost and where.

Boardroom

Most answers are only as good as the documents behind them. Retrieval quality sets the ceiling. These pages show where that ceiling sits.

Start with the concepts

  • Retrieval (RAG) Chunk the documents, embed them, retrieve by hybrid search (dense vectors plus keyword – dense alone misses part numbers and names), rerank, then…

  • Tokens & Embeddings Subword tokenisation sets your context budget and your bill – token counts, not word counts, are the unit of everything.

  • Prompting & Context Instructions, examples, retrieved documents, tool results and conversation history all compete for one finite context window, and the model attends…

  • Large Language Models Transformers and attention, pretrained on next-token prediction at a scale that turns a party trick into reasoning-shaped behaviour, then aligned…

From the daily page

Search the notebook