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.
- 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
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
- Python 3.9 or higher
- OpenAI API key (Get one here)
- Finnhub API key (Get a free one here)
-
Clone the repository
git clone https://github.com/yourusername/Equity-Insider-Intelligence-Agent.git cd Equity-Insider-Intelligence-Agent -
Create a virtual environment (recommended)
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Start the Streamlit app
streamlit run app.py
-
Open your browser to the URL shown in the terminal (usually
http://localhost:8501) -
Enter your API keys in the sidebar:
- OpenAI API Key
- Finnhub API Key
-
Enter a stock ticker and click "Generate Research Report"
-
Enter API Keys: Add your OpenAI and Finnhub API keys in the sidebar (they're stored securely in your session)
-
Input Stock Ticker: Type any valid stock symbol (e.g.,
AAPL,TSLA,NVDA) -
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)
-
Generate Report: Click the "Generate Research Report" button
-
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
-
Access History: Scroll down to see your saved reports from previous sessions
- Required for generating AI-powered research reports
- Uses GPT-4o-mini model
- Get your key at: https://platform.openai.com/api-keys
- Free tier available with usage limits
- 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
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
- 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
Each AI-generated report includes:
- TL;DR - Quick 4-6 bullet summary
- Insider Activity Analysis - Highlights notable buys, sell patterns, and clustering
- News Catalysts - Key themes and bullish/bearish indicators
- Technical Context - Price vs moving averages and trend analysis
- Risks & Watch Items - What to monitor in the coming week
- Actionable Insights - How traders/investors might use this information (not financial advice)
- 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
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.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is open source and available under the MIT License.