Separate planned queries from executed queries

オープン
#153 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
jupyter-notebook
領域
ai, backend

調査の方向性

まず OverallState と generate_query、web_research、reflection の各ノードを追跡して、search_query がどこで書き込まれ、カウントされるかを確認します。提案されている state-key の分離とカウンター方式を比較し、計画されたクエリと実行されたクエリが区別されたままであること、そして reflection が実際に実行された数を報告することを確認します。

索引モデルが issue の本文から書いたものです。

説明

Description of the feature request:

If I understand correctly, currently both generate_query and web_research nodes write to the same search_query key in OverallState, which is declared as:

search_query: Annotated[list, operator.add]

Because of the operator.add reducer, this causes search_query to accumulate both the original planned queries and the queries that have been executed, leading to duplication.

We should probably separate the concepts of planned queries and executed queries in state management.

What problem are you trying to solve with this feature?

This design makes len(state["search_query"]) misleading, since it double-counts queries (planned + executed).

In the current flow:

  1. generate_query sets search_query = ["q1", "q2", "q3"]

  2. Each web_research branch appends its own query: ["q1", "q2", "q3", "q1", "q2", "q3"]

  3. Reflection calculates: number_of_ran_queries = len(state["search_query"]) (6, but only 3 actually ran)

  4. This inflated number is used to offset IDs for follow-up queries. Although because IDs remain unique, the count is actually incorrect. It works but any future logic relying on an accurate count will be wrong.

Any other information you'd like to share?

Two possible solutions:

1) Separate state keys

  • planned_queries: Annotated[list[str], operator.add] -> updated by generate_query and follow-up generation

  • executed_queries: Annotated[list[str], operator.add] -> updated by web_research

  • number_of_ran_queries = len(state.get("executed_queries", []))

2) Keep one list but stop re-adding in web_research

  • Remove search_query write from web_research

  • Add a ran_count: Annotated[int, operator.add] counter instead

  • Reflection uses ran_count

主要言語
Jupyter Notebook
スター
18.4k
フォーク
3.1k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google-gemini/gemini-fullstack-langgraph-quickstart のほかの issue

google-gemini/gemini-fullstack-langgraph-quickstart の issue をすべて見る

似ている issue

AI Infra & Agents の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。