Repository navigation
fix(retrieval): resolve 10 correctness, security, and performance bugs - #816
Merged
Merged
Conversation
…784 #785 #786 #787 #788 #789) Fix a batch of correctness, safety, and performance bugs in the retrieval and text-splitter stack, each with a regression test: #780 InMemoryVectorStore.search returned ALL docs for top_k<=0 because np.argpartition(scores,-0)[-0:] is [0:]. Early-return [] instead. #781 CharacterTextSplitter/RecursiveCharacterTextSplitter accepted chunk_overlap >= chunk_size (raised or silently dropped data); validate in __init__. #782/#783 FederatedRetriever and WorldModelRAG.query used `top_k or default`, conflating top_k=0 with None; use `top_k if top_k is not None else`. #784 Neo4jStore.get_neighbors interpolated max_hops into a Cypher variable-length pattern unchecked (injection); cast to a bounded int. #785 CassandraVectorStore search built LIMIT via f-string; validate/cast top_k and pass it as a bound parameter. #786 RAGFusionRetriever ran query variants serially; use asyncio.gather. #787 HybridSearchRetriever.add_documents replaced the index (data loss) and fully sorted BM25 scores; extend the corpus and use heapq.nlargest. #788 HybridSearchRetriever.retrieve failed entirely when the vector store was down; fall back to BM25-only fusion with a warning. #789 WorldModelRAG.ingest embedded one doc per call; batch into a single add. Also add astrapy>=1.0 to the [cassandra] extra so the astra ImportError message is accurate. Co-authored-by: Dhruv Garg <[email protected]>
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.
Production audit fixes for retrieval, text splitters, and the KG/Cassandra backends.
Closes #780
Closes #781
Closes #782
Closes #783
Closes #784
Closes #785
Closes #786
Closes #787
Closes #788
Closes #789