Deep research
Classes:
Name | Description |
---|---|
DeepResearchAgent |
Deep Research Agent: PLAN → RESEARCH → SYNTHESIZE → CRITIQUE loop. |
Attributes:
Name | Type | Description |
---|---|---|
StateT |
|
Attributes¶
Classes¶
DeepResearchAgent
¶
Deep Research Agent: PLAN → RESEARCH → SYNTHESIZE → CRITIQUE loop.
This agent mirrors modern deep-research patterns inspired by DeerFlow and Tongyi DeepResearch: plan tasks, use tools to research, synthesize findings, critique gaps and iterate a bounded number of times.
Nodes: - PLAN: Decompose problem, propose search/tool actions; may include tool calls - RESEARCH: ToolNode executes search/browse/calc/etc tools - SYNTHESIZE: Aggregate and draft a coherent report or partial answer - CRITIQUE: Identify gaps, contradictions, or follow-ups; can request more tools
Routing:
- PLAN -> conditional(_route_after_plan):
{"RESEARCH": RESEARCH, "SYNTHESIZE": SYNTHESIZE, END: END}
- RESEARCH -> SYNTHESIZE
- SYNTHESIZE -> CRITIQUE
- CRITIQUE -> conditional(_route_after_critique): {"RESEARCH": RESEARCH, END: END}
Iteration Control: - Uses execution_meta.internal_data keys: dr_max_iters (int): maximum critique→research loops (default 2) dr_iters (int): current loop count (auto-updated) dr_heavy_mode (bool): if True, bias towards one more loop when critique suggests
Methods:
Name | Description |
---|---|
__init__ |
|
compile |
|
Source code in pyagenity/prebuilt/agent/deep_research.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
|
Functions¶
__init__
¶
__init__(state=None, context_manager=None, publisher=None, id_generator=DefaultIDGenerator(), container=None, max_iters=2, heavy_mode=False)
Source code in pyagenity/prebuilt/agent/deep_research.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
compile
¶
compile(plan_node, research_tool_node, synthesize_node, critique_node, checkpointer=None, store=None, interrupt_before=None, interrupt_after=None, callback_manager=CallbackManager())
Source code in pyagenity/prebuilt/agent/deep_research.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
|