-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Update VectorStoreIndex trait #42
refactor: Update VectorStoreIndex trait #42
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a lot of code got simplified 👍
@garance-buricatu for the same of record keeping, here are my opinions on your points:
That's fine for now, we'll remove the
IMO we should remove the provided implementation since 1) some DBs might have a more optimized way to query the ids only (e.g.: |
Github issue: #41
VectorStoreIndex
traitNotes:
DocumentEmbeddings
as theInMemoryVectorStore
value type. Did this because if I change it to a more general type, I would need to change theVectorStore
trait which should be done in a separate branch.top_n_ids
ofVectorStoreIndex
contains a generic type:<T: for<'a> Deserialize<'a>
. Technically, it we don't need typeT
to get theids
of the top n documents. However, I found it simpler to get theids
of the top n by calling the existing methodtop_n
which needs to be called like thistop_n::<T>()
and filtering the ids only. This also allows the implementation of the methodtop_n_ids
to be to same for all trait implementations (ie. implementation defined in trait def)Please let me know what you think about the second point! Thanks:)