-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add framework integration for composite retrieval #17536
base: main
Are you sure you want to change the base?
Conversation
create_if_not_exists=True, | ||
# CompositeRetrievalMode.FULL will query each index individually and globally rerank results at the end | ||
mode=CompositeRetrievalMode.FULL, | ||
rerank_top_n=5, |
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.
is reranking optional?
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.
No it always reranks but when omitted it uses the server side default of 6
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.
Maybe this is a backend consideration then, but it might be nice to disable this and/or use something like relative score fusion instead (I feel the reranker can be a source of error depending on what your documents look like)
...x-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/composite_retriever.py
Outdated
Show resolved
Hide resolved
...x-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/composite_retriever.py
Show resolved
Hide resolved
|
||
# Start retrieving context for your queries | ||
# async .aretrieve() is also available | ||
nodes = retriever.retrieve("What does YC do?") |
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.
I wonder if it'd be nice to show how to plug this into an agent using, say, a RetrieverTool or similar? Maybe in its own notebook though, up to you
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.
Looks pretty good! Just a few minor comments.
Description
Add
LlamaCloudCompositeRetriever
class. Some refactoring to reuse code that was inLlamaCloudRetriever
New Package?
Did I fill in the
tool.llamahub
section in thepyproject.toml
and provide a detailed README.md for my new integration or package?Version Bump?
Did I bump the version in the
pyproject.toml
file of the package I am updating? (Except for thellama-index-core
package)Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.
Suggested Checklist:
make format; make lint
to appease the lint gods