Skip to content

AI-powered agent that analyzes stock insider transactions, company news, and price data to generate comprehensive research reports using OpenAI and Streamlit.

Notifications You must be signed in to change notification settings

QuantTradingOS/Equity-Insider-Intelligence-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📈 Equity Insider Intelligence Agent

An AI-powered agent that analyzes stock insider transactions, company news, and price data to generate comprehensive research reports. Built with Streamlit and OpenAI's GPT models.

Now includes persistent memory, so your past research reports are saved across sessions.


✨ Features

  • Enter any stock ticker (e.g., AAPL, TSLA, NVDA)
  • Automatically fetches insider transactions from Finnhub API
  • Retrieves recent company news and headlines
  • Gets real-time price data including moving averages and technical indicators
  • Generates AI-powered research reports with structured analysis
  • Stores reports locally using persistent memory (memory.json)
  • Prevents duplicate entries for the same ticker on the same day
  • Displays your recent report history with expandable views
  • Simple Streamlit web interface
  • Customizable lookback periods for insider transactions and news

🧠 Agent Capabilities

This project demonstrates:

  • Multi-source data aggregation (Finnhub API, yfinance)
  • LLM-powered analysis using OpenAI GPT-4o-mini
  • Structured report generation with technical analysis, insider activity insights, and news catalysts
  • Persistent agent memory using JSON storage
  • State management for report history
  • Clean, reproducible app structure

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/Equity-Insider-Intelligence-Agent.git
    cd Equity-Insider-Intelligence-Agent
  2. Create a virtual environment (recommended)

    python3 -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt

Running the App

  1. Start the Streamlit app

    streamlit run app.py
  2. Open your browser to the URL shown in the terminal (usually http://localhost:8501)

  3. Enter your API keys in the sidebar:

    • OpenAI API Key
    • Finnhub API Key
  4. Enter a stock ticker and click "Generate Research Report"


📖 Usage

  1. Enter API Keys: Add your OpenAI and Finnhub API keys in the sidebar (they're stored securely in your session)

  2. Input Stock Ticker: Type any valid stock symbol (e.g., AAPL, TSLA, NVDA)

  3. Configure Lookback Periods:

    • Insider lookback: How many days to look back for insider transactions (default: 90 days)
    • News lookback: How many days to look back for company news (default: 7 days)
  4. Generate Report: Click the "Generate Research Report" button

  5. View Results: The app will display:

    • AI Research Report: Structured analysis with TL;DR, insider activity highlights, news catalysts, technical context, risks, and actionable insights
    • Price Snapshot: Current price, moving averages, market cap, sector/industry, 52-week highs/lows
    • Raw Insider Transactions: Detailed transaction data in a searchable table
    • Raw News Data: Recent headlines and summaries
  6. Access History: Scroll down to see your saved reports from previous sessions


🔑 API Keys

OpenAI API Key

Finnhub API Key

  • Required for insider transaction and company news data
  • Free tier includes 60 API calls/minute
  • Get your key at: https://finnhub.io/register
  • No credit card required for free tier

📁 Project Structure

Equity-Insider-Intelligence-Agent/
├── app.py                 # Main Streamlit application
├── requirements.txt       # Python dependencies
├── .gitignore           # Git ignore file (includes memory.json)
├── memory.json          # Persistent storage for reports (auto-generated)
└── README.md            # This file

🛠️ Technologies Used

  • Streamlit - Web interface framework
  • OpenAI - GPT-4o-mini for report generation
  • yfinance - Stock price and market data
  • Finnhub API - Insider transactions and company news
  • Pandas - Data manipulation and analysis
  • Python 3.9+ - Runtime environment

📝 Report Structure

Each AI-generated report includes:

  1. TL;DR - Quick 4-6 bullet summary
  2. Insider Activity Analysis - Highlights notable buys, sell patterns, and clustering
  3. News Catalysts - Key themes and bullish/bearish indicators
  4. Technical Context - Price vs moving averages and trend analysis
  5. Risks & Watch Items - What to monitor in the coming week
  6. Actionable Insights - How traders/investors might use this information (not financial advice)

🔒 Privacy & Security

  • API keys are stored only in your browser session (not saved to disk)
  • Reports are saved locally in memory.json (already in .gitignore)
  • No data is sent to third parties except OpenAI and Finnhub APIs
  • All processing happens on your local machine

⚠️ Disclaimer

This tool is for research and educational purposes only. It does not provide financial advice. Always conduct your own research and consult with a qualified financial advisor before making investment decisions.


🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.


📄 License

This project is open source and available under the MIT License.


🙏 Acknowledgments

About

AI-powered agent that analyzes stock insider transactions, company news, and price data to generate comprehensive research reports using OpenAI and Streamlit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages