mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-15 11:04:44 +08:00
Add a new "analysis" step type to handle reasoning and synthesis tasks that don't require code execution, addressing the concern that routing all non-search tasks to the coder agent was inappropriate. Changes: - Add ANALYSIS enum value to StepType in planner_model.py - Create analyst_node for pure LLM reasoning without tools - Update graph routing to route analysis steps to analyst agent - Add analyst agent to AGENT_LLM_MAP configuration - Create analyst prompts (English and Chinese) - Update planner prompts with guidance on choosing between analysis (reasoning/synthesis) and processing (code execution) - Change default step_type inference from "processing" to "analysis" when need_search=false Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ from langgraph.graph import END, START, StateGraph
|
||||
from src.prompts.planner_model import StepType
|
||||
|
||||
from .nodes import (
|
||||
analyst_node,
|
||||
background_investigation_node,
|
||||
coder_node,
|
||||
coordinator_node,
|
||||
@@ -39,6 +40,8 @@ def continue_to_running_research_team(state: State):
|
||||
|
||||
if incomplete_step.step_type == StepType.RESEARCH:
|
||||
return "researcher"
|
||||
if incomplete_step.step_type == StepType.ANALYSIS:
|
||||
return "analyst"
|
||||
if incomplete_step.step_type == StepType.PROCESSING:
|
||||
return "coder"
|
||||
return "planner"
|
||||
@@ -54,13 +57,14 @@ def _build_base_graph():
|
||||
builder.add_node("reporter", reporter_node)
|
||||
builder.add_node("research_team", research_team_node)
|
||||
builder.add_node("researcher", researcher_node)
|
||||
builder.add_node("analyst", analyst_node)
|
||||
builder.add_node("coder", coder_node)
|
||||
builder.add_node("human_feedback", human_feedback_node)
|
||||
builder.add_edge("background_investigator", "planner")
|
||||
builder.add_conditional_edges(
|
||||
"research_team",
|
||||
continue_to_running_research_team,
|
||||
["planner", "researcher", "coder"],
|
||||
["planner", "researcher", "analyst", "coder"],
|
||||
)
|
||||
builder.add_edge("reporter", END)
|
||||
return builder
|
||||
|
||||
Reference in New Issue
Block a user