An AI-powered system using multiple specialized agents for comprehensive stock analysis through LangGraph.
This system employs a coordinated multi-agent approach to analyze stocks:
- Coordinates analysis workflow between specialized agents
- Combines individual analyses into comprehensive reports
- Manages research planning and execution
-
Economic Analyst
- Analyzes macroeconomic conditions
- Evaluates monetary and fiscal policies
- Assesses economic risks and opportunities
-
Industry Analyst
- Conducts industry research and competitive analysis
- Evaluates market trends and dynamics
- Analyzes regulatory environment
-
Quantitative Analyst
- Performs financial metrics analysis
- Evaluates company performance
- Conducts valuation analysis
langgraph/
├── .env # Environment variables
├── README.md # Project documentation
├── Orchestrator/
│ ├── orchestrator.py # Main coordination logic
│ ├── state.py # Orchestrator state definitions
│ └── prompts.py # Orchestrator system prompts
├── Economic_Analyst/
│ ├── economic_analyst.py # Economic analysis workflow
│ ├── state.py # Economic analyst state
│ └── prompts.py # Economic analysis prompts
├── Industry_Analyst/
│ ├── research_parallel.py # Industry analysis workflow
│ ├── state.py # Industry analyst state
│ └── prompts.py # Industry analysis prompts
└── Quantitative_Analyst/
├── quantitative_analyst.py # Financial analysis workflow
├── state.py # Quantitative analyst state
└── prompts.py # Financial analysis prompts
- Clone the repository
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install langchain langgraph tavily-python python-dotenv langchain-google-genai langsmith quickfs-pythonCreate a .env file with the following variables:
# AI Services
GOOGLE_GENERATIVE_AI_API_KEY= # Gemini API key
TAVILY_API_KEY= # Tavily search API key
QUICKFS_API_KEY= # QuickFS API key for financial data
# LangSmith Configuration
LANGCHAIN_TRACING_V2=true
LANGCHAIN_ENDPOINT="https://api.smith.langchain.com"
LANGCHAIN_API_KEY= # LangSmith API key
LANGCHAIN_PROJECT= # Your project namefrom Orchestrator.orchestrator import analyze_stock
async def main():
result = await analyze_stock("AAPL")
print(result["final_report"])- Multi-Agent Architecture: Specialized agents for economic, industry, and quantitative analysis
- Parallel Processing: Concurrent analysis execution for efficiency
- Source Deduplication: Eliminates duplicate sources across all analyses
- Iterative Analysis: Agents use reflection for research refinement
- Comprehensive Reporting: Combines multiple expert analyses into cohesive reports
MIT License
Patrick Nguyen
https://github.com/langchain-ai/report-mAIstro/tree/main https://github.com/langchain-ai/research-rabbit/tree/main/src/research_rabbit https://github.com/langchain-ai/data-enrichment/blob/main/src/enrichment_agent