mirror of
https://github.com/farcasclaudiu/TradingAgents.git
synced 2026-06-22 07:01:21 +03:00
ebd2e12e67
The previous per-agent BM25 memory was effectively dead code — its only caller was a commented-out line in main.py. Replace it with a single append-only markdown decision log driven by the propagate() lifecycle. Lifecycle: - store_decision() appends a pending entry at the end of every run - _resolve_pending_entries() runs at the start of the next same-ticker run, fetches yfinance returns + alpha vs SPY, and writes one LLM reflection per resolved entry through an atomic temp-file rename - Portfolio Manager consumes state["past_context"] (5 most recent same-ticker entries plus 3 cross-ticker reflection-only excerpts) Storage at ~/.tradingagents/memory/trading_memory.md (override: TRADINGAGENTS_MEMORY_LOG_PATH). Tag schema: - Pending: [YYYY-MM-DD | TICKER | Rating | pending] - Resolved: [YYYY-MM-DD | TICKER | Rating | +X.X% | +Y.Y% | Nd] Removes rank-bm25 dependency and the legacy reflect_and_remember() plumbing across reflection.py, trading_graph.py, and the agent factories. 49 new tests in tests/test_memory_log.py cover the storage, deferred reflection, prompt injection, and legacy-removal paths. Full suite (58 tests) passes in under 2 seconds without API keys.
39 lines
1.8 KiB
Python
39 lines
1.8 KiB
Python
import os
|
|
|
|
_TRADINGAGENTS_HOME = os.path.join(os.path.expanduser("~"), ".tradingagents")
|
|
|
|
DEFAULT_CONFIG = {
|
|
"project_dir": os.path.abspath(os.path.join(os.path.dirname(__file__), ".")),
|
|
"results_dir": os.getenv("TRADINGAGENTS_RESULTS_DIR", os.path.join(_TRADINGAGENTS_HOME, "logs")),
|
|
"data_cache_dir": os.getenv("TRADINGAGENTS_CACHE_DIR", os.path.join(_TRADINGAGENTS_HOME, "cache")),
|
|
"memory_log_path": os.getenv("TRADINGAGENTS_MEMORY_LOG_PATH", os.path.join(_TRADINGAGENTS_HOME, "memory", "trading_memory.md")),
|
|
# LLM settings
|
|
"llm_provider": "openai",
|
|
"deep_think_llm": "gpt-5.4",
|
|
"quick_think_llm": "gpt-5.4-mini",
|
|
"backend_url": "https://api.openai.com/v1",
|
|
# Provider-specific thinking configuration
|
|
"google_thinking_level": None, # "high", "minimal", etc.
|
|
"openai_reasoning_effort": None, # "medium", "high", "low"
|
|
"anthropic_effort": None, # "high", "medium", "low"
|
|
# Output language for analyst reports and final decision
|
|
# Internal agent debate stays in English for reasoning quality
|
|
"output_language": "English",
|
|
# Debate and discussion settings
|
|
"max_debate_rounds": 1,
|
|
"max_risk_discuss_rounds": 1,
|
|
"max_recur_limit": 100,
|
|
# Data vendor configuration
|
|
# Category-level configuration (default for all tools in category)
|
|
"data_vendors": {
|
|
"core_stock_apis": "yfinance", # Options: alpha_vantage, yfinance
|
|
"technical_indicators": "yfinance", # Options: alpha_vantage, yfinance
|
|
"fundamental_data": "yfinance", # Options: alpha_vantage, yfinance
|
|
"news_data": "yfinance", # Options: alpha_vantage, yfinance
|
|
},
|
|
# Tool-level configuration (takes precedence over category-level)
|
|
"tool_vendors": {
|
|
# Example: "get_stock_data": "alpha_vantage", # Override category default
|
|
},
|
|
}
|