Lion Cipher Lab
Embeddings and vector search from scratch (locally)
- AI Security
- Beginner
- ~45 min
- Free · no account required
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
- what an embedding is (text as a vector of meaning)
- what a vector database does (nearest-neighbour search)
- running a local embedding model with sentence-transformers
- storing and querying vectors in a local Chroma database
- recognising the use cases: semantic search, RAG, dedup, clustering
Steps in this lab
- What an embedding is, in one picture
- What a vector database does
- Set up: two libraries, both local
- Turn text into vectors and see similarity
- Store your text in a local vector database
- Run a similarity query
- Where this shows up in the real world
- What you now understand that most people don't