-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Description of the bug:
I think your code has some duplication in return variable state for search_query
.
generate_query
node returns{"search_query": result.query}
, which will add tosearch_query
in OverallState (not QueryGenerationState actually) first n results.- Multiple
web_search
nodes return{ "sources_gathered": sources_gathered, "search_query": [state["search_query"]], "web_research_result": [modified_text], }
which will duplicate in OverallState.
So in the end, the number of first search_query
has duplicate twice (one with no result, one with search results), which kindly affects reflection node, for number of ran queries
track wrong number.
LangSmith trace: https://smith.langchain.com/public/9c27a818-4cd3-4ad0-9e33-2b87dd658d1c/
Actual vs expected behavior:
Actual result:
It duplicated and then number of ran queries track wrong.

Expected behavior:
We should only count for one time and fix the number of ran queries correct. This one will really need because of the later tracking.
Any other information you'd like to share?
I think the typing for QueryGenerationState here is misunderstood.
LangGraph did not have something working like different states in one workflow, query generation node will assign these queries into OverallState not QueryGenerationState.