Architecture blueprint
Design the retrieval pipeline: source document → semantic chunk → embedding model → vector index → query embedding → similarity search → reranking → cited result.
How AI represents meaning as numbers
Learning Objective
By the end of this lesson, you will be able to: Explain how text embeddings represent semantic meaning, describe cosine similarity, and identify three practical use cases for embeddings in your organisation.
dimensions in a typical text embedding vector
Engage
"How does a computer understand that 'king minus man plus woman equals queen'? The answer — embeddings — is one of the most powerful ideas in modern AI."
A visual, intuitive explanation of how text embeddings work — from the mathematics to the magic.
An embedding is a way of representing text (words, sentences, documents) as a list of numbers — a vector in high-dimensional space. Similar meanings end up close together in this space.
The famous example:
Vector('King') - Vector('Man') + Vector('Woman') ≈ Vector('Queen')
This works because the model has learned that the relationship between 'king' and 'man' is similar to the relationship between 'queen' and 'woman' — and encoded that relationship as a direction in vector space.
Why this matters: Embeddings allow computers to find semantically similar content — not just keyword matches. 'Car' and 'automobile' have different words but similar embeddings. This powers semantic search, recommendation systems, and RAG.
Cosine Similarity
The standard way to measure how similar two embeddings are. Cosine similarity measures the angle between two vectors: 1.0 = identical meaning, 0 = completely unrelated, -1 = opposite meanings. When you search a vector database, you're finding the documents whose embeddings have the highest cosine similarity to your query's embedding.
| Use Case | How Embeddings Help | Example |
|---|---|---|
| Semantic Search | Find documents by meaning, not just keywords | Search 'car problems' finds articles about 'vehicle maintenance' |
| Recommendation | Find similar items to what a user likes | Recommend similar products, articles, or courses |
| Clustering | Group similar documents automatically | Cluster customer feedback by topic without manual labelling |
| Deduplication | Find near-duplicate content | Identify similar support tickets to route to the same team |
| RAG Retrieval | Find relevant context for AI responses | Retrieve the most relevant policy documents for a query |
Identify embedding opportunities: List 3 search or matching problems in your organisation that currently rely on keyword matching. How would semantic search (embeddings) improve each one? What data would you need to embed?
Your notes are saved in your browser for this session.
What does it mean for two text embeddings to have a high cosine similarity?
Builder Engineering Studio
Architecture blueprint
Design the retrieval pipeline: source document → semantic chunk → embedding model → vector index → query embedding → similarity search → reranking → cited result.
Engineering trade-off
Smaller chunks improve retrieval precision but lose context; larger chunks preserve meaning but can dilute relevance. Test semantic chunks with 10–20% overlap against your real queries.
Quality gate
Create a golden set of 20–30 representative user questions. For each, define the expected source, acceptable answer, and relevance threshold before changing the model or index.
Evidence to measure
Measure Recall@k, precision of retrieved passages, latency, retrieval cost, zero-result rate, and the percentage of results users open or accept.
Build task
Write the data contract for one embedding collection: source owner, refresh frequency, metadata fields, chunking rule, retention period, and evaluation set.
External video references
Open in a new tab
Human-centred work design
Use this original practice tool to test whether an AI-enabled workflow supports real human judgment, rather than merely placing a person at the end of an automated process.
Self-check
0/5
Start by making the work and decision rights explicit
Match AI freedom to consequence. Low-consequence drafting may run quickly; high-consequence decisions need explicit human approval.
Make the objective, inputs, constraints, source material, and current system state easy to inspect before anyone approves an output.
Review should require informed judgment, a plausible override, and the authority to act—not a symbolic sign-off after the fact.
Specify what uncertainty, conflict, missing evidence, or risk looks like—and who receives the escalation with enough context to decide.
Protect deliberate practice in the work that people may one day need to verify, challenge, or perform without AI assistance.
Apply it to one workflow
Ready to move on?
Mark this lesson complete and continue to "Vector Databases & RAG".