TradingAgents/tradingagents
Zhigong Liu 2cdada6300 fix: suppress memory injection when memory is empty (hallucination guard, closes #572)
When past_memories is empty, all five agents previously injected an
empty string into their prompts while still instructing the LLM to
"address reflections and learn from past mistakes" — causing the LLM
to hallucinate fabricated lessons on first run.

Each agent now conditionally builds its memory section only when
past_memories is non-empty, so the injection and its instruction
are both absent when there is nothing to recall.

Also fixes import ordering in memory.py (logger after imports).

Tests: tests/test_hallucination_guard.py covers empty and populated
memory for all five agents (bull, bear, trader, research manager,
portfolio manager).

Companion to #563 (memory persistence).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 22:30:31 -04:00
..
agents fix: suppress memory injection when memory is empty (hallucination guard, closes #572) 2026-04-18 22:30:31 -04:00
dataflows fix: add missing pandas import in y_finance.py (#488) 2026-04-04 07:14:10 +00:00
graph fix: use ~/.tradingagents/ for cache and logs, resolving Docker permission issue (#519) 2026-04-13 05:26:04 +00:00
llm_clients feat: add DeepSeek, Qwen, GLM, and Azure OpenAI provider support 2026-04-13 07:12:07 +00:00
__init__.py fix: set process-level UTF-8 default for cross-platform consistency 2026-03-22 23:42:37 +00:00
default_config.py feat: persist FinancialSituationMemory to disk (#563) 2026-04-18 21:13:14 -04:00