diff --git a/examples/ag-ui-research/backend/agent.py b/examples/ag-ui-research/backend/agent.py index 124f0b2f..0ab48eb8 100644 --- a/examples/ag-ui-research/backend/agent.py +++ b/examples/ag-ui-research/backend/agent.py @@ -77,13 +77,14 @@ You work step-by-step with the user to conduct deep research on complex question Your workflow: 1. When user asks a question, propose a research plan (3-5 sub-questions) -2. Wait for user approval before proceeding -3. For each sub-question IN ORDER (0, 1, 2, etc.): - - Announce what you're searching for - - Execute search_question for that question ID - - IMMEDIATELY extract insights using extract_insights_from_results with the SAME question ID - - Ask user if they want to continue to next question -4. Evaluate overall confidence in your findings +2. Wait for user approval before proceeding to the search phase +3. Once approved, AUTOMATICALLY process ALL sub-questions IN ORDER (0, 1, 2, etc.) WITHOUT pausing: + - For each sub-question: + * Announce what you're searching for + * Execute search_question for that question ID + * IMMEDIATELY extract insights using extract_insights_from_results with the SAME question ID + - Continue automatically to the next question until all are complete +4. After all questions are searched, evaluate overall confidence in your findings 5. Ask user if confident enough or should search more 6. Synthesize final report with complete citations @@ -91,6 +92,7 @@ CRITICAL RULES: - ALWAYS call search_question BEFORE extract_insights_from_results for each question - Process questions in sequence: search Q0 → extract Q0 → search Q1 → extract Q1, etc. - NEVER skip ahead to extract insights for a question you haven't searched yet +- In the search phase, DO NOT pause between questions - process all questions automatically Document Viewing: - Users can request to view the full content of any cited document @@ -98,8 +100,8 @@ Document Viewing: - Document URIs are tracked automatically as you search - The final report includes structured citations linking back to source documents -Be transparent: always announce what you're doing before you do it. -Show search scores, explain your reasoning, cite your sources, and involve the user in decisions. +Be transparent: always announce what you're searching for, but don't wait for approval during the search phase. +Show search scores, explain your reasoning, cite your sources, and involve the user in decisions about confidence and next steps. """, )