Live data from Hacker News

RAG at scale: Synchronizing and ingesting billions of text embeddings

medium.com

41–50 of 57 posts

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#41
Good article BUT I can't fathom that people would use a managed service to generate and store embeddings.

The openAI or replicate embeddings APIs are already a managed service... You would still need to self managing it all just into a different API.

And dealing with embeddings is the kind of fun work every engineer wants to do anyway.

Still a good article but very perplexing how the company can exist

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#42
post #35

Thanks for writing this up! I'm working on a very similar service ( https://embeddingsync.com/ ) and I implemented almost the same as you've described here, but using a poll-based stateful workflow model instead of queueing. The biggest challenge - which I haven't solved as seamlessly as I'd like - is supporting updates / deletes in the source. You don't seem to discuss it in this post, does Neum handle that?

Co-author of the article here.

We do support updates for some sources. Deletes not yet. For some sources we do polling which is then dumped on the queues. For other we have listeners that subscribe to changes.

What are the challenges you are facing in supporting this?

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#43
post #34

Are there any good implementations of using RAG within postgresql ecosystem? I have seen blogposts from supabase[0] and timescale db[1] but not a full fledged project. The full text search is very good within postgres at the moment and having semantic search within the same ecosystem is quiet helpful atleast for simple usecases. [0] https://supabase.com/docs/guides/database/extensions/pgvecto... [1] https://www.times…

Or generally what are good vector dbs have tried LlaMaindex, pinecone and milvus but all kinda sucked different way.

What about then sucked?

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#44

Good article BUT I can't fathom that people would use a managed service to generate and store embeddings. The openAI or replicate embeddings APIs are already a managed service... You would still need to self managing it all just into a different API. And dealing with embeddings is the kind of fun work every engineer wants to do anyway. Still a good article but very perplexing how the company can exist

Some engineers find it fun, other might not. Same as everything.

IMO the fun parts are actually prototyping and figuring out the right pattern I want to use for my solution. Once you have done that, scaling and dealing with robustness tends to be a bit less fun.

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#45

Good article BUT I can't fathom that people would use a managed service to generate and store embeddings. The openAI or replicate embeddings APIs are already a managed service... You would still need to self managing it all just into a different API. And dealing with embeddings is the kind of fun work every engineer wants to do anyway. Still a good article but very perplexing how the company can exist

Sounds like the same people who use langchain's "Prompt replacement" methods instead of, you know, just use string formatting

https://python.langchain.com/docs/modules/model_io/prompts/p...

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#46
post #32

Earlier quoted context omitted.

To some degree. The amount of data that will be brought into search solutions will be enormous, seems like a good time to try to reimagine what that process might look like

Also this is search for LLM not for humans so optimal solution will be different. Or even with models it is not that hard to imagine that Mistral-8b will need different results than GPT4 which has 1.76 trillion parameters.

I think this is premature optimisation. LLMs are the general tool here - in principle we should try first to adjust LLMs to search instead of doing it the other way around.

But really I think that LLMs should use search as just one of their tools - just like humans do. I would call it Tool Augmented Generation. And also be able to reason through many hops. A good system answer the question _What is the 10th Fibonacci number?_ by looking up the definition in wikipedia, writing code for computing the sequence, testing and debugging it and executing it to compute the 10th number.

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#47
post #24

It seems to me that RAG is really search, and search is generally a hard problem without an easy one size fits all solution. E.g., as people push retrieval further and further in the context of LLM generation, they're going to go further down the rabbit hole of how to build a good search system. Is everyone currently reinventing search from first principles?

We're using a product from our existing enterprise search vendor, which they pitch an NLP search. Not convinced it's better than the one we already had consider we have to use an intermediate step of having the LLM turn the user's junk input into a keyword search query, but it's definitely more expensive...

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#48
We also shared an article about how we run these indexing jobs at scale at deepset with kubernetes, SQS, s3 and KEDA.

TL;DR: Queue upload events via SQS, upload files to s3, scale consumers based on queue length with keda and use haystack to turn files into embeddings.

This also works for arbitrary pipelines with your models, custom nodes (python code snippeds) and is pretty efficient.

Part1 (application&architecture): https://medium.com/@ArzelaAscoli/scaling-nlp-indexing-pipeli... Part2 (scaling): https://medium.com/@ArzelaAscoli/scaling-nlp-indexing-pipeli... Example code: https://github.com/ArzelaAscoIi/haystack-keda-indexing

We actually also stared with celery, but moved to SQS to improve the stability.

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#49
post #25
post #10

Earlier quoted context omitted.

we've been using pgvector at the 100M scale without any major problems so far, but I guess it depends on your specific use case. we've also been using elastic search dense vector fields which also seems to scale well, but of course its pricey but we already have it in our infra so works well.

What size are your embeddings?

384 dims. we're using: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v...

Re: RAG at scale: Synchronizing and ingesting billions of text embeddings

#50
post #10

Earlier quoted context omitted.

we've been using pgvector at the 100M scale without any major problems so far, but I guess it depends on your specific use case. we've also been using elastic search dense vector fields which also seems to scale well, but of course its pricey but we already have it in our infra so works well.

What type of latency requirements are you dealing with? (i.e. look up time, ingestion time) Were you using postgres already or migrated data into it?

we have look up latency requirements on the elastic side. on pgvector it is currently a staging and aggregation database so lookup latency not so important. Our requirement right now is that we need to be able to embed and ingest ~100M vectors / day. This we can achieve without any problems now.

For future lookup queries on pgvector, we can almost always pre-filter on an index before the vector search.

yes, we use postgres pretty extensively already.

Post reply on HN