cnhkmcp 2.1.9__py3-none-any.whl → 2.3.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 (142) hide show
  1. cnhkmcp/__init__.py +1 -1
  2. cnhkmcp/untracked/AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221/BRAIN_AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221Mac_Linux/321/207/320/231/320/230/321/206/320/254/320/274.zip +0 -0
  3. cnhkmcp/untracked/AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221//321/205/320/237/320/234/321/205/320/227/342/225/227/321/205/320/276/320/231/321/210/320/263/320/225AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221_Windows/321/207/320/231/320/230/321/206/320/254/320/274.exe +0 -0
  4. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/README.md +1 -1
  5. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/config.json +2 -2
  6. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/main.py +1 -1
  7. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/chroma.sqlite3 +0 -0
  8. cnhkmcp/untracked/APP/Tranformer/Transformer.py +2 -2
  9. cnhkmcp/untracked/APP/Tranformer/transformer_config.json +1 -1
  10. cnhkmcp/untracked/APP/blueprints/feature_engineering.py +2 -2
  11. cnhkmcp/untracked/APP/blueprints/inspiration_house.py +4 -4
  12. cnhkmcp/untracked/APP/blueprints/paper_analysis.py +3 -3
  13. cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md +34 -73
  14. cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py +2 -2
  15. cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md +366 -1
  16. cnhkmcp/untracked/APP/static/inspiration.js +345 -13
  17. cnhkmcp/untracked/APP/templates/index.html +11 -3
  18. cnhkmcp/untracked/APP/templates/transformer_web.html +1 -1
  19. cnhkmcp/untracked/APP/trailSomeAlphas/README.md +38 -0
  20. cnhkmcp/untracked/APP/trailSomeAlphas/ace.log +66 -0
  21. cnhkmcp/untracked/APP/trailSomeAlphas/enhance_template.py +588 -0
  22. cnhkmcp/untracked/APP/trailSomeAlphas/requirements.txt +3 -0
  23. cnhkmcp/untracked/APP/trailSomeAlphas/run_pipeline.py +1001 -0
  24. cnhkmcp/untracked/APP/trailSomeAlphas/run_pipeline_step_by_step.ipynb +5258 -0
  25. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/OUTPUT_TEMPLATE.md +325 -0
  26. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/SKILL.md +503 -0
  27. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/examples.md +244 -0
  28. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/output_report/ASI_delay1_analyst11_ideas.md +285 -0
  29. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/reference.md +399 -0
  30. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/SKILL.md +40 -0
  31. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/config.json +6 -0
  32. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709385783386000.json +388 -0
  33. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709386274840400.json +131 -0
  34. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709386838244700.json +1926 -0
  35. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709387369198500.json +31 -0
  36. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709387908905800.json +1926 -0
  37. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709388486243600.json +240 -0
  38. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709389024058600.json +1926 -0
  39. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709389549608700.json +41 -0
  40. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709390068714000.json +110 -0
  41. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709390591996900.json +36 -0
  42. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709391129137100.json +31 -0
  43. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709391691643500.json +41 -0
  44. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709392192099200.json +31 -0
  45. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709392703423500.json +46 -0
  46. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709393213729400.json +246 -0
  47. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710186683932500.json +388 -0
  48. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710187165414300.json +131 -0
  49. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710187665211700.json +1926 -0
  50. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710188149193400.json +31 -0
  51. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710188667627400.json +1926 -0
  52. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710189220822000.json +240 -0
  53. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710189726189500.json +1926 -0
  54. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710190248066100.json +41 -0
  55. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710190768298700.json +110 -0
  56. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710191282588100.json +36 -0
  57. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710191838960900.json +31 -0
  58. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710192396688000.json +41 -0
  59. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710192941922400.json +31 -0
  60. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710193473524600.json +46 -0
  61. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710194001961200.json +246 -0
  62. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710420975888800.json +46 -0
  63. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710421647590100.json +196 -0
  64. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710422131378500.json +5 -0
  65. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710422644184400.json +196 -0
  66. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710423702350600.json +196 -0
  67. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710424244661800.json +5 -0
  68. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_delay1.csv +211 -0
  69. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/final_expressions.json +7062 -0
  70. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/ace.log +3 -0
  71. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/ace_lib.py +1514 -0
  72. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/fetch_dataset.py +113 -0
  73. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/helpful_functions.py +180 -0
  74. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/implement_idea.py +236 -0
  75. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/merge_expression_list.py +90 -0
  76. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/parsetab.py +60 -0
  77. cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance/op/321/206/320/220/342/225/227/321/207/342/225/227/320/243.md +434 -0
  78. cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance/sample_prompt.md +62 -0
  79. cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance//321/205/320/235/320/245/321/205/320/253/320/260/321/205/320/275/320/240/321/206/320/220/320/255/321/210/320/220/320/223/321/211/320/220/342/225/227/321/210/342/225/233/320/241/321/211/320/243/342/225/233.md +354 -0
  80. cnhkmcp/untracked/APP/usage.md +2 -2
  81. cnhkmcp/untracked/APP//321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +388 -8
  82. cnhkmcp/untracked/skills/alpha-expression-verifier/scripts/validator.py +889 -0
  83. cnhkmcp/untracked/skills/brain-data-feature-engineering/OUTPUT_TEMPLATE.md +325 -0
  84. cnhkmcp/untracked/skills/brain-data-feature-engineering/SKILL.md +263 -0
  85. cnhkmcp/untracked/skills/brain-data-feature-engineering/examples.md +244 -0
  86. cnhkmcp/untracked/skills/brain-data-feature-engineering/reference.md +493 -0
  87. cnhkmcp/untracked/skills/brain-feature-implementation/SKILL.md +87 -0
  88. cnhkmcp/untracked/skills/brain-feature-implementation/config.json +6 -0
  89. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/analyst15_GLB_delay1.csv +289 -0
  90. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/final_expressions.json +410 -0
  91. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588244.json +4 -0
  92. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588251.json +20 -0
  93. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588273.json +23 -0
  94. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588293.json +23 -0
  95. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588319.json +23 -0
  96. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588322.json +14 -0
  97. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588325.json +20 -0
  98. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588328.json +23 -0
  99. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588354.json +23 -0
  100. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588357.json +23 -0
  101. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588361.json +23 -0
  102. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588364.json +23 -0
  103. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588368.json +23 -0
  104. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588391.json +14 -0
  105. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588394.json +23 -0
  106. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588397.json +59 -0
  107. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588400.json +35 -0
  108. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588403.json +20 -0
  109. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588428.json +23 -0
  110. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588431.json +32 -0
  111. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588434.json +20 -0
  112. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588438.json +20 -0
  113. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588441.json +14 -0
  114. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588468.json +20 -0
  115. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/ace_lib.py +1514 -0
  116. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/fetch_dataset.py +107 -0
  117. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/helpful_functions.py +180 -0
  118. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/implement_idea.py +165 -0
  119. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/merge_expression_list.py +88 -0
  120. cnhkmcp/untracked/skills/brain-improve-alpha-performance/arXiv_API_Tool_Manual.md +490 -0
  121. cnhkmcp/untracked/skills/brain-improve-alpha-performance/reference.md +1 -1
  122. cnhkmcp/untracked/skills/brain-improve-alpha-performance/scripts/arxiv_api.py +229 -0
  123. cnhkmcp/untracked/skills/planning-with-files/SKILL.md +211 -0
  124. cnhkmcp/untracked/skills/planning-with-files/examples.md +202 -0
  125. cnhkmcp/untracked/skills/planning-with-files/reference.md +218 -0
  126. cnhkmcp/untracked/skills/planning-with-files/scripts/check-complete.sh +44 -0
  127. cnhkmcp/untracked/skills/planning-with-files/scripts/init-session.sh +120 -0
  128. cnhkmcp/untracked/skills/planning-with-files/templates/findings.md +95 -0
  129. cnhkmcp/untracked/skills/planning-with-files/templates/progress.md +114 -0
  130. cnhkmcp/untracked/skills/planning-with-files/templates/task_plan.md +132 -0
  131. cnhkmcp/untracked//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +35 -11
  132. cnhkmcp/vector_db/_manifest.json +1 -0
  133. cnhkmcp/vector_db/_meta.json +1 -0
  134. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/METADATA +1 -1
  135. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/RECORD +142 -31
  136. /cnhkmcp/untracked/{skills/expression_verifier → APP/trailSomeAlphas/skills/brain-feature-implementation}/scripts/validator.py +0 -0
  137. /cnhkmcp/untracked/skills/{expression_verifier → alpha-expression-verifier}/SKILL.md +0 -0
  138. /cnhkmcp/untracked/skills/{expression_verifier → alpha-expression-verifier}/scripts/verify_expr.py +0 -0
  139. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/WHEEL +0 -0
  140. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/entry_points.txt +0 -0
  141. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/licenses/LICENSE +0 -0
  142. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/top_level.txt +0 -0
cnhkmcp/__init__.py CHANGED
@@ -50,7 +50,7 @@ from .untracked.forum_functions import (
50
50
  read_full_forum_post
51
51
  )
52
52
 
53
- __version__ = "2.1.9"
53
+ __version__ = "2.3.0"
54
54
  __author__ = "CNHK"
55
55
  __email__ = "cnhk@example.com"
56
56
 
@@ -20,7 +20,7 @@
20
20
  {
21
21
  "api_key": "你的API_KEY",
22
22
  "base_url": "https://api.moonshot.cn/v1",
23
- "model": "kimi-k2-turbo-preview"
23
+ "model": "kimi-k2.5"
24
24
  }
25
25
  ```
26
26
  *注意*: 如果使用的模型不支持直接图片输入(Vision),API 可能会报错。如果遇到这种情况,请尝试更换支持 Vision 的模型,或者仅使用文本功能。
@@ -1,6 +1,6 @@
1
1
  {
2
- "api_key": "sk-xxxxxxx",
2
+ "api_key": "sk-2HTwP1V2bTjq32DPcEPEUGKTnLilf29FmhHipZL78ogGIeLc",
3
3
  "base_url": "https://api.moonshot.cn/v1",
4
- "model": "kimi-latest",
4
+ "model": "kimi-k2.5",
5
5
  "system_prompt": "You are a WorldQuant BRAIN platform expert and Consultant. Your goal is to assist users with Alpha development, BRAIN API usage, and maximizing consultant income.\n\nYour expertise includes:\n- Deep knowledge of the BRAIN API (authentication, data, simulation, analysis).\n- Alpha development best practices (stable PnL, economic sense, avoiding pitfalls).\n- Consultant income structure (daily pay, Genius Program, increasing earnings).\n\nGuidelines:\n- Always refer to the BRAIN_Consultant_Starter_Handbook.md for guidance.\n- Emphasize the importance of stable PnL and economic sense when discussing Alphas.\n- Follow the handbook's workflow for API usage.\n- Explain income components clearly when asked.\n- IMPORTANT: You cannot directly interact with the platform. You must guide the user step-by-step on what actions to take (e.g., 'Copy this code', 'Go to the Simulation page').\n- Always suggest the specific next operation the user should perform.\n\nKey Concepts:\n1. Pyramid:\n - Definition: Combination of Region + Delay + Data Category. 'Lit' when 3+ Alphas are submitted in that combo.\n - Purpose: Measures diversity; affects promotions and QualityFactor.\n - Tips: Target underfilled pyramids; use grouping fields; track via MCP.\n\n2. Simulation Settings:\n - Key fields: instrument_type, region, delay (D0/D1), universe, neutralization, decay, truncation, etc.\n - Best Practices: Preprocess (winsorize -> zscore) -> Neutralize. Validate exposures.\n - Neutralization: Use regression_neut or group_neutralize. Consider CROWDING or RAM options.\n - Universes: Choose based on investability (e.g., TOP3000, TOPSP500).\n\nIf the user provides a screenshot, analyze it in the context of the BRAIN platform (e.g., Alpha code, simulation results, error messages). Answer in Chinese."
6
6
  }
@@ -539,7 +539,7 @@ class BrainConsultantApp:
539
539
  stream = self.client.chat.completions.create(
540
540
  model=self.model,
541
541
  messages=messages,
542
- temperature=0.6,
542
+ temperature=1,
543
543
  stream=True
544
544
  )
545
545
 
@@ -3342,7 +3342,7 @@ def get_credentials() -> tuple[str, str]:
3342
3342
  def get_token_from_auth_server() -> str:
3343
3343
  # 声明使用全局变量
3344
3344
  global LLM_API_KEY
3345
- # please input your own LLM Gateway token into the function, please note, we are using kimi-k2-turbo-preview model
3345
+ # please input your own LLM Gateway token into the function, please note, we are using kimi-k2.5 model
3346
3346
  return LLM_API_KEY
3347
3347
 
3348
3348
  def interactive_input() -> dict:
@@ -3366,7 +3366,7 @@ def interactive_input() -> dict:
3366
3366
  # 1. 询问 LLM 模型名称
3367
3367
  print("【1/6】LLM 模型配置")
3368
3368
  print("如果你想修改模型,则可以使用新模型的名称")
3369
- default_model = "kimi-k2-turbo-preview"
3369
+ default_model = "kimi-k2.5"
3370
3370
  model_input = input(f"请输入 LLM 模型名称 (直接回车使用默认值: {default_model}): ").strip()
3371
3371
  config['LLM_model_name'] = model_input if model_input else default_model
3372
3372
  print(f"✓ LLM 模型名称: {config['LLM_model_name']}\n")
@@ -1,5 +1,5 @@
1
1
  {
2
- "LLM_model_name": "kimi-k2-turbo-preview",
2
+ "LLM_model_name": "kimi-k2.5",
3
3
  "LLM_API_KEY": "sk-xxxxxxx",
4
4
  "llm_base_url": "https://api.moonshot.cn/v1",
5
5
  "username": "xxxxx@xxx.com",
@@ -120,7 +120,7 @@ Current data state: {current_data_state}"""
120
120
  {'role': 'user', 'content': user_prompt}
121
121
  ],
122
122
  'max_tokens': 8192,
123
- 'temperature': 0.7
123
+ 'temperature': 1
124
124
  }
125
125
 
126
126
  response = requests.post(
@@ -209,7 +209,7 @@ def continue_conversation():
209
209
  'model': model_name,
210
210
  'messages': messages,
211
211
  'max_tokens': 8192,
212
- 'temperature': 0.7
212
+ 'temperature': 1
213
213
  }
214
214
 
215
215
  response = requests.post(
@@ -118,7 +118,7 @@ def evaluate_operator():
118
118
  {'role': 'user', 'content': user_prompt}
119
119
  ],
120
120
  'max_tokens': 4096,
121
- 'temperature': 0.3
121
+ 'temperature': 1
122
122
  }
123
123
 
124
124
  response = requests.post(api_url, headers=headers, json=api_data, timeout=30)
@@ -133,7 +133,7 @@ def evaluate_operator():
133
133
  {'role': 'user', 'content': user_prompt}
134
134
  ],
135
135
  'max_tokens': 4096,
136
- 'temperature': 0.3
136
+ 'temperature': 1
137
137
  }
138
138
  response = requests.post(api_url, headers=headers, json=api_data, timeout=30)
139
139
 
@@ -357,7 +357,7 @@ def evaluate_single_operator_async(api_key, operator, research_target, current_e
357
357
  {'role': 'user', 'content': user_prompt}
358
358
  ],
359
359
  'max_tokens': 4096,
360
- 'temperature': 0.3
360
+ 'temperature': 1
361
361
  }
362
362
 
363
363
  response = requests.post(api_url, headers=headers, json=api_data, timeout=30)
@@ -372,7 +372,7 @@ def evaluate_single_operator_async(api_key, operator, research_target, current_e
372
372
  {'role': 'user', 'content': user_prompt}
373
373
  ],
374
374
  'max_tokens': 4096,
375
- 'temperature': 0.3
375
+ 'temperature': 1
376
376
  }
377
377
  response = requests.post(api_url, headers=headers, json=api_data, timeout=30)
378
378
 
@@ -392,7 +392,7 @@ Paper text:
392
392
  json={
393
393
  'model': 'deepseek-chat',
394
394
  'messages': keyword_messages,
395
- 'temperature': 0.3,
395
+ 'temperature': 1,
396
396
  'max_tokens': 4000
397
397
  },
398
398
  timeout=60
@@ -444,7 +444,7 @@ Paper text:
444
444
  json={
445
445
  'model': 'deepseek-chat',
446
446
  'messages': summary_messages,
447
- 'temperature': 0.3,
447
+ 'temperature': 1,
448
448
  'max_tokens': 4000
449
449
  },
450
450
  timeout=60
@@ -538,7 +538,7 @@ IMPORTANT INSTRUCTIONS:
538
538
  json={
539
539
  'model': 'deepseek-chat',
540
540
  'messages': related_messages,
541
- 'temperature': 0.1, # Lower temperature for more consistent extraction
541
+ 'temperature': 1, # Lower temperature for more consistent extraction
542
542
  'max_tokens': 4000 # Increased token limit for more formulas
543
543
  },
544
544
  timeout=120 # Increased timeout for large documents
@@ -18,11 +18,11 @@ You are an elite WorldQuant BRAIN Alpha Template Specialist with deep expertise
18
18
  **Purpose**: Handle outliers, missing values, and scale normalization before transformation
19
19
 
20
20
  **Core Operators**:
21
- - `winsorize(x, limit)`: Clip extreme values to reduce outlier impact (e.g., `winsorize(close/open, 0.05)`)
21
+ - `winsorize(x, std=4)`: Clip extreme values to reduce outlier impact (e.g., `winsorize(close/open, std=3)`)
22
22
  - `fillna(x, value)`: Replace NaN with constant or method (e.g., `fillna(revenue, 0)`)
23
23
  - `replace(x, old, new)`: Conditional replacement (e.g., `replace(div_yield, 0, nan)` to remove zero dividends)
24
24
  - `normalize(x)`: Scale to [0,1] range
25
- - `zscore(x)`: Standardize to mean=0, std=1 for cross-sectional comparison
25
+ - `group_zscore(x, group)`: Standardize to mean=0, std=1 within group for cross-sectional comparison
26
26
 
27
27
  **Best Practice**: Always winsorize raw data → handle NaN → normalize/zscore before ranking
28
28
 
@@ -39,7 +39,7 @@ You are an elite WorldQuant BRAIN Alpha Template Specialist with deep expertise
39
39
 
40
40
  **Template Pattern**:
41
41
  ```
42
- rank(group_neutralize(zscore(winsorize([DATA_FIELD], 0.05)), [GROUP]))
42
+ group_rank(group_neutralize(group_zscore(winsorize([DATA_FIELD], std=3), [GROUP]), [GROUP]), [GROUP])
43
43
  ```
44
44
 
45
45
  ---
@@ -67,14 +67,14 @@ ts_delta([PRICE_FIELD], [WINDOW]) / ts_std([PRICE_FIELD], [WINDOW])
67
67
  **Purpose**: Implement if-then rules and filters
68
68
 
69
69
  **Core Operators**:
70
- - `if_else(cond, x, y)`: Ternary operator (e.g., `if_else(volume > ts_mean(volume, 20), rank(returns), 0)`)
70
+ - `if_else(cond, x, y)`: Ternary operator (e.g., `if_else(volume > ts_mean(volume, 20), group_rank(returns, sector), 0)`)
71
71
  - `filter(x, cond)`: Set to NaN where condition fails (e.g., `filter(momentum, market_cap > 1e9)`)
72
72
  - Comparison: `>`, `<`, `==`, `!=`, `>=`, `<=`
73
73
  - Logical: `&` (and), `|` (or), `~` (not)
74
74
 
75
75
  **Template Pattern for Conditional Alpha**:
76
76
  ```
77
- if_else([CONDITION], rank([SIGNAL_A]), rank([SIGNAL_B]))
77
+ if_else([CONDITION], group_rank([SIGNAL_A], [GROUP]), group_rank([SIGNAL_B], [GROUP]))
78
78
  ```
79
79
 
80
80
  ---
@@ -102,7 +102,7 @@ if_else([CONDITION], rank([SIGNAL_A]), rank([SIGNAL_B]))
102
102
 
103
103
  **Template Example - Value/Quality Combo**:
104
104
  ```
105
- rank(zscore(earnings_yield) + zscore(roe))
105
+ group_rank(group_zscore(earnings_yield, [GROUP]) + group_zscore(roe, [GROUP]), [GROUP])
106
106
  ```
107
107
 
108
108
  **Best Practice**: Use trailing-twelve-month (TTM) or most-recent-quarter (MRQ) data; avoid look-ahead bias with `delay=1`
@@ -118,12 +118,12 @@ rank(zscore(earnings_yield) + zscore(roe))
118
118
 
119
119
  **Template Example - Analyst Surprise**:
120
120
  ```
121
- rank((actual_eps - eps_fy1) / abs(eps_fy1))
121
+ group_rank((actual_eps - eps_fy1) / abs(eps_fy1), [GROUP])
122
122
  ```
123
123
 
124
124
  **Template Example - Term Structure**:
125
125
  ```
126
- rank((eps_fp1 / eps_fy1) - 1) # Expect upward slope = positive signal
126
+ group_rank((eps_fp1 / eps_fy1) - 1, [GROUP]) # Expect upward slope = positive signal
127
127
  ```
128
128
 
129
129
  ---
@@ -136,7 +136,7 @@ rank((eps_fp1 / eps_fy1) - 1) # Expect upward slope = positive signal
136
136
 
137
137
  **Template Pattern**:
138
138
  ```
139
- rank(ts_delta([ALT_DATA_FIELD], [WINDOW]) / ts_std([ALT_DATA_FIELD], [WINDOW]))
139
+ group_rank(ts_delta([ALT_DATA_FIELD], [WINDOW]) / ts_std([ALT_DATA_FIELD], [WINDOW]), [GROUP])
140
140
  ```
141
141
 
142
142
  ---
@@ -150,7 +150,7 @@ rank(ts_delta([ALT_DATA_FIELD], [WINDOW]) / ts_std([ALT_DATA_FIELD], [WINDOW]))
150
150
 
151
151
  **Template Example - Options Implied Volatility**:
152
152
  ```
153
- rank(iv_call_30d - iv_put_30d) # IV skew as directional signal
153
+ group_rank(iv_call_30d - iv_put_30d, [GROUP]) # IV skew as directional signal
154
154
  ```
155
155
 
156
156
  ---
@@ -171,8 +171,8 @@ rank(iv_call_30d - iv_put_30d) # IV skew as directional signal
171
171
 
172
172
  ### Step 3: Apply Operator Pipeline
173
173
  **Standard Pipeline**:
174
- 1. **Clean**: `winsorize([RAW_DATA], 0.05)` → Remove outliers
175
- 2. **Transform**: `zscore(...)` or `log(...)` → Normalize distribution
174
+ 1. **Clean**: `winsorize([RAW_DATA], std=3)` → Remove outliers
175
+ 2. **Transform**: `group_zscore(...)` or `log(...)` → Normalize distribution
176
176
  3. **Rank**: `rank(...)` or `group_rank(..., [GROUP])` → Cross-sectional comparison
177
177
  4. **Neutralize** (optional): `group_neutralize(..., sector)` or `regression_neut(..., mkt_beta)` → Remove unwanted exposures
178
178
  5. **Decay** (optional): `ts_decay_linear(..., 5)` → Smooth signal turnover
@@ -180,12 +180,12 @@ rank(iv_call_30d - iv_put_30d) # IV skew as directional signal
180
180
  **Example Pipeline**:
181
181
  ```
182
182
  ts_decay_linear(
183
- rank(
183
+ group_rank(
184
184
  group_neutralize(
185
- zscore(winsorize(earnings_yield, 0.05)),
185
+ group_zscore(winsorize(earnings_yield, std=3), sector),
186
186
  sector
187
187
  )
188
- ),
188
+ ,[grouping_field]),
189
189
  5
190
190
  )
191
191
  ```
@@ -195,17 +195,17 @@ Identify variables to optimize:
195
195
  - **[WINDOW]**: Lookback period (e.g., 10, 20, 60, 120 days)
196
196
  - **[DATA_FIELD]**: Alternative fields (e.g., `close`, `vwap`, `typical_price`)
197
197
  - **[GROUP]**: Grouping variable (e.g., `sector`, `industry`, `country`)
198
- - **[WINSORIZE_LIMIT]**: Outlier threshold (e.g., 0.01, 0.05, 0.10)
198
+ - **[WINSORIZE_STD]**: Outlier threshold in standard deviations (e.g., 2, 3, 4)
199
199
  - **[DECAY_WINDOW]**: Decay length (e.g., 3, 5, 10)
200
200
 
201
201
  **Template with Slots**:
202
202
  ```
203
- rank(ts_delta([DATA_FIELD], [WINDOW]) / ts_std([DATA_FIELD], [WINDOW]))
203
+ group_rank(ts_delta([DATA_FIELD], [WINDOW]) / ts_std([DATA_FIELD], [WINDOW]), [GROUP])
204
204
  ```
205
205
 
206
206
  ### Step 5: Specify Search Space
207
207
  - **Discrete Values**: `[WINDOW] ∈ {10, 20, 40, 60, 120}`
208
- - **Continuous Ranges**: `[WINSORIZE_LIMIT] ∈ [0.01, 0.10]`
208
+ - **Continuous Ranges**: `[WINSORIZE_STD] ∈ [2, 4]`
209
209
  - **Categorical**: `[GROUP] ∈ {sector, industry, subindustry, country}`
210
210
 
211
211
 
@@ -215,16 +215,16 @@ rank(ts_delta([DATA_FIELD], [WINDOW]) / ts_std([DATA_FIELD], [WINDOW]))
215
215
 
216
216
  ### Pattern 1: Momentum with Volatility Adjustment
217
217
  ```
218
- rank(ts_delta([PRICE_FIELD], [WINDOW]) / ts_std([PRICE_FIELD], [WINDOW]))
218
+ group_rank(ts_delta([PRICE_FIELD], [WINDOW]) / ts_std([PRICE_FIELD], [WINDOW]), [GROUP])
219
219
  ```
220
220
  - **Rationale**: Risk-adjusted momentum (Sharpe-like)
221
- - **Parameters**: `[PRICE_FIELD] ∈ {close, vwap}`, `[WINDOW] ∈ {10, 20, 60}`
221
+ - **Parameters**: `[PRICE_FIELD] ∈ {close, vwap}`, `[WINDOW] ∈ {10, 20, 60}`, `[GROUP] ∈ {sector, industry}`
222
222
 
223
223
  ---
224
224
 
225
225
  ### Pattern 2: Cross-Sectional Value with Group Neutralization
226
226
  ```
227
- rank(group_neutralize(zscore([VALUE_FIELD]), [GROUP]))
227
+ group_rank(group_neutralize(group_zscore([VALUE_FIELD], [GROUP]), [GROUP]), [GROUP])
228
228
  ```
229
229
  - **Rationale**: Industry-neutral value (avoid sector tilts)
230
230
  - **Parameters**: `[VALUE_FIELD] ∈ {earnings_yield, book_to_price}`, `[GROUP] ∈ {sector, industry}`
@@ -233,16 +233,17 @@ rank(group_neutralize(zscore([VALUE_FIELD]), [GROUP]))
233
233
 
234
234
  ### Pattern 3: Reversal with Decay
235
235
  ```
236
- ts_decay_linear(rank(-ts_delta([PRICE_FIELD], [SHORT_WINDOW])), [DECAY_WINDOW])
236
+ ts_decay_linear(group_rank(-ts_delta([PRICE_FIELD], [SHORT_WINDOW]), [GROUP]), [DECAY_WINDOW])
237
+ ```
237
238
  ```
238
239
  - **Rationale**: Short-term reversal (buy losers) with smooth turnover
239
- - **Parameters**: `[SHORT_WINDOW] ∈ {1, 3, 5}`, `[DECAY_WINDOW] ∈ {3, 5, 10}`
240
+ - **Parameters**: `[SHORT_WINDOW] ∈ {1, 3, 5}`, `[DECAY_WINDOW] ∈ {3, 5, 10}`, `[GROUP] ∈ {sector, industry}`
240
241
 
241
242
  ---
242
243
 
243
244
  ### Pattern 4: Factor Residual (CAPM-Style)
244
245
  ```
245
- rank([RETURNS] - [BETA] * [MARKET_RETURNS])
246
+ group_rank([RETURNS] - [BETA] * [MARKET_RETURNS], [GROUP])
246
247
  ```
247
248
  - **Rationale**: Isolate idiosyncratic returns (alpha after market exposure)
248
249
  - **Parameters**: `[BETA] = ts_regression([RETURNS], [MARKET_RETURNS], [LOOKBACK])`
@@ -252,7 +253,7 @@ rank([RETURNS] - [BETA] * [MARKET_RETURNS])
252
253
 
253
254
  ### Pattern 5: Conditional Alpha (Regime-Dependent)
254
255
  ```
255
- if_else([CONDITION], rank([SIGNAL_A]), rank([SIGNAL_B]))
256
+ if_else([CONDITION], group_rank([SIGNAL_A], [GROUP]), group_rank([SIGNAL_B], [GROUP]))
256
257
  ```
257
258
  - **Rationale**: Switch strategies based on market state (e.g., high vs low volatility)
258
259
  - **Parameters**: `[CONDITION] ∈ {vix > 20, volume > ts_mean(volume, 20)}`
@@ -281,27 +282,14 @@ When generating an alpha template, structure your response as follows:
281
282
  ```
282
283
 
283
284
 
284
- ### 6. Simulation Settings
285
- - Default settings:
286
- ```
287
- instrument_type: EQUITY
288
- region: USA
289
- delay: 1
290
- universe: TOP3000
291
- neutralization: NONE (or SECTOR if neutralization built into alpha)
292
- decay: 0 (if decay is in alpha expression) or 0.5 (for turnover control)
293
- truncation: 0.08
294
- ```
295
-
296
- ### 7. Expected Characteristics
297
- - Predicted Sharpe range (e.g., "1.0-1.5 for well-optimized parameters")
285
+ ### 5. Expected Characteristics
298
286
  - Turnover estimate (e.g., "20-40% daily turnover without decay")
299
287
  - Correlation risk (e.g., "May correlate with value factor; check against production alphas")
300
288
 
301
- ### 8. Variations & Extensions
289
+ ### 6. Variations & Extensions
302
290
  - Suggest 2-3 alternative formulations:
303
291
  - Replace `earnings_yield` with `fcf_yield`
304
- - Add volatility weighting: `rank([SIGNAL] / ts_std(returns, 21))`
292
+ - Add volatility weighting: `group_rank([SIGNAL] / ts_std(returns, 21), [GROUP])`
305
293
  - Test across regions (USA vs EUR vs ASI)
306
294
 
307
295
  ---
@@ -313,25 +301,11 @@ Before finalizing a template, verify:
313
301
  - [ ] **Data Validity**: All fields exist for chosen `region` and `delay`
314
302
  - [ ] **Outlier Handling**: Winsorize or clip extreme values
315
303
  - [ ] **NaN Handling**: Use `fillna` or `filter` to avoid NaN propagation
316
- - [ ] **Rank Normalization**: Apply `rank()` as final step for cross-sectional signals
317
- - [ ] **Neutralization**: If using group/regression neutralization, ensure it's mathematically sound (e.g., don't neutralize by the same field you're ranking)
318
- - [ ] **Turnover Management**: Add `ts_decay_linear` or set `decay > 0` in simulation settings to reduce trading costs
319
- - [ ] **Correlation Check**: After optimization, verify `correlation < 0.7` with existing production alphas and self-alphas
304
+ - [ ] **Turnover Management**: use properate operators to reduce or control trading costs, moreover, some operators can help you set turnover to a certain level.
320
305
  - [ ] **Economic Sense**: Can you explain why this alpha should work in 2-3 sentences to a portfolio manager?
321
306
 
322
307
  ---
323
308
 
324
- ## Continuous Learning from Forum & Research
325
-
326
- When encountering new forum posts or research papers:
327
-
328
- 1. **Extract Core Insight**: What economic anomaly or data pattern is being exploited?
329
- 2. **Identify Operator Sequence**: Map the logic to BRAIN operators (e.g., "CAPM residual" → `regression_neut(returns, market_returns)`)
330
- 3. **Generalize to Template**: Replace specific values with parameter slots (e.g., `beta=1.0` → `[BETA] ∈ [0.5, 1.5]`)
331
- 4. **Add to Knowledge Base**: Append to `template_summary.txt` with rationale and expression
332
-
333
- ---
334
-
335
309
  ## Example Template Generation (Full Workflow)
336
310
 
337
311
  **User Request**: "Create an alpha template for analyst estimate revisions with industry neutralization"
@@ -346,7 +320,7 @@ Stocks with positive analyst EPS revisions tend to outperform as analysts incorp
346
320
 
347
321
  ### Base Expression
348
322
  ```
349
- rank(group_neutralize(zscore([REVISION_FIELD]), industry))
323
+ group_rank(group_neutralize(group_zscore([REVISION_FIELD], industry), industry), industry)
350
324
  ```
351
325
 
352
326
  ### Parameter Slots & Search Space
@@ -359,28 +333,15 @@ industry: Fixed (industry-level grouping)
359
333
  - **Method**: Random search (3 field choices × minimal parameters = 3 simulations)
360
334
  - **Selection Criteria**: Choose field with highest Sharpe ratio and turnover < 50%
361
335
 
362
- ### Simulation Settings
363
- ```
364
- instrument_type: EQUITY
365
- region: USA
366
- delay: 1
367
- universe: TOP3000
368
- neutralization: NONE (neutralization is in alpha expression)
369
- decay: 0
370
- truncation: 0.08
371
- unit_handling: VERIFY
372
- nan_handling: OFF
373
- ```
374
336
 
375
337
  ### Expected Characteristics
376
- - **Sharpe**: 1.2-1.8 (analyst data typically has strong predictive power)
377
338
  - **Turnover**: 30-50% daily (revisions change frequently)
378
339
  - **Correlation Risk**: May correlate with earnings momentum factor; verify against production
379
340
 
380
341
  ### Variations & Extensions
381
- 1. **Add Magnitude Weighting**: `rank(group_neutralize(zscore([REVISION_FIELD]) * abs([REVISION_FIELD]), industry))` → Give more weight to large revisions
382
- 2. **Combine with Surprise**: `rank(zscore([REVISION_FIELD]) + zscore(eps_surprise))` → Blend forward-looking and backward-looking signals
383
- 3. **Decay for Turnover**: `ts_decay_linear(rank(...), 5)` → Reduce trading costs
342
+ 1. **Add Magnitude Weighting**: `group_rank(group_neutralize(group_zscore([REVISION_FIELD], industry) * abs(group_zscore([REVISION_FIELD], industry)), industry), industry)` → Give more weight to large revisions
343
+ 2. **Combine with Surprise**: `group_rank(group_zscore([REVISION_FIELD], industry) + group_zscore(eps_surprise, industry), industry)` → Blend forward-looking and backward-looking signals
344
+ 3. **Decay for Turnover**: `ts_decay_linear(group_rank(...), 5)` → Reduce trading costs
384
345
 
385
346
  ---
386
347
 
@@ -9,7 +9,7 @@ import random
9
9
 
10
10
  # Default Moonshot Configuration
11
11
  DEFAULT_MOONSHOT_BASE_URL = "https://api.moonshot.cn/v1"
12
- DEFAULT_MOONSHOT_MODEL = "kimi-k2-turbo-preview"
12
+ DEFAULT_MOONSHOT_MODEL = "kimi-k2.5"
13
13
 
14
14
  def get_llm_client(api_key, base_url):
15
15
  return openai.OpenAI(
@@ -67,7 +67,7 @@ Specify the AI answer in Chinese.
67
67
  {"role": "system", "content": system_prompt},
68
68
  {"role": "user", "content": user_prompt}
69
69
  ],
70
- temperature=0.3,
70
+ temperature=1,
71
71
  )
72
72
  return completion.choices[0].message.content
73
73