Commit Graph

84 Commits

Author SHA1 Message Date
MarkLo127 1a409796d1 2026-03-12 23:07:36 +08:00
MarkLo127 6a28ea523d Implement Plan A2: Parallelize Analyst Execution
Changes:
- Modify analyst graph connections to run in parallel instead of sequentially
- All analysts (Market, News, Fundamentals, Social) now start from START node simultaneously
- All analysts converge to Bull Researcher when complete
- Reduces analysis time by ~25-35% (4 analysts run in parallel instead of sequentially)

Technical Details:
- Previous: START → Market → News → Fundamentals → Bull Researcher (sequential)
- New: START → {Market, News, Fundamentals, Social} → Bull Researcher (parallel)
- Each analyst still has conditional edges to their tools and message clear nodes
- All analysts independently check completion and connect to Bull Researcher

Impact:
- Analysis time reduction: ~12-15 minutes saved per analysis
- Cumulative improvement with Plan A1 (fast mode):
  - Fast mode sequential: ~15-25 minutes
  - Fast mode parallel: ~10-15 minutes
  - Deep mode sequential: ~60 minutes
  - Deep mode parallel: ~40-45 minutes

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-12 21:34:07 +08:00
MarkLo127 b2fc38671b Optimize analysis speed and stability: Redis TTL, word count limits, and reporting
Changes:
- C1: Increase Redis TTL from 1 hour to 4 hours for completed tasks (prevents report deletion)
- Word count: Change all analyst prompts from 800-1500 to 500-1000 words
- Output filter: Update word count validation to 500-1000 range, hide specific word counts in warnings
- Remove character counts from output to improve clarity

These changes address:
1. Reports being deleted after 1 hour (now 4 hours)
2. Inconsistent word counts causing reruns (now strict 500-1000)
3. Output showing specific word counts (now just pass/warning)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-12 18:49:48 +08:00
MarkLo127 4f219bd74e Fix: Resolve GraphRecursionError by passing config params to agents and increasing recursion_limit to 200
- Pass max_debate_rounds and max_risk_discuss_rounds from config to ConditionalLogic
- Pass max_recur_limit from config to Propagator
- Increase default recursion_limit from 100 to 200 in default_config.py
- Increase Propagator default max_recur_limit from 100 to 200

Also includes earlier fixes:
- Add 365-day minimum date range validation to get_stock_data tool
- Update market analyst prompt to specify 1-year data requirement
- Initialize all debate state fields (bull_history, bear_history, judge_decision, etc.)
- Add report completeness logging in trading_service.py
- Add debug logging in frontend results page

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-12 17:17:23 +08:00
MarkLo127 ea4a267bcf 2026-03-11 18:59:17 +08:00
MarkLo127 e0965a66d6 fix: Increase LLM max_tokens to 16384 to prevent report truncation. 2026-03-09 16:03:33 +08:00
MarkLo127 4843bca0d3 Update news data and technical indicator utility functions. 2026-03-09 15:14:48 +08:00
MarkLo127 a90e0434a2 2026-03-09 14:56:49 +08:00
MarkLo127 d6020d8bd7 2026-02-12 04:52:16 +08:00
MarkLo 3145d08c30 2025-12-28 01:22:45 +08:00
MarkLo 16e513a921 新增英文語系支援 2025-12-24 01:20:33 +08:00
MarkLo c4fc8904eb 2025-12-20 07:41:05 +08:00
MarkLo 95f6b25333 2025-12-13 02:26:49 +08:00
MarkLo da7d05ecc9 2025-12-12 05:30:04 +08:00
MarkLo 482d8fa6aa 2025-12-11 15:00:30 +08:00
MarkLo 20e0c6a2d9 2025-12-11 13:46:33 +08:00
MarkLo 9ef0f2265d 2025-12-11 01:31:44 +08:00
MarkLo a51b31dc21 2025-12-11 00:37:19 +08:00
MarkLo 5dee4b323c 2025-12-05 23:34:50 +08:00
MarkLo edced35f70 feat: improve retry mechanism with jitter and longer delays
- Increase max retry attempts from 3 to 5
- Extend max delay from 10s to 60s for better handling of persistent 529 errors
- Add jitter (random 0-0.5s delay) to avoid synchronized retries
- Based on Cursor IDE blog best practices for handling Claude API 529 errors
2025-12-01 04:16:55 +08:00
MarkLo 42ef175ddb feat: add retry mechanism for Anthropic API 529 errors
- Add tenacity-based retry logic to Research Manager
- Configure exponential backoff (2-10s) for OverloadedError
- Maximum 3 retry attempts with warning-level logging
- Improves system stability against temporary API overload
- Fix: correct import path for OverloadedError from anthropic._exceptions
2025-12-01 03:56:56 +08:00
MarkLo 1c499e8a37 2025-12-01 02:56:47 +08:00
MarkLo 787e2a50e6 2025-11-26 23:12:52 +08:00
MarkLo 96b90b01da 2025-11-26 19:43:52 +08:00
MarkLo dcadb3c339 2025-11-26 18:46:15 +08:00
MarkLo c9e092202c 2025-11-26 18:44:47 +08:00
MarkLo 85b2fffef3 2025-11-26 18:15:55 +08:00
MarkLo 2e2b4db5da 2025-11-26 16:40:58 +08:00
MarkLo 7bb51aa7a0 2025-11-26 16:33:51 +08:00
MarkLo 2f79956694 2025-11-26 15:53:42 +08:00
MarkLo c93d118308 2025-11-26 15:28:36 +08:00
MarkLo 3dcdbb5659 2025-11-26 13:39:14 +08:00
MarkLo ace244e7be 2025-11-26 12:39:39 +08:00
MarkLo d0d3e87e22 2025-11-26 03:18:08 +08:00
MarkLo 8d3c8dc2a6 2025-11-25 20:48:39 +08:00
MarkLo c4430805e2 2025-11-25 19:58:10 +08:00
MarkLo 39208ccf35 2025-11-25 19:42:16 +08:00
MarkLo 6f3e757883 2025-11-25 18:32:14 +08:00
MarkLo 25362bb97b 2025-11-25 18:16:05 +08:00
MarkLo f3e453ff57 2025-11-25 17:59:38 +08:00
MarkLo 4fa7a60bbb 2025-11-25 17:25:05 +08:00
MarkLo 8d679007bf 2025-11-25 17:03:17 +08:00
MarkLo 15babc2bea 2025-11-25 05:35:54 +08:00
MarkLo 4cf7e808d7 2025-11-25 05:03:48 +08:00
MarkLo ebbc655d8a 2025-11-25 04:41:11 +08:00
MarkLo 3b89cc2f5c 2025-11-25 04:18:43 +08:00
MarkLo 357aa45390 2025-11-24 01:03:13 +08:00
MarkLo 9ae9007afd 2025-11-23 22:37:47 +08:00
MarkLo 02b83a6ddd 2025-11-23 07:31:00 +08:00
MarkLo 91ad37412b 2025-11-23 03:14:49 +08:00