Lion Cipher Lab

Embeddings and vector search from scratch (locally)

Why it matters

Almost every 'AI that understands my text' feature — semantic search, retrieval-augmented chatbots, duplicate detection, recommendation, clustering — rests on two ideas that sound like magic until you build them: an embedding turns a piece of text into a vector (a list of numbers) positioned so that similar meanings land near each other, and a vector database finds the stored vectors nearest to a query vector. Build both, small and local, and the whole category stops being mysterious: you can reason about why a search returned what it did, why it sometimes misses, and where your text is going…

What you'll learn

Steps in this lab

  1. What an embedding is, in one picture
  2. What a vector database does
  3. Set up: two libraries, both local
  4. Turn text into vectors and see similarity
  5. Store your text in a local vector database
  6. Run a similarity query
  7. Where this shows up in the real world
  8. What you now understand that most people don't

Open the full interactive lab →