-
Notifications
You must be signed in to change notification settings - Fork 889
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
Reranking API #1066
Comments
Hi @yanxi0830 and team, I'd love to contribute to implementing the Reranking API. Before I start, I wanted to check in and see if any work has already been done on this. Are there any ongoing discussions or branches related to reranking? Also, would you be open to collaboration if someone else has started? Looking forward to your thoughts! Thanks 😄 |
Hi @yanxi0830, I would be interested in implementing it. Adding some thoughts - it would be helpful to implement reranking as a part of existing
@runtime_checkable
@trace_protocol
class RAGToolRuntime(Protocol):
@webmethod(route="/tool-runtime/rag-tool/query", method="POST")
async def query(
self,
content: InterleavedContent,
vector_db_ids: List[str],
query_config: Optional[RAGQueryConfig] = None,
rerank: bool = True | False,
) -> RAGQueryResult:
...
@webmethod(route="/tool-runtime/rag-tool/rerank", method="POST")
async def rerank(
self,
query: InterleavedContent,
retrieved_docs: List[RAGDocument],
reranker_model: str = "xxxx",
top_k: int = 5,
) -> RAGRerankResult:
"""Re-rank retrieved documents based on relevance"""
... This way when a user calls query() they get best-ranked outputs by default, providing flexibility to opt out if needed. With this implementing reranking providers would also be easier. Just want to get some thoughts on this approach. |
@kevincogan sorry, missed your message. Would be open for collaboration :) |
Hey @yanxi0830 and @varshaprasad96 ,
I’m happy to take the lead on drafting this RFC and can include:
Let me know if you think this is a good approach. If so, I can get started and share a draft within the next few days for feedback. And of course, always open for collaboration @varshaprasad96 ! 😄 |
@kevincogan @varshaprasad96 Thanks for the interest! Very excited about it! @kevincogan Yes, the points you've mentioned are very important, please draft an RFC for the API design for discussion before diving into the implementation. Looking forward to it! Some additional considerations:
|
Sounds great, thanks! @yanxi0830 |
Would it be possible to add me as one of the assignees while I am working on the RFC for this ? @yanxi0830 |
🚀 Describe the new functionality needed
Our current retrieval stage for RAG only indexing and retrieve preliminary results from embedding-based retrieval system.
It's common practice to apply re-ranking on top of retrieved candidates in RAG workflow.
Reranking Providers
Remote
Inline
API Reference
💡 Why is this needed? What if we don't build it?
Other thoughts
The text was updated successfully, but these errors were encountered: