Build garageTry it → read → next · ~10 min

Tutorials · Chapter D (4/4) · ~10 min

Embedding API lab

Try it → see it → read → next

Call an **embeddings endpoint**, compare vectors, and see why RAG retrieval picks certain chunks.

On paths: Builder · Student

Try yourself

Playground

Embedding similarity lab

Same meaning → vectors close together. Pick the highest cosine match to the query.

Query embedding compared to candidate chunks (scores simulated):

Teach

How it works

  1. Embed query and all chunks with the same model
  2. Cosine similarity (or dot product on normalized vectors)
  3. Take top-k → pack into prompt

Read

Try it

Run the embeddings API on three policy sentences + one off-topic line. Print similarity scores.