Skip to content

LoadingBFX/AI-Powered-Financial-Portfolio-Rebalancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 AI-Powered Financial Portfolio Rebalancer

📘 Description

This project implements a LangChain agent powered by multiple LLMs (OpenAI, Groq) to help users:

  • 📈 Get real-time stock prices
  • 📊 Analyze and rebalance their investment portfolios
  • 📉 Understand market trends over the past week

⚙️ Setup Instructions

  1. Install dependencies:

    pip install -r requirements.txt
  2. Create a .env file in the root directory:

    OPENAI_API_KEY=your_openai_key_here  
    GROQ_API_KEY=your_groq_key_here
  3. Run the test cases:

    python run.py

🧠 LLM Providers Used

  • OpenAI: GPT-4
  • Groq: LLaMA3-8B / LLaMA3-70B

🧰 Tools Implemented

Tool Name Purpose
StockPriceLookup Retrieves the current price and daily change of a given stock ticker
PortfolioRebalancer Analyzes stock portfolio weights and recommends rebalancing actions
MarketTrendAnalyzer Summarizes recent trends for a major index like the S&P 500 (SPY)

🧪 Sample Output

Portfolio 1 (OpenAI):

AAPL: SELL 16.67% to reach target weight 33.33%
TSLA: BUY 3.33% to reach target weight 33.33%
GOOGL: BUY 13.33% to reach target weight 33.33%

Portfolio 2 (Groq LLaMA3-70B):

MSFT: OK (weight = 0.25)
NVDA: OK (weight = 0.25)
AMZN: OK (weight = 0.25)
META: OK (weight = 0.25)

📄 Author & License

MIT License · CMU 94-815 · Fanxing Bu

About

AI-Powered Financial Portfolio Rebalancer Using LangChain with Multiple LLM Integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages