From 3abe669681df38fe1e43c2d8c0fad8165318d983 Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Fri, 19 Sep 2025 09:13:27 +0300 Subject: [PATCH] Simplify presearch prompt --- src/haiku/rag/research/orchestrator.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/haiku/rag/research/orchestrator.py b/src/haiku/rag/research/orchestrator.py index 666ed3cf..1274f384 100644 --- a/src/haiku/rag/research/orchestrator.py +++ b/src/haiku/rag/research/orchestrator.py @@ -108,40 +108,27 @@ class ResearchOrchestrator(BaseResearchAgent[ResearchPlan]): # Use provided console or create a new one console = console or Console() if verbose else None + # Create initial research plan # Run a simple presearch survey to summarize KB context if console: + console.print("\n[bold cyan]📋 Creating research plan...[/bold cyan]") console.print( "\n[bold cyan]🔎 Presearch: summarizing KB context...[/bold cyan]" ) presearch_result = await self.presearch_agent.run(question, deps=deps) - # Create initial research plan - if console: - console.print("\n[bold cyan]📋 Creating research plan...[/bold cyan]") - - # Include the presearch summary to ground the planning step. - - planning_context_xml = format_as_xml( - { - "original_question": question, - "presearch_summary": presearch_result.output or "", - }, - root_tag="planning_context", - ) - plan_prompt = ( "Create a research plan for the main question below.\n\n" f"Main question: {question}\n\n" "Use this brief presearch summary to inform the plan. Focus the 3 sub-questions " "on the most important aspects not already obvious from the current KB context.\n\n" - f"{planning_context_xml}" + f"{presearch_result.output}" ) plan_result: AgentRunResult[ResearchPlan] = await self.run( plan_prompt, deps=deps ) - context.sub_questions = plan_result.output.sub_questions if console: