feat: add hallucination grader and fix web search dead branch#123
Open
bhavyakeerthi3 wants to merge 3 commits intoreactome:mainfrom
Open
feat: add hallucination grader and fix web search dead branch#123bhavyakeerthi3 wants to merge 3 commits intoreactome:mainfrom
bhavyakeerthi3 wants to merge 3 commits intoreactome:mainfrom
Conversation
This was referenced Mar 9, 2026
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.
Summary
This PR introduces two significant improvements to the cross_database agent graph: a new Hallucination Grader for RAG quality control and a fix for the Web Search dead branch bug.
Changes
1. Hallucination Grader (New Feature)
While the existing pipeline had a completeness_grader to assess if answers were detailed, it lacked a check for factual grounding. This PR adds a "Hallucination Grader" to verify that generated answers are strictly supported by the retrieved context.
Implementation Details:
Yes/Noscore and areasonfor any detected hallucinations.reactome_contextanduniprot_context) to provide the grader with the necessary evidence.2. Fix: Web Search Dead Branch (Bug Fix)
Problem: When both Reactome and UniProt returned incomplete answers, the graph was short-circuiting directly to the final response, completely skipping the intended Tavily web search.
The Fix:
perform_web_searchgraph node backed by TavilyWrapper.{web_results}placeholder so the final response can incorporate and cite external sources when relevant.Files Changed
Testing
Verified via static code review and graph wiring validation. Full end-to-end verification requires OpenAI and Tavily API keys.