Live data from Hacker News

Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

tzx.notion.site

31–40 of 53 posts

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#31
post #6
post #2

Author here. Over the last few months, I have built and launched a free semantic search tool for GitHub called SemHub ( https://semhub.dev/ ). In this blog post, I share what I’ve learned and why I’ve failed, so that other builders can learn from my experience. This blog post runs long and I have sign-posted each section. I have marked the sections that I consider the particularly insightful with an asterisk (*). I h…

Thanks for writing this up! > Filtering with vector search may be harder than you expect. I've only ever used it for a small proof of concept, but Qdrant is great at categorical filtering with HNSW. https://qdrant.tech/articles/filtrable-hnsw/

Thanks for sharing! Do you have more details to share, e.g. did you just have a vector db, or did you have a main db as well?

In my research, Qdrant was also the top contender and I even created an account with them, but the need to sync two dbs put me off

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#32

I started a quick weekend project to do just that today: index my OSS project's [1] issues & discussions, so I can RAG-ask it to find references when I feel like I'm repeating myself (in "see issue/PR/discussion #123", finding the 123 is the hardest part). This article might be super helpful, thanks! I don't intend to make a product out of it though, so I can cut a lot of corners, like using a PAT for auth and runnin…

After this failed experience with SemHub, I am actually thinking of building something like this, for open source maintainers like you are definitely the ICP! (nuqs seems really cool btw, storing state in the URL param is definitely the way to go)

To elaborate, I was thinking of:

- running a cron that checks repos every X minutes

- for every new issue someone has opened, I will run an agent that (1) checks e.g. SemHub to look for similar issues; (2) checks the project's Discord server or Slack channel to see if anyone has raised something similar; (3) run a general search

- use LLMs to compose a helpful reply pointing the OP to that other issue/Discord discussion etc.

From other OSS maintainers, I've heard that being able to reliably identify duplicates would be a huge plus. Does this sound like something you'd be interested to try? Let me know how I can reach you if/when I have built something like this!

I am personally quite annoyed by all the AI slop being created on social media and even GitHub PRs and would love to use the same technology to do something pro-social.

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#33

Earlier quoted context omitted.

We’ve tried, but it’s hard to imagine any real production system using Cloudflare Workers..

I've done it, but: enterprise support helps a lot, multiple extremely annoying tickets were required, I did find multiple issues - some fixed, some worked around. And overall, the fewer people use CF (or another provider of their size) the better.

> And overall, the fewer people use CF (or another provider of their size) the better.

I understand your sentiment, but I vehemently disagree.

The cloud provider space has rapidly become an oligopoly and CloudFlare is one of the few new entrants that (1) has sufficient scale to compete with the incumbents; (2) has new ideas that the incumbents cannot easily match (region earth, durable objects etc.).

For most production workloads, I would not even consider the newer cloud providers, but I sincerely meant it when I said I hope Cloudflare will succeed. They've also been very responsive to the feedback raised in the blogpost when I DM-ed them.

(On a side note re: difficulty for newcomers in this market, I used to be part of a team that would run e.g. staging and testing environments on a new serverless db provider, but would run prod on AWS Aurora. In retrospect, this did not make much sense either as you want your environments to be as similar as possible, which means new cloud providers have an even tougher time getting started.)

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#34
post #7
post #2

Author here. Over the last few months, I have built and launched a free semantic search tool for GitHub called SemHub ( https://semhub.dev/ ). In this blog post, I share what I’ve learned and why I’ve failed, so that other builders can learn from my experience. This blog post runs long and I have sign-posted each section. I have marked the sections that I consider the particularly insightful with an asterisk (*). I h…

Fantastic writeup — thank you for taking the time to do this!

I'm glad you found it helpful :)

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#35
post #23

It's somewhat ironic that the author advocates for keeping it simple and using pgvector but then buries a ton of complexity with an API server, auth server, Cloudflare workers, and durable objects. Especially given > Supabase easily the most expensive part of my stack (at $200/month, if we ran in it XL, i.e. the lowest tier with 4-core CPU) That could get you a pretty decent VPS and allow you to coassemble everything…

Totally fair point. Thanks for taking the time to read through it! I guess I didn't want to use a VPS and then have to switch to something else if the product really worked, but I guess that rhymes with premature optimization. Some other clarifications: - I was also surprised with how expensive Supabase turned out to be and only got there because I was trying to sync very big repos ahead of time. I could see an alter…

I am using a vps and it is dead simple and cheap. If my projects actually gained traction , switching from vps to a more scalable infra is not a big challenge. The biggest challenge is to find PMV as fast and as efficient as possible.

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#36
> * No way to search across multiple repos within GitHub. > * No way to easily see open and closed issues in the same view.

I don't quite understand, because searching issues across all of Github and also within orgs is already supported. Those searches show both open and closed issues by default.

For searches on a single repo, just removing the "state" filter entirely from the query also shows open and closed issues.

I do think that semantic search on issues is a cool idea and the semantic/fuzzy aspect is probably the biggest motivator for the project. It just felt funny to see stuff that Github can actually already do listed at the top of motivating issues.

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#37
I was the first employee at a company which uses RAG (Halcyon), and I’ve been working through issues with various vector store providers for almost two years now. We’ve gone from tens of thousands to billions of embeddings in that timeframe - so I feel qualified to at least offer my opinion on the problem.

I agree that starting with pgvector is wise. It’s the thing you already have (postgres), and it works pretty well out of the box. But there are definitely gotchas that don’t usually get mentioned. Although the pgvector filtering story is better than it was a year ago, high-cardinality filters still feel like a bit of an afterthought (low-cardinality filters can be solved with partial indices even at scale). You should also be aware that the workload for ANN is pretty different from normal web-app stuff, so you probably want your embeddings in a separate, differently-optimized database. And if you do lots of updates or deletes, you’ll need to make sure autovacuum is properly tuned or else index performance will suffer. Finally, building HNSW indices in Postgres is still extremely slow (even with parallel index builds), so it is difficult to experiment with index hyperparameters at scale.

Dedicated vector stores often solve some of these problems but create others. Index builds are often much faster, and you’re working at a higher level (for better or worse) so there’s less time spent on tuning indices or database configurations. But (as mentioned in other comments) keeping your data in sync is a huge issue. Even if updates and deletes aren’t a big part of your workload, figuring out what metadata to index alongside your vectors can be challenging. Adding new pieces of metadata may involve rebuilding the entire index, so you need a robust way to move terabytes of data reasonably quickly. The other challenge I’ve found is that filtering is often the “special sauce” that vector store providers bring to the table, so it’s pretty difficult to reason about the performance and recall of various types of filters.

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#38
post #37

I was the first employee at a company which uses RAG (Halcyon), and I’ve been working through issues with various vector store providers for almost two years now. We’ve gone from tens of thousands to billions of embeddings in that timeframe - so I feel qualified to at least offer my opinion on the problem. I agree that starting with pgvector is wise. It’s the thing you already have (postgres), and it works pretty wel…

What would you recommend for billions of embeddings?

Re: Long Read: Lessons from Building Semantic Search for GitHub and Why I Failed

#40
post #28
post #18

This seems pretty similar to something that the ManticoreSearch team released a year ago https://manticoresearch.com/blog/manticoresearch-github-issu... You can index any GH repo and then search it with vector, keyword, hybrid and more. There's faceting and anything else you could ever want. And it is astoundingly fast - even vector search. Here's the direct link to the demo https://github.manticoresearch.com/

oh wow that's super cool, I tried it and it's very fast indeed. thanks for sharing! will spend more time to understand how it's implemented

Have you experimented with late interaction?

https://jina.ai/news/what-is-colbert-and-late-interaction-an...

http://musingsaboutlibrarianship.blogspot.com/2024/06/can-se...

https://colbert.aiserv.cloud/

Post reply on HN