-
Notifications
You must be signed in to change notification settings - Fork 0
Preprocessing enhancements: Safety assessment, Language detection #101
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
Merged
Conversation
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
- Implement parallel execution of safety and scope check, query expansion, and language detection
… expansion and conversation history management
- Replace SelfQueryRetriever with efficient hybrid search (BM25 + vector) - Add RRF (Reciprocal Rank Fusion) support for query expansion - Implement parallel processing for improved performance
… expansion and conversation history management
- Add type annotation for rrf_scores in retrieval_utils.py - Fix metadata dictionary comprehension in csv_chroma.py - Update retriever type annotations to use Any - Add isinstance check for BM25Retriever - Remove default values from TypedDict in base.py - Fix TypedDict expansion in postprocess method
- Implement parallel execution of safety and scope check, query expansion, and language detection
- Implement parallel execution of safety and scope check, query expansion, and language detection
- Replace SelfQueryRetriever with efficient hybrid search (BM25 + vector) - Add RRF (Reciprocal Rank Fusion) support for query expansion - Implement parallel processing for improved performance
…ination mitigation
Closed
adamjohnwright
approved these changes
Feb 6, 2026
* rewrite HybridRetriever class * fix types * fix HybridRetriever class inheritance issues * fix lint * multithread, as in Helia's code
GFJHogue
added a commit
that referenced
this pull request
Feb 9, 2026
…ss (#102) * feat: expand preprocessing to a multi-step workflow. - Implement parallel execution of safety and scope check, query expansion, and language detection * feat: Add new runnables for checking question safety and scope, query expansion and conversation history management * feat:improved hybrid retrieval - Replace SelfQueryRetriever with efficient hybrid search (BM25 + vector) - Add RRF (Reciprocal Rank Fusion) support for query expansion - Implement parallel processing for improved performance * feat: Add new runnables for checking question safety and scope, query expansion and conversation history management * code quality check fixes * fix: Resolve mypy linter errors - Add type annotation for rrf_scores in retrieval_utils.py - Fix metadata dictionary comprehension in csv_chroma.py - Update retriever type annotations to use Any - Add isinstance check for BM25Retriever - Remove default values from TypedDict in base.py - Fix TypedDict expansion in postprocess method * remove: Remove reactome_kg directory from repository * feat: expand preprocessing to a multi-step workflow. - Implement parallel execution of safety and scope check, query expansion, and language detection * feat: expand preprocessing to a multi-step workflow. - Implement parallel execution of safety and scope check, query expansion, and language detection * feat:improved hybrid retrieval - Replace SelfQueryRetriever with efficient hybrid search (BM25 + vector) - Add RRF (Reciprocal Rank Fusion) support for query expansion - Implement parallel processing for improved performance * feat:improved answer generation, in-line citation handling and hallucination mitigation * remove irrelevant docs * [WIP] clean up changes * [WIP] clean up changes (2) * revert retrieval changes * macos-intel actions runner * fix SafetyCheck type usage * stream unsafe response to user * black spacing * cross-db use detected_language from base state * pre-release docker push * new HybridRetriever class (#102) * rewrite HybridRetriever class * fix types * fix HybridRetriever class inheritance issues * fix lint * multithread, as in Helia's code * fix typing for #102 --------- Co-authored-by: Helia Mohammadi <helia.mohammadi01@gmail.com>
GFJHogue
added a commit
that referenced
this pull request
Feb 9, 2026
…ss (#102) * feat: expand preprocessing to a multi-step workflow. - Implement parallel execution of safety and scope check, query expansion, and language detection * feat: Add new runnables for checking question safety and scope, query expansion and conversation history management * feat:improved hybrid retrieval - Replace SelfQueryRetriever with efficient hybrid search (BM25 + vector) - Add RRF (Reciprocal Rank Fusion) support for query expansion - Implement parallel processing for improved performance * feat: Add new runnables for checking question safety and scope, query expansion and conversation history management * code quality check fixes * fix: Resolve mypy linter errors - Add type annotation for rrf_scores in retrieval_utils.py - Fix metadata dictionary comprehension in csv_chroma.py - Update retriever type annotations to use Any - Add isinstance check for BM25Retriever - Remove default values from TypedDict in base.py - Fix TypedDict expansion in postprocess method * remove: Remove reactome_kg directory from repository * feat: expand preprocessing to a multi-step workflow. - Implement parallel execution of safety and scope check, query expansion, and language detection * feat: expand preprocessing to a multi-step workflow. - Implement parallel execution of safety and scope check, query expansion, and language detection * feat:improved hybrid retrieval - Replace SelfQueryRetriever with efficient hybrid search (BM25 + vector) - Add RRF (Reciprocal Rank Fusion) support for query expansion - Implement parallel processing for improved performance * feat:improved answer generation, in-line citation handling and hallucination mitigation * remove irrelevant docs * [WIP] clean up changes * [WIP] clean up changes (2) * revert retrieval changes * macos-intel actions runner * fix SafetyCheck type usage * stream unsafe response to user * black spacing * cross-db use detected_language from base state * pre-release docker push * new HybridRetriever class (#102) * rewrite HybridRetriever class * fix types * fix HybridRetriever class inheritance issues * fix lint * multithread, as in Helia's code * fix typing for #102 --------- Co-authored-by: Helia Mohammadi <helia.mohammadi01@gmail.com> * revert pre-release branch stuff --------- Co-authored-by: Helia Mohammadi <helia.mohammadi01@gmail.com>
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.
The
BaseGraphBuilder.preprocess()step (available for all chat profiles) now includes safety check and language detection tasks.The safety check adds a
safetystring field toBaseState, which is expected to be equal to"true"when the user's input is considered to be appropriate and within Reactome scope, as well as an additionalreason_unsafestring field.The language detection adds a self-explanatory
detected_languagestring field toBaseState.Breaking change:
detected_languageisn't English, we need to translate the English RAG output and stream it instead