Separate planned queries from executed queries

Đang mở
#153 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
jupyter-notebook
Lĩnh vực
ai, backend

Hướng nghiên cứu

Bắt đầu bằng cách lần theo OverallState và các node generate_query, web_research và reflection để xem search_query được ghi và đếm ở đâu. So sánh việc tách các state-key được đề xuất với cách tiếp cận dùng counter, sau đó xác minh rằng các query dự kiến vẫn khác biệt với các query đã thực thi và reflection báo cáo số lượng thực sự đã chạy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Jupyter Notebook
Star
18.4k
Fork
3.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google-gemini/gemini-fullstack-langgraph-quickstart

Tất cả issue của google-gemini/gemini-fullstack-langgraph-quickstart

Issue tương tự

Thêm issue về AI Infra & Agents

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.