Setup
MemoryComponents
Bases: BaseModel
flowchart TD
src.tradingagents.graph.setup.MemoryComponents[MemoryComponents]
click src.tradingagents.graph.setup.MemoryComponents href "" "src.tradingagents.graph.setup.MemoryComponents"
Groups all memory components for the trading agents.
bull
bull: FinancialSituationMemory = Field(
..., title="Bull Memory", description="Memory store for the bull researcher agent"
)
bear
bear: FinancialSituationMemory = Field(
..., title="Bear Memory", description="Memory store for the bear researcher agent"
)
trader
trader: FinancialSituationMemory = Field(
..., title="Trader Memory", description="Memory store for the trader agent"
)
GraphSetup
Bases: BaseModel
flowchart TD
src.tradingagents.graph.setup.GraphSetup[GraphSetup]
click src.tradingagents.graph.setup.GraphSetup href "" "src.tradingagents.graph.setup.GraphSetup"
Handles the setup and configuration of the agent graph.
Methods:
| Name | Description |
|---|---|
validate_selected_analysts |
Validate analyst names and normalize duplicate selections. |
setup_graph |
Set up and compile the agent workflow graph. |
quick_thinking_llm
quick_thinking_llm: SkipValidation[ChatModel] = Field(
...,
title="Quick Thinking LLM",
description="LLM instance used for analyst and researcher nodes",
)
deep_thinking_llm
deep_thinking_llm: SkipValidation[ChatModel] = Field(
...,
title="Deep Thinking LLM",
description="LLM instance used for manager and judge nodes requiring deeper reasoning",
)
tool_nodes
tool_nodes: dict[str, ToolNode] = Field(
...,
title="Tool Nodes",
description="Mapping of analyst type to its corresponding LangGraph ToolNode",
)
memories
memories: MemoryComponents = Field(
..., title="Memory Components", description="All agent memory stores grouped together"
)
conditional_logic
conditional_logic: ConditionalLogic = Field(
default_factory=ConditionalLogic,
title="Conditional Logic",
description="Logic instance that determines graph edge routing",
)
validate_selected_analysts
Validate analyst names and normalize duplicate selections.
Source code in src/tradingagents/graph/setup.py
setup_graph
Set up and compile the agent workflow graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[str] | None
|
Analyst types to include. Defaults to all supported analysts when None. Options are: - "market": Market analyst - "social": Social media analyst - "news": News analyst - "fundamentals": Fundamentals analyst |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
CompiledStateGraph |
CompiledStateGraph
|
The compiled workflow graph. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no analysts are selected. |
Source code in src/tradingagents/graph/setup.py
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 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | |