-
Notifications
You must be signed in to change notification settings - Fork 324
SDK - Added re-ranking into vector search #1516
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
Conversation
"boost": 1.0 | ||
}, | ||
} | ||
}, |
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.
@montanalow How does this "rerank" key look?
query
is the text to compare against.
model
is the model to use
num_documents_to_rerank
are the number of results to return from vector search and rerank against before limiting it to the limit
parameter defined in the next section
"rerank": { | ||
"query": "Test document 2", | ||
"model": "mixedbread-ai/mxbai-rerank-base-v1", | ||
"num_documents_to_rerank": 100 |
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.
What about calling this just limit
. Does llamaindex or transformers have a similarly named parameter name?
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.
Oh sorry missed this before merging. I think it might be a little confusing if we make it limit as we already have a limit key, and this isn't actually the limit. We already defined limit with llama index to mean the final number of items returned, but I'm not sure if they or langchain use it elsewhere.
} | ||
}, | ||
"rerank": { | ||
"query": "Test document 2", |
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 query
is being repeated a few places in this example, which may be pretty typical. One enhancement would be to move the query string out and reuse it everywhere, and make passing specific sub clause query strings optional. Not a launch blocker though.
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.
Got it, I will think more on making that optional and reusing it, but will merge this and get it out in the meantime.
No description provided.