All projects
In buildWebAI
Hali
Venue discovery and experience platform with personalized taste matching.
Problem
Finding a venue that actually fits your taste — not just what's popular — is hard, and existing apps don't learn what you like.
What I built
A venue discovery and experience platform built around "Taste DNA" personalization and live venue intelligence ("Hali Pulse"). I wrote a full 21-section product requirements document and am building the Nairobi alpha.
Stack
Next.jsAI personalization
The kind of code behind it
1from dataclasses import dataclass
2from math import sqrt
3
4@dataclass
5class Candidate:
6 id: str
7 text: str
8 vector: list[float]
9
10
11def tokenize(text: str) -> list[str]:
12 return [t.lower() for t in text.split() if t.isalpha()]
13
14
15def embed(tokens: list[str], vocab: dict[str, int]) -> list[float]:
16 vector = [0.0] * len(vocab)
17 for token in tokens:
18 if token in vocab:
19 vector[vocab[token]] += 1.0
20 return vector
21
22
23def cosine_similarity(a: list[float], b: list[float]) -> float:
24 dot = sum(x * y for x, y in zip(a, b))
25 norm_a = sqrt(sum(x * x for x in a))
26 norm_b = sqrt(sum(y * y for y in b))
27 if norm_a == 0 or norm_b == 0:
28 return 0.0
29 return dot / (norm_a * norm_b)
30
31
32def rank(query: str, candidates: list[Candidate], vocab: dict[str, int]) -> list[Candidate]:
33 query_vector = embed(tokenize(query), vocab)
34 scored = [
35 (cosine_similarity(query_vector, c.vector), c)
36 for c in candidates
37 ]
38 scored.sort(key=lambda pair: pair[0], reverse=True)
39 return [candidate for _, candidate in scored]