Re:Show HN: Hacker Search – A semantic search engine for Hac...
by jnnnthnn on Thursday May 02, 2024 @02:46PM
(#40239976)
Fun! Thanks for sharing! It's super fast and the bias toward smaller websites really does surface interesting things. Very reminiscent of the Kagi small web site, also!
Re:Show HN: Hacker Search – A semantic search engine for Hac...
by jasonjmcghee on Sunday May 05, 2024 @10:24AM
(#40265131)
I would strongly consider incorporating a hybrid search strategy (keyword or bm25 etc) as currently a number of searches I tried resulted in rather surprising results
I built mine on top of an RSS feed I generate from Hacker News which filters out any posts linking to the top 1 million domains [1] and creates a readable version of the content. I use it to surface articles on smaller blogs/personal websites—it's become my main content source. It's generated via Github Actions every 4 hours and stored in a detached branch on Github (~2 GB of data from the past 4 years). Here's an example for posts with >= 10 upvotes [2].
It only took several hours to build the semantic search on top. And that included time for me to try out and learn several different vector DBs, embedding models, data pipelines, and UI frameworks! The current state of AI tooling is wonderfully simple.
In the end I landed on (selected in haste optimizing for developer ergonomics, so only a partial endorsement):
I generated the index locally on my M2 Mac which ripped through the ~70k articles in ~12 hours to generate all the embeddings.I run the search site with Podman on a VM from Hetzner—along with other projects—for ~$8 / month. All requests are handled on CPU w/o calls to external AI providers. Query times are <200 ms, which includes embedding generation → vector DB lookup → metadata retrieval → page rendering. The server source code is here [3].
Nice work @jnnnthnn! What you built is fast, the rankings were solid, and the summaries are convenient.
[1] https://majestic.com/reports/majestic-million
[2] https://github.com/awendland/hacker-news-small-sites/blob/ge...
[3] https://github.com/awendland/hacker-news-small-sites-website...