Live data from Hacker News

Vector indexing all of Wikipedia on a laptop

foojay.io

121–130 of 146 posts

Re: Vector indexing all of Wikipedia on a laptop

#121
What are the good solutions in this space? Vector databases I mean. Mostly for semantic search across various texts.

I have a few projects I'd like to work on. For typical web projects, I have a "go to" stack and I'd like to add something sensible for vector based search to that.

Re: Vector indexing all of Wikipedia on a laptop

#122

What are the good solutions in this space? Vector databases I mean. Mostly for semantic search across various texts. I have a few projects I'd like to work on. For typical web projects, I have a "go to" stack and I'd like to add something sensible for vector based search to that.

In my experience its usually easiest to use a vector store extension for an off-the-shelf database like postgres (pgvector is nice). That way you don't have to manage another, rapidly changing, service and you can easily combine queries on the vectors with regular columns, join them and so on.

Re: Vector indexing all of Wikipedia on a laptop

#123

What are the good solutions in this space? Vector databases I mean. Mostly for semantic search across various texts. I have a few projects I'd like to work on. For typical web projects, I have a "go to" stack and I'd like to add something sensible for vector based search to that.

JVector (the index used in TFA) is available as a service with a friendly API from DataStax. https://www.datastax.com/products/datastax-astra

[article author, I work on JVector and Astra]

Re: Vector indexing all of Wikipedia on a laptop

#124

Earlier quoted context omitted.

I was trying to make the point that the dominant factor becomes linear instead of logarithmic, but more accurately it's O(S log N) = O(N log N) because S is proportional to N.

Sure, I see. I think this is an area where complexity analysis doesn’t lead to useful information. To be more correct it’s O(N/C log C) where C is the capacity of a segment. In this case you can ignore 1/C and log C as constant. So now sure, you actually just have O(N). But this is not super useful as it says that a segmented hnsw approach and brute force approach are the same - when this is really not the case in pr…

> I’m not sure why we would ever do anything with segmentation according to that analysis if it were correct.

What's your alternative when you can't build an index larger than C?

Re: Vector indexing all of Wikipedia on a laptop

#125
post #110

Earlier quoted context omitted.

I'm baffled that so many people fixate on the estimated cost and miss the fact that it's a public dataset . As in, free.

Getting the embeddings ain’t free

Unless you're counting your network access cost, the dataset of embeddings is in fact free and TFA includes instructions on how to download them for free.

Re: Vector indexing all of Wikipedia on a laptop

#127

What are the good solutions in this space? Vector databases I mean. Mostly for semantic search across various texts. I have a few projects I'd like to work on. For typical web projects, I have a "go to" stack and I'd like to add something sensible for vector based search to that.

JVector (the index used in TFA) is available as a service with a friendly API from DataStax. https://www.datastax.com/products/datastax-astra [article author, I work on JVector and Astra]

Nice. I wanted to try something out on a machine before moving to hosted soclutions.

Re: Vector indexing all of Wikipedia on a laptop

#128

Maybe I’m missing something but I’ve created vector embeddings for all of English Wikipedia about a dozen times and it costs maybe $10 of compute on Colab, not $5000

This is covering 300+ languages, not just English, and it's specifically using Cohere's Embed v3 embeddings, which are provided as a service and currently priced at US$0.10 per million tokens [1]. I assume if you're running on Colab you're using an open model, and possibly a relatively lighter weight one as well? [1]: https://cohere.com/pricing

hey, 3 cents cheaper than text-embedding-3-large (without batching)!

Are there some benchmarks available that compare it with the openai model?

Re: Vector indexing all of Wikipedia on a laptop

#129

Earlier quoted context omitted.

When it’s all in memory you get to amortize the cost of the initial load. Or just pay it when it’s not part of the hot path. When it’s segmented, you’re doing that because memory is full and you need to read in all the segments you don’t have. That’ll completely overwhelm the log n of the search you still get

I was trying to make the point that the dominant factor becomes linear instead of logarithmic, but more accurately it's O(S log N) = O(N log N) because S (number of segments) is proportional to N (number of vectors).

Ah yeah that’s what I wanted to write but I guess I didn’t want to put words in your mouth, and stuck to what I could be certain about happening. We do all this work to throw away the unneeded bits in one situation and when comparing it to a slightly different situation go “huh some of that garbage would be kinda nice here”

Re: Vector indexing all of Wikipedia on a laptop

#130

Would a docker container help running it on Windows?

Technically it does run on windows, you just can't build the entire dataset without adding the sharding code mentioned. Set divisor=100 in config.properties and it will happily build an index over 1% of the dataset.
Post reply on HN