How monishkumardvs/aihedgenexus works
External Entities
• Trader (User)
– Inputs stock tickers, date ranges, and views the dashboard.
• Market Data Providers
– Yahoo Finance API
– Alpaca API
• News & Sentiment Source
– Financial news feed consumed by FinBERT (Hugging Face)
• Gemini LLM Service
– External model endpoint for decision synthesis
Main Process
• Process 1.0: “Generate Trading Recommendation”
– Represents the entire AI-driven pipeline (Data Layer → Agent Layer → Synthesis → Output)
Data Stores
• D1: Raw Market Data Cache
– Temporarily holds price, volume, and fundamental metrics fetched via tools/api.py.
• D2: Agent Scores
– Stores intermediate results from:
· Sentiment Agent (agents/sentiment.py)
· Technical Agent (agents/technicals.py)
· Fundamental Agent (agents/fundamental.py)
· Risk Agent (agents/risk.py)
• D3: State Graph / Session State
– LangChain state graph maintained in utils/state.py for multi-agent coordination and user session data
Data Flows
• F1: “Ticker & Date Range”
– Trader → Process 1.0
• F2: “Data Request”
– Process 1.0 → Yahoo Finance API / Alpaca API
• F3: “Market & News Data”
– Yahoo Finance API / Alpaca API / News Feed → D1
• F4: “Raw Data”
– D1 → Process 1.0
• F5: “Agent Results”
– Process 1.0 → D2
• F6: “Intermediate Scores”
– D2 → Process 1.0
• F7: “Synthesis Prompt”
– Process 1.0 → Gemini LLM Service
• F8: “Recommendation + Rationale”
– Gemini LLM → Process 1.0
• F9: “Session Update”
– Process 1.0 → D3
• F10: “Dashboard Data”
– Process 1.0 → Streamlit UI (Trader)
• One large rounded-rectangle labeled “1.0 Generate Trading Recommendation.”
• Surround it with:
– From Trader → Process with F1.
– Process → APIs with F2.
– APIs → D1 with F3.
– D1 → Process with F4.
– Process → D2 with F5; D2 → Process with F6.
– Process → Gemini LLM with F7; LLM → Process with F8.
– Process → D3 with F9.
– Process → Trader (via Streamlit UI) with F10.