<aside> 📅
Date: Thursday, October 1, 2026 · Week 1, Day 4 · Type: Build Day
</aside>
4.1 What an Embedding Is — mapping text sentences into high-dimensional geometric coordinate points.
4.2 Measuring Similarity — how computers determine if two sentences mean the same thing using Cosine Similarity.
4.3 Vector Normalization — what vector length (L2 norm) means and why normalized vectors make search faster.
Build a "Semantic Sentence Matcher" that accepts 5 user-provided sentences, calls an embedding model to vectorize them, computes a pairwise similarity matrix, and outputs the two most semantically similar sentences.
+--------------------+ +-------------------+ +---------------------+
| Text Sentence List | --> | Embedding API / ML| --> | High-Dim Vector List|
+--------------------+ +-------------------+ +---------------------+
|
v
[Cosine Similarity Matrix]
Problem 04. Implement a pure Python function cosine_similarity(vec_a: list[float], vec_b: list[float]) -> float that calculates the cosine similarity between two numerical lists without using NumPy or math libraries.
Algorithm: Dot Product & Vector Magnitude (L2 Norm).
Mechanics: Multiplying matching elements and dividing by the product of vector lengths: CosineSim(A,B) = (Σ AᵢBᵢ) / (√ΣAᵢ² · √ΣBᵢ²).
Real-World Production Use: The foundational mathematical calculation executed billions of times daily inside all vector databases (Pinecone, Qdrant, Milvus).