fix(rag): enforce chunk size and overlap when merging splits - #7471
Draft
vineethsaivs wants to merge 1 commit into
Draft
vineethsaivs wants to merge 1 commit into
vineethsaivs wants to merge 1 commit into
Conversation
Use the actual join separator for size accounting and discard retained splits until both the overlap and next-chunk size limits hold.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
Ping me wheneever this is ready for reviiew |
Author
|
The patch and all 137 RAG tests are ready. @Vidit-Ostwal, could you add the required |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Fixes #7470
Summary
RAG text chunks repeat content with zero overlap and can exceed chunk_size; retained separators may also be inserted twice. Use the actual join separator for size accounting and discard retained splits until both the overlap and next-chunk size limits hold.
Verification
uv run --no-sync pytest lib/crewai-tools/tests/rag -n 0 -q: 137 passed; four regressions fail before.Additional context
Native Python 3.12 tests with network access blocked by the repository test configuration. No LLM calls or credentials required. AI assistance was used to investigate, implement and test this change.
Draft pending the required
llm-generatedlabel. GitHub returns 403 when this account attempts to add it; a maintainer needs to apply the label before review.