Show HN: Find the relevant Xkcd comic for your post using RAG

1 anyg 2 8/5/2025, 3:29:30 PM anyg.me ↗
How it works - Simply paste your entire message or post into the search box to get the most relevant xkcd for it. No need to search by keywords, etc.

I built this tool as a fun project to learn Retrieval Augmented Generation (RAG) but it turned out to be much more complicated than expected. Humour, in particular xkcd comics, require high levels of intelligence and also relevant knowledge. RAG doesn't actually seem perfectly suitable for it because the retrieval is done using a much simpler model than the latest LLMs.

While playing around, I found it to be decent most of the time. Sometimes, it would suggest a comic which isn't perfectly suitable but has some overlap atleast. It took quite a few experiments to find the current combination of embedding model and llm as well as the retrieval algo and related params.

Comments (2)

anyg · 9m ago
Those who give it a try, I would really appreciate it if you upvote or downvote your result. I'm thinking of fine-tuning a small model as the next step to improve it. Would be interesting to have a GAN-like setup (?) where the fine-tuned model suggests comics and a large model uses its world knowledge to accept or reject
andenacitelli · 40m ago
Successfully tracked down the Hyrum's Law one, nice work

> downstream developers will learn to depend on every possible behavior your API accomplishes, even the unintended ones

https://xkcd.com/1172/