A multi-agent AI pipeline that autonomously researches any stock, runs machine learning price prediction, analyzes live news sentiment, and produces a structured investment risk report with a buy/hold/sell recommendation.
Built as a learning project covering TensorFlow, LangGraph, FinBERT, and GPT-4o-mini across a 4-week development sprint.
You enter a stock ticker and company name. FinSight runs a full pipeline of specialized AI agents, each doing a distinct job, and returns a structured risk report with a final recommendation in about 60-90 seconds.
It works for any publicly traded stock on major exchanges. AAPL, TSLA, NVDA, MSFT, GOOGL, or any other ticker you want to research.
User Input (ticker + company name)
|
Data Agent - pulls 5 years of OHLCV data, computes RSI, MACD,
Bollinger Bands via yfinance
|
ML Agent - runs a trained TensorFlow LSTM model to predict
5-day price direction
|
News Agent - fetches recent headlines via NewsAPI, scores
each one with FinBERT sentiment analysis
|
Synthesizer Agent - GPT-4o-mini reasons over all signals and produces
a structured risk report
|
Critic Agent - validates the report logic, rejects and retries
up to 2 times if reasoning is inconsistent
|
Final Report - signal summary, conflict analysis, risk level,
recommendation
| Layer | Technology |
|---|---|
| Price Prediction | TensorFlow, Keras, LSTM |
| Data Pipeline | yfinance, pandas, scikit-learn |
| Sentiment Analysis | FinBERT (ProsusAI), HuggingFace Transformers |
| News Data | NewsAPI |
| Agent Orchestration | LangGraph |
| LLM Reasoning | OpenAI GPT-4o-mini |
| Experiment Tracking | MLflow |
| Frontend | Streamlit, Plotly |
git clone https://github.com/krishsharma5169/FinSight.git
cd FinSightpython -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # Mac/Linuxpip install -r requirements.txtCreate a .env file in the project root:
OPENAI_API_KEY=your_openai_key_here
NEWS_API_KEY=your_newsapi_key_here
Get your OpenAI key at platform.openai.com. Get your NewsAPI key at newsapi.org. The free tier is sufficient.
python models/lstm_model.pyThis pulls 5 years of AAPL data, trains the LSTM, and saves the model and scaler to the models/ directory. Takes 1-2 minutes on CPU.
streamlit run frontend/app.pyOpen your browser at localhost:8501.
On the dashboard you will see two input fields at the top.
-
Enter Stock Ticker: the market ticker symbol. Examples: AAPL, TSLA, NVDA, MSFT, GOOGL, META, AMZN
-
Company Name: the full company name. Examples: Apple, Tesla, Nvidia, Microsoft, Google, Meta, Amazon
The company name drives the NewsAPI headline search. Always use the full company name rather than the ticker abbreviation for better and more relevant news coverage. For example, type "Nvidia" in the company name field, not "NVDA".
Hit Run FinSight Analysis and the pipeline runs automatically. Results appear in about 60-90 seconds depending on your connection speed.
FinSight/
agents/
state.py - shared state definition for LangGraph
data_agent.py - fetches and processes market data
ml_agent.py - runs LSTM inference
news_agent.py - fetches headlines and runs FinBERT
synthesizer_agent.py - GPT-4o-mini risk report generation
critic_agent.py - validates and challenges the report
data/
fetch_data.py - yfinance data pipeline
features.py - RSI, MACD, Bollinger Bands
preprocess.py - sequence creation, train/test split, scaling
news_fetcher.py - NewsAPI integration
sentiment.py - FinBERT sentiment scoring
sentiment_features.py - merges sentiment with price data
models/
lstm_model.py - LSTM architecture, training, MLflow logging
pipeline/
graph.py - LangGraph state graph and routing logic
frontend/
app.py - Streamlit dashboard
This is a research-grade decision support tool, not a trading bot. The LSTM model achieves approximately 55% directional accuracy on held-out data, which is consistent with academic literature on technical-indicator- only models. No financial decision should be made solely on FinSight's output.
NewsAPI free tier returns headlines from the last 30 days only, which means sentiment reflects recent market mood rather than historical context.
- Time-series modeling with TensorFlow LSTM on real financial data
- Transfer learning with FinBERT for domain-specific NLP
- Multi-agent orchestration with LangGraph state graphs
- Experiment tracking with MLflow across model iterations
- Building interactive ML dashboards with Streamlit