One of the core problems in semantic search is doing efficient approximate nearest neighbor search. In this post the author uses KD trees. There are other alternatives for efficient ANN like scann from Google and faiss from Facebook.
You're actually comparing a data structure (KD trees) to a library (scann and faiss). HNSW is the data structure that is commonly used by vector search databases. If we're in the Rust world, Qdrant is a great example here.