On the topic of search engines, I really liked classes by David Evans. The task was also building a simple search engine from scratch. It's really for beginners, as the emphasis is on coding in general, but I've found it to be very approachable.
I always wonder if the days of search engines for specific topics could return. With LLM's providing less than accurate results in some areas, and Google, bing, etc being taken over by adverts or well organised SEO, there feels like a place for accurate, specialised search.
wolfgang42 · 1h ago
Yeah, the (relative) rise of Kagi and Marginalia show that from a technical perspective, this is within the grasp of a dedicated hobbyist.[1] If Google continues their current trajectory, and overwhelming numbers of AI crawlers don’t cause an unsurmountable rise in CAPTCHA pages, I hope to see an upsurgence of niche search engines that focus on some specialty small enough that one or a few people can curate the content and produce a much better experience than the current crop of general Web search engines.
Self-plug: I run such a search engine (for programmers) in my living room, at <https://search.feep.dev/>. I don’t spend a ton of time maintaining it, so I’m interested to see what someone really dedicated could do.
The curation of an index of resources is what's needed for niche search
cosmicgadget · 2h ago
My hope is that content self-indexes so instead curation it just has to be aggregated.
dcist · 4h ago
WestLaw and Lexis Nexis provide this for legal search, but quite frankly, these services are subpar. It's amazing that these two companies rake in hundreds of millions but they are both slower than Google, Bing, Yandex, or any LLM service (ChatGPT, Claude, Gemini, etc.) while scouring a universe of text that is orders of magnitude smaller. The user experience is also terrible (you have to login and specify a client each and every time you attempt to use the service and both services log you out after a short -- in my opinion -- period of inactivity, creating friction and needless annoyance to the user). There's an opportunity there.
ahi · 4h ago
LN and Westlaw's real service is their ubiquity. Every law student has access to it and every firm expects proficiency. While they generally suck, the last time I used it (looong time ago), their boolean search was quite nice. That kind of text search has mostly been replaced by non-deterministic black boxes which aren't great for legal research.
throwup238 · 1h ago
They've also got the Microsoft effect going on. Usually at least one of their products like their personal information aggregator used for locating people (like when serving lawsuits) is mandatory for a firm so it's just easier for them bundle everything else in.
piker · 3h ago
You forgot to mention their claim of copyright over the bulk of, e.g. obscure state case law.
ehecatl42 · 1h ago
So, you have to pay to access the law that you are subject to?
piker · 46m ago
If you want it digitized, yes, odd as that seems. You can go find individual prints of it or perhaps digital copies of opinions elsewhere, but those are also technically copyrighted in a lot of cases too.
ktallett · 4h ago
I haven't personally used the mentioned services as they aren't in my field, however what is the accuracy of their results? Are they double checked? I don't find LLMs particularly accurate in my field (that's being kind), if anything I find they make up sources that simply don't exist.
I mean poor UX has no excuse but slow speed can be reasoned if it makes the quality of the service better.
It's scalable if you are okay with not searching exhaustively.
fanwood · 4h ago
I already directly search on Wikipedia for most topics (with a search shortcut on URL bar)
ktallett · 4h ago
Wikipedia is useful up to a point for sure. I feel whether it could be a expansion of Wikipedia in it's current use case, but for emerging research and niche topics it can sometimes be less useful.
snowstormsun · 3h ago
Nice idea, but this approach
does not handle out of vocabulary words well which is one major motivation for using a vector-based search. It might not perform significantly better compared to lexical matching like tf-idf or BM25, and being slower because of linear complexity. But cool regardless.
cosmicgadget · 18m ago
Or since OP has both the cosine similarity matching and naive matching, a heuristic combination of the two since they address each other's weaknesses.
netdevphoenix · 3h ago
It is supposed to be a simple search engine. Keyword: simple.
As long as it does what it is meant to, as a simple search engine, it seems fine
snowstormsun · 2h ago
Using tfidf or bm25 would actually be simpler than a vector search.
I understand this is just for fun, just wanted to point that out.
haasisnoah · 2h ago
How would you handle those in wordvec?
And isn’t a big advantage that synonyms are handled correctly. This implementation still has that advantage.
kaycebasques · 1h ago
> The idea behind the search engine is to embed each of my posts into this domain by adding up the embeddings for the words in the post.
Ah, OK! I never really grokked how to use word-level embeddings. Makes more sense now.
skarz · 50m ago
Is 'grokked' a common verb now? I had never even heard the word until Musk's AI.
kaycebasques · 41m ago
A common verb "now"??
> Grok (/ˈɡrɒk/) is a neologism coined by the American writer Robert A. Heinlein for his 1961 science fiction novel Stranger in a Strange Land. While the Oxford English Dictionary summarizes the meaning of grok as "to understand intuitively or by empathy, to establish rapport with" and "to empathize or communicate sympathetically (with); also, to experience enjoyment",[1] Heinlein's concept is far more nuanced, with critic Istvan Csicsery-Ronay Jr. observing that "the book's major theme can be seen as an extended definition of the term."[2] The concept of grok garnered significant critical scrutiny in the years after the book's initial publication. The term and aspects of the underlying concept have become part of communities such as computer science.
I do not think "hacked" is a good comparison, does not "to grok [smth]" mean "to understand [smth]"?
kevinsync · 39m ago
I never knew the etymology[0] but always knew the word for as long as I've been into computing (90's) .. apparently it's from the 1960's from a Heinlein novel!
It was a word before, as far as I remember. Saw it a few times here.
skarz · 41m ago
What does it even mean?
russfink · 22m ago
To understand and comprehend something in fullness. To reach the depths of the concept, idea, or entity so deep that you are practically one with it. (This is per my recollection of the Heinlein story, where grokking one in fullness was the highest form of respect.)
swyx · 2h ago
this embeds words with word2vec, which is like 10 years old. at least use BERT or sentencetransformers :)
gthompson512 · 6m ago
I have been thinking a bit lately about how much sense that makes compared to just using word vectors, since traditional queries are super short and often keyword based(like searching for "ground beef" when wanting "ground beef recipes I can cook easily tonight") and so lack most of the context that BERT or similar gives you. I know there are methods like using seperate embeddings for queries and such, but maybe a basic word based search could be more useful, especially with something like fastText for out of vocabulary terms.
cosmicgadget · 3h ago
This was a really nice read. Now I have no excuse not to upgrade my blog search. I do feel that I'll have a ton of long tail words like 'prank'.
sp0rk · 4h ago
The SVG equation is very difficult to read if you're using a dark OS theme because the blog uses the OS preference for dark/light theme (and doesn't seem to give an option to change it manually, either.)
https://www.cs.virginia.edu/~evans/courses/
https://www.cs.virginia.edu/~evans/courses/cs101/
[1] https://ciir.cs.umass.edu/irbook/
Self-plug: I run such a search engine (for programmers) in my living room, at <https://search.feep.dev/>. I don’t spend a ton of time maintaining it, so I’m interested to see what someone really dedicated could do.
[1] I wrote a 2004-vs-2014 comparison, and things have only gotten better since then: https://search.feep.dev/blog/post/2022-07-23-write-your-own
I mean poor UX has no excuse but slow speed can be reasoned if it makes the quality of the service better.
https://www.youtube.com/watch?v=9vCMFIJRiKk
As long as it does what it is meant to, as a simple search engine, it seems fine
I understand this is just for fun, just wanted to point that out.
And isn’t a big advantage that synonyms are handled correctly. This implementation still has that advantage.
Ah, OK! I never really grokked how to use word-level embeddings. Makes more sense now.
> Grok (/ˈɡrɒk/) is a neologism coined by the American writer Robert A. Heinlein for his 1961 science fiction novel Stranger in a Strange Land. While the Oxford English Dictionary summarizes the meaning of grok as "to understand intuitively or by empathy, to establish rapport with" and "to empathize or communicate sympathetically (with); also, to experience enjoyment",[1] Heinlein's concept is far more nuanced, with critic Istvan Csicsery-Ronay Jr. observing that "the book's major theme can be seen as an extended definition of the term."[2] The concept of grok garnered significant critical scrutiny in the years after the book's initial publication. The term and aspects of the underlying concept have become part of communities such as computer science.
https://en.wikipedia.org/wiki/Grok
Usage of 'grokked' on HN: 1,147[1]
Usage of 'hacked' on HN: 37,272[2]
[0] https://trends.google.com/trends/explore?date=all&geo=US&q=g...
[1] https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
[2] https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
[0] - https://en.wikipedia.org/wiki/Grok