quantnodes 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. QuantNodes/__init__.py +15 -0
  2. QuantNodes/__main__.py +14 -0
  3. QuantNodes/agent/__init__.py +158 -0
  4. QuantNodes/agent/agents/__init__.py +13 -0
  5. QuantNodes/agent/agents/definition.py +180 -0
  6. QuantNodes/agent/agents/manager.py +73 -0
  7. QuantNodes/agent/config/__init__.py +34 -0
  8. QuantNodes/agent/config/executor.py +958 -0
  9. QuantNodes/agent/config/loader.py +427 -0
  10. QuantNodes/agent/config/templates/bollinger_bands.yaml +84 -0
  11. QuantNodes/agent/config/templates/dual_ma.yaml +72 -0
  12. QuantNodes/agent/config/templates/empty.yaml +56 -0
  13. QuantNodes/agent/config/templates/mean_reversion.yaml +47 -0
  14. QuantNodes/agent/config/templates/mean_reversion_zscore.yaml +90 -0
  15. QuantNodes/agent/config/templates/momentum.yaml +81 -0
  16. QuantNodes/agent/config/templates/momentum_breakout.yaml +84 -0
  17. QuantNodes/agent/config/templates/rsi_strategy.yaml +72 -0
  18. QuantNodes/agent/config/templates/volume_price.yaml +86 -0
  19. QuantNodes/agent/config/types.py +156 -0
  20. QuantNodes/agent/config_mapper.py +293 -0
  21. QuantNodes/agent/core/__init__.py +19 -0
  22. QuantNodes/agent/core/dream.py +47 -0
  23. QuantNodes/agent/core/quant_dream.py +274 -0
  24. QuantNodes/agent/cron_jobs.py +314 -0
  25. QuantNodes/agent/nanobot_bridge.py +242 -0
  26. QuantNodes/agent/permission/__init__.py +30 -0
  27. QuantNodes/agent/permission/defaults.py +36 -0
  28. QuantNodes/agent/permission/evaluate.py +41 -0
  29. QuantNodes/agent/permission/models.py +59 -0
  30. QuantNodes/agent/permission/service.py +133 -0
  31. QuantNodes/agent/providers/__init__.py +11 -0
  32. QuantNodes/agent/providers/base.py +102 -0
  33. QuantNodes/agent/providers/quantnodes.py +610 -0
  34. QuantNodes/agent/providers/rate_limiter.py +326 -0
  35. QuantNodes/agent/providers/registry.py +163 -0
  36. QuantNodes/agent/skills/__init__.py +20 -0
  37. QuantNodes/agent/skills/base.py +118 -0
  38. QuantNodes/agent/skills/bridge.py +73 -0
  39. QuantNodes/agent/skills/factor/__init__.py +14 -0
  40. QuantNodes/agent/skills/factor/correlation.py +99 -0
  41. QuantNodes/agent/skills/factor/group_backtest.py +114 -0
  42. QuantNodes/agent/skills/factor/ic_analysis.py +106 -0
  43. QuantNodes/agent/skills/loader.py +107 -0
  44. QuantNodes/agent/skills/registry.py +105 -0
  45. QuantNodes/agent/skills/strategy/__init__.py +16 -0
  46. QuantNodes/agent/skills/strategy/bollinger.py +86 -0
  47. QuantNodes/agent/skills/strategy/dual_ma.py +82 -0
  48. QuantNodes/agent/skills/strategy/momentum.py +74 -0
  49. QuantNodes/agent/skills/strategy/rsi_reversal.py +99 -0
  50. QuantNodes/agent/skills_quant/__init__.py +14 -0
  51. QuantNodes/agent/skills_quant/backtest-analyze/SKILL.md +42 -0
  52. QuantNodes/agent/skills_quant/config-driven/SKILL.md +72 -0
  53. QuantNodes/agent/skills_quant/factor-research/SKILL.md +40 -0
  54. QuantNodes/agent/skills_quant/quant-dream/SKILL.md +55 -0
  55. QuantNodes/agent/skills_quant/risk-management/SKILL.md +45 -0
  56. QuantNodes/agent/skills_quant/strategy-design/SKILL.md +43 -0
  57. QuantNodes/agent/templates/__init__.py +4 -0
  58. QuantNodes/agent/tools/__init__.py +173 -0
  59. QuantNodes/agent/tools/_workspace.py +51 -0
  60. QuantNodes/agent/tools/alpha_backtest.py +328 -0
  61. QuantNodes/agent/tools/alpha_evaluate.py +493 -0
  62. QuantNodes/agent/tools/backtest.py +226 -0
  63. QuantNodes/agent/tools/base.py +133 -0
  64. QuantNodes/agent/tools/code_search.py +207 -0
  65. QuantNodes/agent/tools/config_backtest.py +401 -0
  66. QuantNodes/agent/tools/context.py +97 -0
  67. QuantNodes/agent/tools/dream_skill.py +77 -0
  68. QuantNodes/agent/tools/echo.py +38 -0
  69. QuantNodes/agent/tools/factor.py +231 -0
  70. QuantNodes/agent/tools/file_ops.py +201 -0
  71. QuantNodes/agent/tools/git_ops.py +190 -0
  72. QuantNodes/agent/tools/operator_lookup.py +218 -0
  73. QuantNodes/agent/tools/output_truncation.py +77 -0
  74. QuantNodes/agent/tools/path_check.py +43 -0
  75. QuantNodes/agent/tools/pipeline.py +62 -0
  76. QuantNodes/agent/tools/registry.py +150 -0
  77. QuantNodes/agent/tools/sandbox.py +62 -0
  78. QuantNodes/agent/tools/shell_safety.py +63 -0
  79. QuantNodes/agent/tools/strategy.py +106 -0
  80. QuantNodes/agent/tools/task.py +171 -0
  81. QuantNodes/agent/tools/web_fetch.py +142 -0
  82. QuantNodes/agent/tools/web_search.py +114 -0
  83. QuantNodes/agent/tools/wiki.py +370 -0
  84. QuantNodes/agent/utils/__init__.py +11 -0
  85. QuantNodes/agent/utils/helpers.py +43 -0
  86. QuantNodes/agent/utils/prompt_templates.py +30 -0
  87. QuantNodes/agent/workflows/__init__.py +20 -0
  88. QuantNodes/agent/workflows/implementations/__init__.py +8 -0
  89. QuantNodes/agent/workflows/implementations/alpha_gpt.py +508 -0
  90. QuantNodes/agent/workflows/implementations/mcts.py +442 -0
  91. QuantNodes/agent/workflows/parsers.py +44 -0
  92. QuantNodes/agent/workflows/registry.py +119 -0
  93. QuantNodes/agent/workflows/step_agent.py +219 -0
  94. QuantNodes/agent/workflows/tool.py +198 -0
  95. QuantNodes/ai/__init__.py +93 -0
  96. QuantNodes/ai/llm/__init__.py +75 -0
  97. QuantNodes/ai/llm/base.py +233 -0
  98. QuantNodes/ai/llm/decorators.py +281 -0
  99. QuantNodes/ai/llm/gateway.py +571 -0
  100. QuantNodes/ai/llm/null.py +76 -0
  101. QuantNodes/ai/llm/openai.py +435 -0
  102. QuantNodes/ai/optimizer.py +405 -0
  103. QuantNodes/ai/prompts/__init__.py +229 -0
  104. QuantNodes/ai/sandbox.py +371 -0
  105. QuantNodes/ai/sandbox_pandas_bridge.py +150 -0
  106. QuantNodes/ai/strategy_gen.py +396 -0
  107. QuantNodes/backtest/__init__.py +64 -0
  108. QuantNodes/backtest/backtest_node.py +188 -0
  109. QuantNodes/backtest/broker_node.py +378 -0
  110. QuantNodes/backtest/config_runner.py +397 -0
  111. QuantNodes/backtest/config_strategy.py +64 -0
  112. QuantNodes/backtest/risk_node.py +360 -0
  113. QuantNodes/backtest/strategy_node.py +268 -0
  114. QuantNodes/cache_node/__init__.py +19 -0
  115. QuantNodes/cache_node/base.py +244 -0
  116. QuantNodes/cache_node/cache_store.py +99 -0
  117. QuantNodes/cache_node/metadata.py +100 -0
  118. QuantNodes/cli/__init__.py +109 -0
  119. QuantNodes/cli/_helpers.py +511 -0
  120. QuantNodes/cli/command.py +110 -0
  121. QuantNodes/cli/commands/__init__.py +69 -0
  122. QuantNodes/cli/commands/agent.py +158 -0
  123. QuantNodes/cli/commands/alpha.py +951 -0
  124. QuantNodes/cli/commands/chat.py +38 -0
  125. QuantNodes/cli/commands/evolve.py +120 -0
  126. QuantNodes/cli/commands/factor.py +569 -0
  127. QuantNodes/cli/commands/init.py +190 -0
  128. QuantNodes/cli/commands/run.py +259 -0
  129. QuantNodes/cli/commands/serve.py +398 -0
  130. QuantNodes/cli/commands/version.py +120 -0
  131. QuantNodes/cli/enhanced.py +146 -0
  132. QuantNodes/conf_node/__init__.py +37 -0
  133. QuantNodes/conf_node/base.py +120 -0
  134. QuantNodes/conf_node/env_config.py +132 -0
  135. QuantNodes/conf_node/ini_config.py +70 -0
  136. QuantNodes/conf_node/json_config.py +69 -0
  137. QuantNodes/conf_node/yaml_config.py +78 -0
  138. QuantNodes/constants.py +17 -0
  139. QuantNodes/core/__init__.py +196 -0
  140. QuantNodes/core/_lookback_helpers.py +49 -0
  141. QuantNodes/core/ast_parser.py +198 -0
  142. QuantNodes/core/base.py +61 -0
  143. QuantNodes/core/cache_manager.py +344 -0
  144. QuantNodes/core/cache_utils.py +150 -0
  145. QuantNodes/core/cond_builder.py +53 -0
  146. QuantNodes/core/config.py +170 -0
  147. QuantNodes/core/constants.py +48 -0
  148. QuantNodes/core/control.py +412 -0
  149. QuantNodes/core/data_preprocessing.py +453 -0
  150. QuantNodes/core/data_source.py +46 -0
  151. QuantNodes/core/events.py +178 -0
  152. QuantNodes/core/evolution/__init__.py +22 -0
  153. QuantNodes/core/evolution/loop.py +583 -0
  154. QuantNodes/core/evolution/operators.py +289 -0
  155. QuantNodes/core/evolution/settings.py +44 -0
  156. QuantNodes/core/expression.py +841 -0
  157. QuantNodes/core/feedback/__init__.py +38 -0
  158. QuantNodes/core/feedback/channels.py +182 -0
  159. QuantNodes/core/feedback/collector.py +91 -0
  160. QuantNodes/core/feedback/dataclass.py +239 -0
  161. QuantNodes/core/feedback/llm_judge.py +138 -0
  162. QuantNodes/core/knowledge/__init__.py +69 -0
  163. QuantNodes/core/knowledge/knowledge_base.py +217 -0
  164. QuantNodes/core/knowledge/lineage_compress.py +196 -0
  165. QuantNodes/core/knowledge/lineage_expand.py +123 -0
  166. QuantNodes/core/knowledge/metrics/__init__.py +43 -0
  167. QuantNodes/core/knowledge/metrics/evaluator.py +176 -0
  168. QuantNodes/core/knowledge/metrics/metrics.py +220 -0
  169. QuantNodes/core/knowledge/rag_prompt.py +196 -0
  170. QuantNodes/core/knowledge/retriever.py +209 -0
  171. QuantNodes/core/lambda_node.py +81 -0
  172. QuantNodes/core/monitoring/__init__.py +22 -0
  173. QuantNodes/core/monitoring/collector.py +292 -0
  174. QuantNodes/core/monitoring/dashboard.py +365 -0
  175. QuantNodes/core/node.py +375 -0
  176. QuantNodes/core/pandas_utils.py +504 -0
  177. QuantNodes/core/parallel/__init__.py +15 -0
  178. QuantNodes/core/parallel/worker.py +140 -0
  179. QuantNodes/core/parallel/worker_process.py +265 -0
  180. QuantNodes/core/path_utils.py +73 -0
  181. QuantNodes/core/pipeline.py +328 -0
  182. QuantNodes/core/plugin.py +135 -0
  183. QuantNodes/core/quality_gate/__init__.py +32 -0
  184. QuantNodes/core/quality_gate/complexity.py +94 -0
  185. QuantNodes/core/quality_gate/consistency.py +26 -0
  186. QuantNodes/core/quality_gate/node.py +97 -0
  187. QuantNodes/core/quality_gate/redundancy.py +51 -0
  188. QuantNodes/core/quality_gate/settings.py +43 -0
  189. QuantNodes/core/quality_gate/zoo.py +98 -0
  190. QuantNodes/core/serializable.py +116 -0
  191. QuantNodes/core/serialization.py +673 -0
  192. QuantNodes/core/tools.py +333 -0
  193. QuantNodes/core/trajectory/__init__.py +25 -0
  194. QuantNodes/core/trajectory/entry.py +116 -0
  195. QuantNodes/core/trajectory/lineage.py +67 -0
  196. QuantNodes/core/trajectory/pool.py +211 -0
  197. QuantNodes/core/trajectory/selector.py +140 -0
  198. QuantNodes/core/visualization/__init__.py +33 -0
  199. QuantNodes/core/visualization/builder.py +233 -0
  200. QuantNodes/core/visualization/gate_breakdown.py +140 -0
  201. QuantNodes/core/visualization/lineage_dag.py +203 -0
  202. QuantNodes/core/visualization/metric_distribution.py +125 -0
  203. QuantNodes/core/visualization/report.py +68 -0
  204. QuantNodes/database_node/__init__.py +69 -0
  205. QuantNodes/database_node/base.py +135 -0
  206. QuantNodes/database_node/clickhouse_node.py +272 -0
  207. QuantNodes/database_node/csv_node.py +83 -0
  208. QuantNodes/database_node/duckdb_node.py +86 -0
  209. QuantNodes/database_node/factory.py +83 -0
  210. QuantNodes/database_node/mysql_node.py +100 -0
  211. QuantNodes/database_node/parquet_node.py +75 -0
  212. QuantNodes/database_node/sqlite_node.py +67 -0
  213. QuantNodes/factor_node/__init__.py +50 -0
  214. QuantNodes/factor_node/factor.py +563 -0
  215. QuantNodes/factor_node/factor_db.py +421 -0
  216. QuantNodes/factor_node/factor_functions/__init__.py +252 -0
  217. QuantNodes/factor_node/factor_functions/_helpers.py +358 -0
  218. QuantNodes/factor_node/factor_functions/_helpers_debug.py +317 -0
  219. QuantNodes/factor_node/factor_functions/composite_ops.py +136 -0
  220. QuantNodes/factor_node/factor_functions/math_ops.py +433 -0
  221. QuantNodes/factor_node/factor_functions/section_ops.py +290 -0
  222. QuantNodes/factor_node/factor_functions/talib_ops.py +1293 -0
  223. QuantNodes/factor_node/factor_functions/time_ops.py +535 -0
  224. QuantNodes/factor_node/factor_operation.py +1115 -0
  225. QuantNodes/factor_node/factor_table.py +1073 -0
  226. QuantNodes/factor_node/quant_nodes_object.py +60 -0
  227. QuantNodes/mcp_server/__init__.py +27 -0
  228. QuantNodes/mcp_server/__main__.py +4 -0
  229. QuantNodes/mcp_server/server.py +272 -0
  230. QuantNodes/methods/__init__.py +28 -0
  231. QuantNodes/methods/pipeline.py +100 -0
  232. QuantNodes/methods/sandbox.py +102 -0
  233. QuantNodes/monitor/__init__.py +27 -0
  234. QuantNodes/monitor/agent_tools/__init__.py +5 -0
  235. QuantNodes/monitor/agent_tools/monitor_tool.py +98 -0
  236. QuantNodes/monitor/agent_tools/schedule_tool.py +98 -0
  237. QuantNodes/monitor/agent_tools/version_tool.py +133 -0
  238. QuantNodes/monitor/monitor/__init__.py +6 -0
  239. QuantNodes/monitor/monitor/alerter.py +60 -0
  240. QuantNodes/monitor/monitor/collector.py +164 -0
  241. QuantNodes/monitor/monitor/dashboard.py +115 -0
  242. QuantNodes/monitor/monitor/drift.py +190 -0
  243. QuantNodes/monitor/scheduler/__init__.py +4 -0
  244. QuantNodes/monitor/scheduler/runner.py +133 -0
  245. QuantNodes/monitor/scheduler/scheduler.py +184 -0
  246. QuantNodes/monitor/storage/__init__.py +16 -0
  247. QuantNodes/monitor/storage/models.py +70 -0
  248. QuantNodes/monitor/storage/repository.py +407 -0
  249. QuantNodes/monitor/version/__init__.py +4 -0
  250. QuantNodes/monitor/version/diff.py +81 -0
  251. QuantNodes/monitor/version/version_manager.py +182 -0
  252. QuantNodes/operator_node/__init__.py +28 -0
  253. QuantNodes/operator_node/base.py +97 -0
  254. QuantNodes/operator_node/query_node.py +129 -0
  255. QuantNodes/operator_node/sql_builder.py +125 -0
  256. QuantNodes/operator_node/sql_utils.py +172 -0
  257. QuantNodes/operator_node/transform.py +130 -0
  258. QuantNodes/operators/__init__.py +90 -0
  259. QuantNodes/operators/_engine.py +108 -0
  260. QuantNodes/operators/composite.py +161 -0
  261. QuantNodes/operators/composite_dag.py +667 -0
  262. QuantNodes/operators/composite_dag_ops.py +343 -0
  263. QuantNodes/operators/composite_dag_pandas_ops.py +382 -0
  264. QuantNodes/operators/custom.py +408 -0
  265. QuantNodes/operators/facade.py +164 -0
  266. QuantNodes/operators/math.py +163 -0
  267. QuantNodes/operators/proxy.py +29 -0
  268. QuantNodes/operators/registry.py +144 -0
  269. QuantNodes/operators/section.py +99 -0
  270. QuantNodes/operators/talib.py +757 -0
  271. QuantNodes/operators/templates.py +95 -0
  272. QuantNodes/operators/time_series.py +136 -0
  273. QuantNodes/prompts/__init__.py +20 -0
  274. QuantNodes/prompts/backtest/__init__.py +12 -0
  275. QuantNodes/prompts/backtest/factor_based.py +86 -0
  276. QuantNodes/prompts/backtest/standard.py +73 -0
  277. QuantNodes/prompts/factor/__init__.py +14 -0
  278. QuantNodes/prompts/factor/correlation.py +77 -0
  279. QuantNodes/prompts/factor/group_backtest.py +86 -0
  280. QuantNodes/prompts/factor/ic_analysis.py +91 -0
  281. QuantNodes/prompts/strategy/__init__.py +18 -0
  282. QuantNodes/prompts/strategy/market_neutral.py +96 -0
  283. QuantNodes/prompts/strategy/mean_reversion.py +107 -0
  284. QuantNodes/prompts/strategy/momentum.py +160 -0
  285. QuantNodes/prompts/strategy/pairs_trading.py +107 -0
  286. QuantNodes/prompts/strategy/trend_following.py +96 -0
  287. QuantNodes/research/README.md +106 -0
  288. QuantNodes/research/__init__.py +154 -0
  289. QuantNodes/research/_legacy_3c/__init__.py +61 -0
  290. QuantNodes/research/_legacy_3c/auto_researcher.py +289 -0
  291. QuantNodes/research/_legacy_3c/factor_evaluator.py +560 -0
  292. QuantNodes/research/_legacy_3c/factor_miner.py +318 -0
  293. QuantNodes/research/_legacy_3c/mcts_search.py +324 -0
  294. QuantNodes/research/factor_test/__init__.py +25 -0
  295. QuantNodes/research/factor_test/config.py +184 -0
  296. QuantNodes/research/factor_test/config_builder.py +276 -0
  297. QuantNodes/research/factor_test/e2e/data_prep.py +163 -0
  298. QuantNodes/research/factor_test/e2e/run_evolution_e2e.py +309 -0
  299. QuantNodes/research/factor_test/evolution_adapter.py +231 -0
  300. QuantNodes/research/factor_test/feedback_wrapper.py +102 -0
  301. QuantNodes/research/factor_test/ifind_db/__init__.py +7 -0
  302. QuantNodes/research/factor_test/ifind_db/fetcher.py +224 -0
  303. QuantNodes/research/factor_test/ifind_db/ifind_database.py +689 -0
  304. QuantNodes/research/factor_test/nodes/__init__.py +1 -0
  305. QuantNodes/research/factor_test/nodes/_base.py +91 -0
  306. QuantNodes/research/factor_test/nodes/adjust_date_node.py +48 -0
  307. QuantNodes/research/factor_test/nodes/configs.py +240 -0
  308. QuantNodes/research/factor_test/nodes/factor_neutralize_node.py +87 -0
  309. QuantNodes/research/factor_test/nodes/factor_preprocess_node.py +222 -0
  310. QuantNodes/research/factor_test/nodes/factor_score_node.py +141 -0
  311. QuantNodes/research/factor_test/nodes/factor_test_report_node.py +153 -0
  312. QuantNodes/research/factor_test/nodes/group_analyzer_node.py +317 -0
  313. QuantNodes/research/factor_test/nodes/ic_analyzer_node.py +112 -0
  314. QuantNodes/research/factor_test/nodes/load_data_node.py +100 -0
  315. QuantNodes/research/factor_test/nodes/long_short_node.py +93 -0
  316. QuantNodes/research/factor_test/nodes/neutralizers.py +222 -0
  317. QuantNodes/research/factor_test/nodes/preprocess_strategies.py +277 -0
  318. QuantNodes/research/factor_test/nodes/risk_correlation_node.py +112 -0
  319. QuantNodes/research/factor_test/nodes/sample_pool_filter_node.py +110 -0
  320. QuantNodes/research/factor_test/nodes/tradability_filter_node.py +92 -0
  321. QuantNodes/research/factor_test/pipeline_runner.py +305 -0
  322. QuantNodes/research/factor_test/pipeline_spec.py +216 -0
  323. QuantNodes/research/factor_test/utils/__init__.py +26 -0
  324. QuantNodes/research/factor_test/utils/constants.py +86 -0
  325. QuantNodes/research/factor_test/utils/data_loader.py +141 -0
  326. QuantNodes/research/factor_test/utils/date_utils.py +232 -0
  327. QuantNodes/research/factor_test/utils/file_loaders.py +150 -0
  328. QuantNodes/research/factor_test/utils/labels.py +37 -0
  329. QuantNodes/research/factor_test/utils/metrics_extractor.py +55 -0
  330. QuantNodes/research/factor_test/utils/performance_metrics.py +175 -0
  331. QuantNodes/research/factor_test/utils/safe_load.py +106 -0
  332. QuantNodes/research/quant_alpha/CHANGELOG.md +80 -0
  333. QuantNodes/research/quant_alpha/README.md +142 -0
  334. QuantNodes/research/quant_alpha/__init__.py +45 -0
  335. QuantNodes/research/quant_alpha/adapters/__init__.py +99 -0
  336. QuantNodes/research/quant_alpha/adapters/calculator.py +503 -0
  337. QuantNodes/research/quant_alpha/adapters/expression.py +387 -0
  338. QuantNodes/research/quant_alpha/alpha101_design/__init__.py +50 -0
  339. QuantNodes/research/quant_alpha/alpha101_design/few_shot_examples.py +243 -0
  340. QuantNodes/research/quant_alpha/alpha101_design/philosophy.py +474 -0
  341. QuantNodes/research/quant_alpha/alpha158_design/__init__.py +63 -0
  342. QuantNodes/research/quant_alpha/alpha158_design/few_shot_examples.py +219 -0
  343. QuantNodes/research/quant_alpha/alpha158_design/philosophy.py +240 -0
  344. QuantNodes/research/quant_alpha/evaluation/__init__.py +47 -0
  345. QuantNodes/research/quant_alpha/evaluation/baselines/__init__.py +8 -0
  346. QuantNodes/research/quant_alpha/evaluation/baselines/g1_handcrafted.py +135 -0
  347. QuantNodes/research/quant_alpha/evaluation/baselines/g2_llm_only.py +269 -0
  348. QuantNodes/research/quant_alpha/evaluation/baselines/g3_alpha_gpt.py +152 -0
  349. QuantNodes/research/quant_alpha/evaluation/clickhouse_data_loader.py +227 -0
  350. QuantNodes/research/quant_alpha/evaluation/contracts.py +376 -0
  351. QuantNodes/research/quant_alpha/evaluation/evaluators/__init__.py +6 -0
  352. QuantNodes/research/quant_alpha/evaluation/evaluators/polars_evaluator.py +545 -0
  353. QuantNodes/research/quant_alpha/evaluation/mock_data_loader.py +226 -0
  354. QuantNodes/research/quant_alpha/evaluation/runner.py +243 -0
  355. QuantNodes/research/quant_alpha/llm/__init__.py +38 -0
  356. QuantNodes/research/quant_alpha/llm/parser.py +681 -0
  357. QuantNodes/research/quant_alpha/logic_driven_pipeline.py +411 -0
  358. QuantNodes/research/quant_alpha/logic_mining/__init__.py +74 -0
  359. QuantNodes/research/quant_alpha/logic_mining/compiler.py +457 -0
  360. QuantNodes/research/quant_alpha/logic_mining/generator.py +366 -0
  361. QuantNodes/research/quant_alpha/logic_mining/models.py +252 -0
  362. QuantNodes/research/quant_alpha/logic_mining/parser.py +287 -0
  363. QuantNodes/research/quant_alpha/logic_mining/pipelines.py +297 -0
  364. QuantNodes/research/quant_alpha/logic_mining/sources.py +149 -0
  365. QuantNodes/research/quant_alpha/mcts/__init__.py +66 -0
  366. QuantNodes/research/quant_alpha/mcts/cache.py +262 -0
  367. QuantNodes/research/quant_alpha/mcts/extension_ops.py +320 -0
  368. QuantNodes/research/quant_alpha/mcts/feedback.py +825 -0
  369. QuantNodes/research/quant_alpha/mcts/op_prior.py +180 -0
  370. QuantNodes/research/quant_alpha/mcts/search.py +540 -0
  371. QuantNodes/research/quant_alpha/mcts/tree.py +201 -0
  372. QuantNodes/research/quant_alpha/operator_vocab/__init__.py +50 -0
  373. QuantNodes/research/quant_alpha/operator_vocab/config.py +54 -0
  374. QuantNodes/research/quant_alpha/operator_vocab/metadata.py +263 -0
  375. QuantNodes/research/quant_alpha/operator_vocab/vocabulary.py +481 -0
  376. QuantNodes/research/quant_alpha/pipeline.py +1027 -0
  377. QuantNodes/research/quant_alpha/types/__init__.py +27 -0
  378. QuantNodes/research/quant_alpha/types/constants.py +28 -0
  379. QuantNodes/research/quant_alpha/types/state.py +205 -0
  380. QuantNodes/research/quant_alpha/workflow/__init__.py +32 -0
  381. QuantNodes/research/quant_alpha/workflow/alpha_gpt.py +911 -0
  382. QuantNodes/research/quant_alpha/workflow/alpha_logics.py +416 -0
  383. QuantNodes/research/quant_alpha/workflow/state.py +27 -0
  384. QuantNodes/research/report_reproducer.py +485 -0
  385. QuantNodes/research/wiki.py +1155 -0
  386. QuantNodes/symbolic/__init__.py +51 -0
  387. QuantNodes/symbolic/compiler.py +113 -0
  388. QuantNodes/symbolic/dialect.py +260 -0
  389. QuantNodes/symbolic/executor.py +147 -0
  390. QuantNodes/symbolic/expression.py +234 -0
  391. QuantNodes/symbolic/functions.py +433 -0
  392. QuantNodes/symbolic/optimizer.py +165 -0
  393. QuantNodes/ui_node/__init__.py +30 -0
  394. QuantNodes/ui_node/base.py +222 -0
  395. quantnodes-3.0.0.dist-info/METADATA +463 -0
  396. quantnodes-3.0.0.dist-info/RECORD +399 -0
  397. quantnodes-3.0.0.dist-info/WHEEL +5 -0
  398. quantnodes-3.0.0.dist-info/entry_points.txt +24 -0
  399. quantnodes-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,463 @@
1
+ Metadata-Version: 2.4
2
+ Name: quantnodes
3
+ Version: 3.0.0
4
+ Summary: AI-native quantitative research framework with symbolic computation and SQL pushdown
5
+ Author-email: sn0wfree <snowfreedom0815@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/sn0wfree/QuantNodes
8
+ Project-URL: Documentation, https://github.com/sn0wfree/QuantNodes/tree/master/docs
9
+ Project-URL: Repository, https://github.com/sn0wfree/QuantNodes.git
10
+ Project-URL: Issues, https://github.com/sn0wfree/QuantNodes/issues
11
+ Project-URL: Changelog, https://github.com/sn0wfree/QuantNodes/blob/master/CHANGELOG.md
12
+ Keywords: Node,Databases,Quantitative
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Financial and Insurance Industry
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: fastapi>=0.110.0
24
+ Requires-Dist: uvicorn[standard]>=0.29.0
25
+ Requires-Dist: websockets>=12.0
26
+ Requires-Dist: python-dotenv>=1.0.0
27
+ Requires-Dist: pandas>=2.1.0
28
+ Requires-Dist: numpy>=1.24.0
29
+ Requires-Dist: polars>=1.0.0
30
+ Requires-Dist: SQLAlchemy>=2.0.0
31
+ Requires-Dist: clickhouse-connect>=0.6.0
32
+ Requires-Dist: PyMySQL>=1.0.0
33
+ Requires-Dist: duckdb>=0.9.0
34
+ Requires-Dist: pydantic>=2.6.0
35
+ Requires-Dist: pydantic-settings>=2.0.0
36
+ Requires-Dist: statsmodels>=0.14.0
37
+ Requires-Dist: sympy>=1.12.0
38
+ Requires-Dist: openai>=1.3.0
39
+ Requires-Dist: plotly>=5.17.0
40
+ Requires-Dist: requests>=2.33.0
41
+ Requires-Dist: tqdm>=4.66.0
42
+ Requires-Dist: rich>=13.0.0
43
+ Requires-Dist: PyYAML>=6.0
44
+ Requires-Dist: progressbar2>=4.0.0
45
+ Requires-Dist: tables>=3.8.0
46
+ Requires-Dist: APScheduler>=3.10.0
47
+ Requires-Dist: llmwikify>=0.30.0
48
+ Requires-Dist: bs4>=0.0.1
49
+ Requires-Dist: msgpack>=1.0.0
50
+ Requires-Dist: scipy>=1.10.0
51
+ Requires-Dist: fastmcp>=2.0
52
+ Requires-Dist: pyarrow>=14.0.0
53
+ Provides-Extra: agent
54
+ Requires-Dist: nanobot-ai<0.3.0,>=0.2.1; extra == "agent"
55
+ Provides-Extra: mcp
56
+ Requires-Dist: fastmcp>=3.0; extra == "mcp"
57
+ Requires-Dist: mcp[cli]>=1.0; extra == "mcp"
58
+ Provides-Extra: all
59
+ Requires-Dist: quantnodes[agent,mcp]; extra == "all"
60
+ Provides-Extra: streamlit-ui
61
+ Requires-Dist: streamlit>=1.28.0; extra == "streamlit-ui"
62
+ Provides-Extra: dev
63
+ Requires-Dist: pytest>=7.0; extra == "dev"
64
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
65
+ Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
66
+ Requires-Dist: pytest-timeout>=2.0; extra == "dev"
67
+ Requires-Dist: hypothesis>=6.0; extra == "dev"
68
+ Requires-Dist: ruff>=0.4; extra == "dev"
69
+ Requires-Dist: mypy>=1.5; extra == "dev"
70
+
71
+ # QuantNodes
72
+
73
+ > 量化研究节点架构 - 基于 Pipeline 组合原语的统一量化分析平台
74
+
75
+ [![Python](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/)
76
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
77
+
78
+ ## 项目简介
79
+
80
+ QuantNodes 是一个面向量化研究的节点架构平台,通过统一的 **BaseNode + Pipeline** 模式,实现因子计算、回测分析、数据库查询的无缝集成。
81
+
82
+ ### 核心特性
83
+
84
+ - **统一节点架构**: 万物皆 Node,Pipeline 是唯一组合原语
85
+ - **317+ 内置算子**: 涵盖时间序列、截面运算、多截面聚合等,装饰器注册表模式
86
+ - **多数据库支持**: ClickHouse、DuckDB、MySQL、SQLite、CSV、Parquet
87
+ - **Config-Driven 回测**: YAML 配置文件驱动回测,支持算子扩展
88
+ - **可选 LLM Agent**(v3.0.0): 直接消费上游 [HKUDS/nanobot](https://github.com/HKUDS/nanobot) 0.2.1,作为 `[agent]` 可选依赖——装则获得 WebUI / WebSocket / cron / subagent / 多 channel,不装则纯量化库完全可用
89
+ - **MCP server**(可选): 把量化能力暴露为 MCP tools(stdio + HTTP)
90
+ - **方法库 + 提示词库**: 纯 Python 方法 + 内置策略提示词,亦可经 REST API 供外部 Agent 调用
91
+ - **自动化因子挖掘(v2.9.0, QuantAlpha)**: 5 智能体编排(idea-generator → formula-translator → evaluator → reflector → critic),基于 nanobot spawn + OperatorVocab 162 算子 + PolarsAlphaCalculator(AlphaGen 兼容 7 方法)。CLI `quantnodes alpha-gpt` + REST API 5 端点 + WebSocket 实时流 + Vue 3 前端可视化。详见 [`docs/quant_alpha/alpha_gpt_user_guide.md`](docs/quant_alpha/alpha_gpt_user_guide.md)
92
+ - **Table 4 复现 v2.10.0-mock.1(QuantAlpha Stage 1 mock)**: 论文 Table 4 端到端 mock 复现。3 baseline (G1 手工 / G2 LLM-Only / G3 Alpha-GPT) + 统一接口契约 + 端到端 mock pipeline。11 文件 + 8 测试(114 PASSED,97% 覆盖 evaluation/ 子包)。CLI `python3.11 scripts/reproduce_table4_mock.py --quick`。详见 [`docs/quant_alpha/table4_reproduction.md`](docs/quant_alpha/table4_reproduction.md) + [`docs/quant_alpha/stage2_data_requirements.md`](docs/quant_alpha/stage2_data_requirements.md)
93
+
94
+ ## 架构概览
95
+
96
+ ```
97
+ ┌─────────────────────────────────────────────────────────────┐
98
+ │ Layer 3: Meta-Programming AI │
99
+ │ StrategyGenerator │ PipelineOptimizer │ CodeSandbox │
100
+ ├─────────────────────────────────────────────────────────────┤
101
+ │ Layer 2: Pipeline 组合原语 │
102
+ │ Pipeline │ Parallel │ Join │ IfNode │ MapNode │ WhileNode │
103
+ ├─────────────────────────────────────────────────────────────┤
104
+ │ Layer 1: 处理节点 │
105
+ │ DatabaseNode │ FactorNode │ BacktestNode │ UINode │ ConfigNode │
106
+ └─────────────────────────────────────────────────────────────┘
107
+ ```
108
+
109
+ ## 目录结构
110
+
111
+ ```
112
+ QuantNodes/
113
+ ├── archive/ # 统一归档目录
114
+ │ ├── QuantNodes/ # QuantNodes 包归档(v2.x 旧代码)
115
+ │ │ └── test/ # 测试数据归档
116
+ │ ├── frontend/ # 前端归档
117
+ │ │ └── src/archive/ # 前端 Chat UI 归档
118
+ │ ├── api/ # API 归档
119
+ │ │ └── archive/ # API 归档
120
+ │ └── docs/ # 文档归档
121
+ │ └── archived/ # 历史文档
122
+ ├── QuantNodes/ # 主包
123
+ │ ├── agent/ # Agent 系统(v3.0.0: 上游 nanobot + 量化工具)
124
+ │ │ ├── nanobot_bridge.py # Nanobot.from_config 包装门面
125
+ │ │ ├── config_mapper.py # .env → nanobot_config.json
126
+ │ │ ├── tools/ # 14 个量化工具(继承 nanobot Tool)
127
+ │ │ ├── skills_quant/ # 6 个量化 SKILL.md
128
+ │ │ └── cron_jobs.py # 量化专属 cron 调度
129
+ │ ├── mcp_server/ # MCP server(9 个量化 tools)
130
+ │ ├── monitor/ # 监控 agent 工具(策略监控/调度/版本)
131
+ │ ├── methods/ # 方法库(外部 Agent API)
132
+ │ ├── prompts/ # 提示词库
133
+ │ ├── factor_node/ # 因子引擎(317+ 算子)
134
+ │ ├── core/ # 核心架构(BaseNode / Pipeline / 回测)
135
+ │ ├── database_node/ # 数据库节点(ClickHouse/DuckDB/MySQL/SQLite/CSV/Parquet)
136
+ │ └── ...
137
+ ├── api/ # FastAPI 服务器
138
+ │ ├── routers/ # API 路由
139
+ │ └── services/ # 服务层(含 nanobot_runtime.py 单进程包装器)
140
+ ├── frontend/src/ # Vue 3 + Ant Design 前端
141
+ │ └── views/
142
+ ├── tests/ # 测试套件(5163+ 非 agent / 574 agent)
143
+ ├── examples/ # 示例代码
144
+ ├── docs/ # 设计文档
145
+ ├── .agent/ # nanobot workspace(gitignore,含 API key)
146
+ ├── output/ # factor_test pipeline 节点产物 (运行时)
147
+ └── outputs/ # 回测引擎结果 (运行时)
148
+ ```
149
+
150
+ ## 快速开始
151
+
152
+ ### 安装
153
+
154
+ ```bash
155
+ pip install -e .
156
+ ```
157
+
158
+ 可选附加组件:
159
+
160
+ ```bash
161
+ pip install -e '.[agent]' # LLM Agent(上游 nanobot)/ WebUI / 多 channel
162
+ pip install -e '.[mcp]' # MCP server(把量化能力暴露为 MCP tools)
163
+ pip install -e '.[all]' # agent + mcp 一键装齐
164
+ pip install -e '.[streamlit-ui]' # 启用 Streamlit Agent 调试 UI
165
+ ```
166
+
167
+ ### 初始化项目
168
+
169
+ ```bash
170
+ # 初始化配置文件(创建 .env 和 conn.ini)
171
+ quantnodes init
172
+ # 或使用 Python 模块方式
173
+ python -m QuantNodes init
174
+ ```
175
+
176
+ ### 启动服务
177
+
178
+ ```bash
179
+ # ── v3.0.0 推荐方式(lifecycle 接口)──
180
+ quantnodes serve # 前台启动,Ctrl+C 停止
181
+ quantnodes serve --check-env # 启动前校验 API key
182
+ quantnodes serve --gateway-port 18090 # 自定义 nanobot gateway 端口
183
+ quantnodes serve --frontend # 同时启动 Vite dev server
184
+ quantnodes serve --daemon # 后台运行,写 .quantnodes.pid
185
+ quantnodes stop # 停止后台 serve
186
+ quantnodes status # 综合健康检查
187
+ quantnodes logs -f # 实时查看日志
188
+
189
+ # ── 旧接口(兼容保留)──
190
+ quantnodes run
191
+ quantnodes run --host 0.0.0.0 --port 19380 --gateway-port 18090 --daemon
192
+ quantnodes run --api-only
193
+ quantnodes run --frontend-only
194
+ ```
195
+
196
+ 详细使用文档:[`docs/16-quantnodes-cli使用指南.md`](docs/16-quantnodes-cli使用指南.md)
197
+
198
+ ### 外部 Agent API
199
+
200
+ QuantNodes 通过 REST API 为外部 Agent 提供方法调用和提示词。
201
+
202
+ v3.0.0 新增内置 agent 端点(需 `[agent]` extra,否则返回 503):
203
+
204
+ ```bash
205
+ # 查询 agent 状态
206
+ curl http://localhost:8000/api/agent/status
207
+
208
+ # 发送 chat 消息
209
+ curl -X POST http://localhost:8000/api/agent/chat/send \
210
+ -H "Content-Type: application/json" \
211
+ -d '{"message": "分析最近的动量因子表现"}'
212
+ ```
213
+
214
+ #### 获取策略提示词
215
+
216
+ ```bash
217
+ curl -X GET "http://localhost:8000/api/prompts/strategy/momentum" \
218
+ -H "X-API-Key: qn_live_xxxxxxxxxxxxxxxxxxxxxxxx"
219
+ ```
220
+
221
+ #### 验证代码安全
222
+
223
+ ```bash
224
+ curl -X POST "http://localhost:8000/api/code/validate" \
225
+ -H "X-API-Key: qn_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
226
+ -H "Content-Type: application/json" \
227
+ -d '{"code": "import pandas as pd\\nprint(pd.DataFrame())"}'
228
+ ```
229
+
230
+ #### 运行回测
231
+
232
+ ```bash
233
+ curl -X POST "http://localhost:8000/api/backtest/run" \
234
+ -H "X-API-Key: qn_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
235
+ -H "Content-Type: application/json" \
236
+ -d '{"pipeline_code": "...", "start_date": "2020-01-01", "end_date": "2024-12-31"}'
237
+ ```
238
+
239
+ ### 基本使用
240
+
241
+ ```python
242
+ from QuantNodes.core.node import BaseNode, Pipeline
243
+ from QuantNodes.factor_node.factor_functions import get_operator, list_operators
244
+
245
+ # 列出所有算子
246
+ print(list_operators()) # ['abs', 'add', 'aggr_count', ...]
247
+
248
+ # 获取算子
249
+ rolling_mean = get_operator('rolling_mean', 'time')
250
+
251
+ # 构建 Pipeline
252
+ pipeline = Pipeline(
253
+ source_node,
254
+ transform_node,
255
+ output_node
256
+ )
257
+
258
+ # 执行
259
+ result = pipeline.execute()
260
+ ```
261
+
262
+ ### 因子计算示例
263
+
264
+ ```python
265
+ from QuantNodes.factor_node.factor_functions import rolling_mean, rolling_std, zscore
266
+
267
+ # 滚动均值
268
+ result = rolling_mean(factor_data, window=20)
269
+
270
+ # 滚动标准差
271
+ std = rolling_std(factor_data, window=20)
272
+
273
+ # Z-Score 标准化
274
+ zscore = zscore(factor_data)
275
+ ```
276
+
277
+ ## 算子注册表 API
278
+
279
+ ```python
280
+ from QuantNodes.factor_node.factor_functions import (
281
+ list_operators, # 列出所有算子
282
+ get_operator, # 获取算子函数
283
+ operator_info, # 获取算子元信息
284
+ generate_documentation, # 生成文档
285
+ )
286
+
287
+ # 按类别列出算子
288
+ point_ops = list_operators('point') # 单点运算
289
+ time_ops = list_operators('time') # 时间序列运算
290
+ section_ops = list_operators('section') # 截面运算
291
+ multi_ops = list_operators('multi_section') # 多截面运算
292
+
293
+ # 获取算子详情
294
+ info = operator_info('rolling_mean', 'time')
295
+ print(info)
296
+ # {'name': 'rolling_mean', 'category': 'time', 'doc': '...', 'parameters': [...]}
297
+
298
+ # 生成 Markdown 文档
299
+ docs = generate_documentation('markdown')
300
+ ```
301
+
302
+ ## 算子分类
303
+
304
+ | 类别 | 数量 | 示例 |
305
+ |------|------|------|
306
+ | **Point (单点)** | 46 | `abs`, `log`, `sign`, `isnull` |
307
+ | **Time (时间序列)** | 65 | `rolling_mean`, `rolling_std`, `ewm`, `diff` |
308
+ | **Section (截面)** | 17 | `standardizeZScore`, `winsorize`, `fillNaNByVal` |
309
+ | **Multi-Section (多截面)** | 15 | `aggregate`, `disaggregate`, `aggr_sum` |
310
+ | **TA-Lib** | 174 | `talib_rsi`, `talib_sma`, `talib_macd_line` |
311
+ | **Custom (用户自定义)** | ∞ | `@CustomOperator.point()`, Builder API |
312
+
313
+ ## 自定义算子 API
314
+
315
+ ```python
316
+ from QuantNodes.operators import CustomOperator
317
+
318
+ # 装饰器风格(直接注册)
319
+ @CustomOperator.point("my_double")
320
+ def my_double(f, multiplier=2.0):
321
+ return f * multiplier
322
+
323
+ # Builder 链式风格
324
+ my_ewm_30 = (CustomOperator.time("my_ewm_30")
325
+ .param("span", int, 30, "窗口大小")
326
+ .execute(lambda s, span: s.ewm_mean(span=span))
327
+ .register())
328
+
329
+ # 模板工厂(基于内置算子创建)
330
+ from QuantNodes.operators import CustomOperator
331
+ my_ewm_30 = CustomOperator.time_from("my_ewm_30", "ewm_mean", span=30)
332
+
333
+ # 级联查询:自定义算子优先,内置算子 fallback
334
+ from QuantNodes.factor_node.factor_functions import get_operator
335
+ op = get_operator("my_double") # 先查自定义,再查内置
336
+ ```
337
+
338
+ ## 测试
339
+
340
+ > 要求 Python 3.11+。全量测试需先装系统级/可选依赖:`pip install ta-lib tables plotly`(`ta-lib` 需先装 TA-Lib C 库)。缺失时相关测试会优雅降级或跳过。基线:非 agent `5163 passed / 21 skipped / 0 failed`,`tests/agent` `574 passed / 13 skipped`。详见 [可选依赖安装指南](docs/15-可选依赖安装指南.md)。
341
+
342
+ ```bash
343
+ # 运行所有测试
344
+ pytest tests/ -v
345
+
346
+ # 运行特定测试
347
+ pytest tests/test_factor_functions.py -v
348
+ pytest tests/test_backtest_tool.py -v
349
+
350
+ # 查看覆盖率
351
+ pytest tests/ --cov=QuantNodes --cov-report=html
352
+ ```
353
+
354
+ ## 设计文档
355
+
356
+ - [架构设计](docs/04-架构设计.md)
357
+ - [执行清单](docs/07-执行清单.md)
358
+ - [算子系统设计与规范](docs/22-算子系统设计与规范.md)
359
+ - [核心功能框架设计](docs/24-核心功能框架设计.md)
360
+ - [大型项目开发测试规范](docs/大型项目开发测试规范.md)
361
+ - [操作手册](docs/QuantNodes-操作手册.md)
362
+ - [Feature 3A - WikiFactorProxy](docs/Feature3A-实施计划.md)
363
+ - [Feature 3B - 研报复现](docs/Feature3B-实施计划.md)
364
+ - [Feature 3C - AutoResearch 自动因子挖掘](docs/Feature3C-实施计划.md)
365
+ - [Feature 3D - 用户友好自定义算子 API](docs/Feature3D-用户友好自定义算子API设计.md)
366
+ - [v2.6.0 实际架构基线](docs/Architecture-v2.6.md)
367
+ - [单因子回测节点化整合设计](docs/SingleFactorBacktest-Integration-Design.md)
368
+ - [演化框架设计 (FactorFeedback + TrajectoryPool + QualityGate)](docs/Evolution-Framework.md)
369
+ - [FactorFeedback 详细规格](docs/FactorFeedback.md)
370
+ - [TrajectoryPool 详细规格](docs/TrajectoryPool.md)
371
+ - [QualityGate 详细规格](docs/QualityGate.md)
372
+
373
+ ## 变更日志
374
+
375
+ > 完整变更记录见 [CHANGELOG.md](CHANGELOG.md)。下面仅列里程碑版本。
376
+
377
+ ### v3.0.0 (2026-06-23)
378
+
379
+ - ✅ **上游 nanobot 迁移**: Agent 核心从自写 runtime 改为直接消费 [HKUDS/nanobot](https://github.com/HKUDS/nanobot) 0.2.1(`Nanobot.from_config()` 门面)
380
+ - ✅ **nanobot-ai 改为可选依赖**: `pip install 'quantnodes[agent]'`;纯量化库可独立使用
381
+ - ✅ **单进程架构**: FastAPI uvicorn + nanobot gateway 共存于同一进程(`api/services/nanobot_runtime.py`)
382
+ - ✅ **Phase 5 功能**: subagent 多 Agent 团队 / MCP server(9 tools)/ 单进程 WebUI / WebSocket + 飞书 channel / 量化专属 cron 调度
383
+ - ✅ **workspace 迁移**: `.quant_agent/` → `.agent/`(HKUDS nanobot 约定,附迁移脚本)
384
+ - ⚙️ **Python 3.11+**(上游最低要求);**pandas 3.0 兼容**(`applymap`→`.map` 等)
385
+ - ✅ **测试稳定化**: 非 agent `5163 passed / 21 skipped / 0 failed`、`tests/agent` `574 passed / 13 skipped`(顺序 + 并行均通过);可选依赖优雅降级
386
+ - 💥 **Breaking**: 删除自写 `agent/core/{loop,runner,memory,...}`,改用 `Agent.run()` / `Nanobot.from_config()` facade
387
+
388
+ ### v2.6.0 (2026-05-14)
389
+
390
+ - ✅ **架构重构**: 从"带 UI 的 Agent 系统"转向"外部 Agent 方法库 + 提示词库"
391
+ - ✅ **移除 Chat UI**: 前端不再有交互式 Chat
392
+ - ✅ **移除 Agent LLM**: QuantNodes 不再包含 LLM
393
+ - ✅ **新增 methods/**: 纯方法实现,外部 Agent 可通过 API 调用
394
+ - ✅ **新增 prompts/**: 完整策略提示词库,含参考代码
395
+ - ✅ **API 重构**: 新增 prompts、code 路由,移除 chat 路由
396
+ - ✅ **API Key 认证**: 支持 X-API-Key 和 Authorization Bearer 认证
397
+ - ✅ **前端展示页面**: Dashboard、Portfolios、Status 视图
398
+
399
+ ### v2.5.0 (2026-05-10)
400
+
401
+ - ✅ Agent 智能体系统:15 个内置工具,支持文件操作、代码搜索、Git、Web 搜索等
402
+ - ✅ 新增 `web_fetch` 工具:网页抓取,支持 text/html 格式
403
+ - ✅ 新增 `web_search` 工具:DuckDuckGo 网络搜索
404
+ - ✅ 新增 `task` 工具:任务管理(创建/更新/列表),JSON 持久化
405
+ - ✅ 新增 `quantnodes chat` 命令:Rich Agent 交互终端
406
+ - ✅ CLI 重构为包结构(`cli/`)
407
+ - ✅ 修复 `compile_expression` 方言 import Bug
408
+ - ✅ 修复 Agent `api_base` URL 双重拼接 Bug
409
+ - ✅ 修复 `should_execute_tools` 逻辑 Bug
410
+ - ✅ 2698+ 测试用例
411
+
412
+ ### v2.4.1 (2026-05-09)
413
+
414
+ - ✅ CLI 优化:依赖安装自动化(Python 依赖通过 pyproject.toml,前端依赖首次 import 时自动安装)
415
+ - ✅ CLI 优化:init 流程简化(只初始化 Wiki 和创建配置文件)
416
+ - ✅ llmwikify Wiki 集成:初始化时自动创建 raw/, wiki/, wiki.md, index.md, log.md
417
+ - ✅ 目录结构优化:Wiki 放在项目根目录,与 data/ 平级
418
+
419
+ ### v2.4.0 (2026-05-08)
420
+
421
+ - ✅ Feature 3A - WikiFactorProxy:因子库读写接口,支持 llmwikify 解析 PDF
422
+ - ✅ Feature 3B - 研报复现:从研报提取因子公式,验证有效性,存入 Wiki 因子库
423
+ - ✅ Feature 3C - AutoResearch 自动因子挖掘:模板枚举 + MCTS 搜索自动生成验证因子
424
+ - ✅ Feature 3D - 用户友好自定义算子 API:装饰器风格 + Builder 链式 + 模板工厂 + 级联查询
425
+ - ✅ 317+ 内置算子(point: 46, time: 65, section: 17, multi_section: 15, talib: 174)
426
+ - ✅ 2574+ 测试用例,覆盖率 ~80%
427
+ - ✅ 统一前端到 Vue 3 + Ant Design Vue 4.x
428
+
429
+ ### v2.3.0 (2026-04-30)
430
+
431
+ - ✅ 实现 config-driven 回测的算子扩展机制(通用 fallback + custom_operators 加载)
432
+ - ✅ 迁移 6 个独有算子到 factor_functions(mad, weighted_aggr_mean, fill_null_by_strategy 等)
433
+ - ✅ 删除 factor_nodes.py,统一算子系统(-1274 行)
434
+ - ✅ ts_corr 协方差公式修复 + group_winsorize 实现
435
+ - ✅ 算子构建规范文档
436
+
437
+ ### v2.2.0 (2026-04-28)
438
+
439
+ - ✅ 实现 DataPreprocessingFun 类,完全移除 QuantStudio 依赖
440
+ - ✅ 统一 PointOperation/TimeOperation 空数据处理
441
+ - ✅ 添加参数边界验证 (winsorize, half_life)
442
+ - ✅ 改进 rolling_regress 错误处理
443
+ - ✅ 修复 rolling_change_rate 除法顺序问题
444
+ - ✅ 添加 pandas_utils 工具模块
445
+ - ✅ 添加 Vue 3 前端应用骨架 (后统一为 Vue)
446
+
447
+ ### v2.1.0 (2026-04-27)
448
+
449
+ - ✅ 完成 9/9 阶段重构
450
+ - ✅ 97+ 因子算子实现
451
+ - ✅ 完整测试套件
452
+ - ✅ 多数据库支持
453
+
454
+ ## 致谢
455
+
456
+ - [HKUDS/nanobot](https://github.com/HKUDS/nanobot) — Agent 核心运行时(v3.0.0 直接消费上游 0.2.1)
457
+ - [QuantaAlpha](https://arxiv.org/abs/2602.07085) — 演化实验框架设计(CoSTEER 反馈 / TrajectoryPool / QualityGate)
458
+ - [QuantStudio](https://github.com/quantopian/quantstudio) — 因子计算系统设计灵感
459
+ - [TA-Lib](https://ta-lib.org/) — 174 个技术指标算子(C 库 + Python wrapper)
460
+
461
+ ## 许可证
462
+
463
+ MIT License