Skip to content
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

[FEAT]: Add Optional Small-to-Big Retrieval #1387

Open
cope opened this issue May 13, 2024 · 1 comment
Open

[FEAT]: Add Optional Small-to-Big Retrieval #1387

cope opened this issue May 13, 2024 · 1 comment
Labels
enhancement New feature or request feature request

Comments

@cope
Copy link
Sponsor Contributor

cope commented May 13, 2024

What would you like to see?

Apparently, smaller chunk sizes improve retrieval quality, but larger chunk sizes improve generation quality: Advanced RAG 01: Small-to-Big Retrieval.

If the current embediing process stores the relative chunk ids per document, then when chunk i is retrieved, we can prepend chunks [i-2, i-1] and append chunks [i+1, i+2] and pass on that big combined text to the generation step. This would have both benefits: smaller chunks for retrieval and larger chunks for generation. Naturally, we need to make sure that any i+/-n chunk exists before adding null.

My idea is to simplify the implementation by just adding optional prepend/append integers that would default to 0, but could be changed by the user in the settings.

The alternative is to do full Parent Document Retriever, but this is a much bigger task IMHO.

@cope cope added enhancement New feature or request feature request labels May 13, 2024
@RahSwe
Copy link

RahSwe commented May 13, 2024

Parent Document Retriever would be a nice option for documents (like the pinning option). Due to mixes of documents in which some are too big to be retrieved as parent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request
Projects
None yet
Development

No branches or pull requests

2 participants