An adaptation of virattt's hedge-fund-agent-team, modified to analyze Brazilian market stocks using BRAPI API. The project implements a multi-agent system where each agent specializes in different aspects of financial analysis.
-
Orquestra.py: Main orchestration file that:
- Configures and manages the agent team
- Defines agent roles and behaviors
- Handles the workflow between agents
- Processes user queries and generates final analysis
-
tools.py: Contains all BRAPI API tool implementations:
- Financial statement tools (income statements, balance sheets)
- Market data tools (quotes, listings)
- Analysis tools (key statistics, financial data)
- Economic indicators (inflation, prime rate)
-
prettyprint.py: Handles output formatting:
- Rich text formatting for terminal output
- Custom styling for different message types
- Organized display of analysis results
-
brapi_wrapper.py: API wrapper interface:
- Imports tools from tools.py
- Provides high-level access to BRAPI endpoints
-
Multi-Agent Analysis:
- Fundamental Analyst: Financial statements and company health
- Valuation Analyst: Market data and valuation ratios
- Price Analyst: Price action and trends
-
BRAPI Integration:
- Real-time market data
- Historical financial statements
- Company statistics and metrics
-
Rich Output Formatting:
- Color-coded analysis sections
- Clear visual hierarchy
- Organized data presentation
- Python 3.8+
- BRAPI API Key
- Required packages:
langchain langgraph rich pandas requests python-dotenv
- Clone the repository:
git clone <https://github.com/PedroDnT/HedgeFund>
cd <repository-directory>
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables:
Run the main orchestration script:
python Orquestra.py
Example query: "What is PETR4's current financial health and how has its price been performing?"
- User query → Orquestra.py
- Query routed to appropriate analysts
- Analysts use tools.py to fetch data via BRAPI
- Analysis results formatted by prettyprint.py
- Final comprehensive analysis presented to user
MIT License