Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Retrieval and Knowledge Systems

Free · sign in to start and track progress

1 · Building the index

  • 1Embeddings in practice

    Exercise answers

    • Answer: Measure truncation and quantisation on legal text
    • Answer: Add a commercial embedder (stretch)
  • 2Chunking structured documents
  • 3Vector indexes and databases
  • 4Measuring retrieval

2 · Retrieval that reasons

  • 5Hybrid search and reranking
  • 6Agentic retrieval
  • 7Knowledge graphs and GraphRAG
  • 8Long context versus RAG
CapstoneA measured retrieval service for cases and reference documentsReference implementation

Module 1 · Building the index · Lesson 1

Embeddings in practice

How to choose an embedding model for specialist retrieval, and how dimensions, Matryoshka truncation and quantisation trade quality against memory, latency and cost.

70 min 1 video 3 exercises 7-question quiz Answers
Setup for the exercises:Python with uvGet an OpenRouter keyLocal models with Ollama

By the end of this lesson you can

  • Choose an embedding model for a specialist corpus using MTEB, a domain benchmark and your own queries, and explain why leaderboard rank alone misleads
  • Use query and document input types or prefixes correctly, and explain what breaks when you don't
  • Compute the storage and embedding cost of an index at different dimensions and precisions
  • Apply Matryoshka truncation and binary or int8 quantisation with rescoring, and predict the quality cost of each

On this page

  • What a retrieval embedding model is
  • Queries and documents are not the same kind of text
  • Choosing a model
  • Read MTEB, but read the right column
  • Check a domain benchmark
  • The current field
  • Dimensions and the memory bill
  • Matryoshka truncation
  • Quantisation
  • What embeddings can't do
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01What a retrieval embedding model is
  2. 02Choosing a model
  3. 03Dimensions and the memory bill
  4. 04Matryoshka truncation
  5. 05Quantisation
  6. 06What embeddings can't do
  7. 07Connections
  8. 08Summary

Sources & further reading

  • MTEB: Massive Text Embedding BenchmarkPaper · Muennighoff, Tazi, Magne, Reimers · 2023The benchmark behind the leaderboard everyone quotes. Section 3 explains the task types; it shows that no single model wins all of them, which is the main reason to read the retrieval column rather than the average.
  • The Massive Legal Embedding Benchmark (MLEB)Paper · Butler, Butler, Malec · 2025Ten expert-annotated legal retrieval datasets across six jurisdictions, including one UK dataset. Its results table shows general-purpose rank failing to predict legal rank. Read the results section and the model table.
  • Matryoshka Representation LearningPaper · Kusupati et al. · 2022The training trick that lets you cut an embedding short and keep most of its quality. Section 3 gives the nested loss in a few lines.
  • Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation ModelsPaper · Zhang et al. · Alibaba Qwen · 2025How a current open-weight family is built from an LLM backbone, with instruction-aware queries and flexible dimensions. Useful as the self-hosted option for client data.
  • MMTEB: Massive Multilingual Text Embedding BenchmarkPaper · Enevoldsen et al. · 2025The 2025 expansion of MTEB to hundreds of tasks and languages. Skim the introduction for why the original benchmark had saturated and leaked into training data.
  • Embedding QuantizationLab research · Shakir, Aarsen, Lee · Hugging Face · 2024The clearest measurements of int8 and binary quantisation with and without rescoring, plus a memory-cost table for 250M embeddings.
  • Voyage AI text embeddings documentationDocs · Voyage AIA representative commercial API. Read the input_type, output_dimension and output_dtype sections; most providers now expose the same three knobs.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 8 more sections
  • 3 hands-on exercises
  • A 7-question quiz
  • Progress, quiz scores and bookmarks