Separate planned queries from executed queries

Aperta
#153 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
jupyter-notebook
Ambito
ai, backend

Direzione di ricerca

Inizia tracciando OverallState e i nodi generate_query, web_research e reflection per vedere dove search_query viene scritto e conteggiato. Confronta la separazione proposta delle chiavi di stato con l’approccio basato su un contatore, poi verifica che le query pianificate rimangano distinte da quelle eseguite e che reflection riporti il numero effettivamente eseguito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Jupyter Notebook
Stelle
18.4k
Fork
3.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google-gemini/gemini-fullstack-langgraph-quickstart

Tutte le issue di google-gemini/gemini-fullstack-langgraph-quickstart

Issue simili

Altre issue su AI Infra & Agents

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.