# 1536
---
# Actually... sorry... it was 3072
---
(this joke worked better before)
---
# We had a problem
---
[Cord.com baby!](https://cord.com/)
---

---

---

---

---
# So... use Elastic Search?!
---

---
# What about the new shiny thing?!
---

---
# Wait... how does it work?
---
# Show of hands
---

---

---

---
# It's far more than keyword search
---
# How many numbers?
---
# I lied. The year was not 1536.
---
1536, 3072
---
# Cosine Similarity
---

---
```typescript
function dot(a: number[], b: number[]) {
return a.map((x, i) => a[i] * b[i]).reduce((m, n) => m + n);
}
function norm(v: number[]) {
return Math.sqrt(dot(v, v));
}
export function cosineSimilarity(a: number[], b: number[]): number {
return dot(a, b) / (norm(a) * norm(b));
}
```
---
# To the terminal!
---
# Thank you! ❤️
**Questions?**
### >>> jack@cord.com
---
{"description":"Man crying","title":"Why Are Embeddings So Absurdly Useful","contributors":"[{\"id\":\"023103e3-69ca-4950-a1f0-0212c6dcb3a4\",\"add\":5627,\"del\":3289}]"}