SENTINEL is an institutional-grade financial market intelligence platform combining deep learning price forecasting, natural language processing for sentiment analysis, Bayesian belief networks, and epistemic uncertainty filters.
Instead of operating as a traditional automated execution bot, SENTINEL acts as a cognitive market analysis organism. It integrates technical price regression with NLP sentiment analysis, multi-timeframe regime detection, and safety governanceβincluding an Epistemic Humility Protocol and Silence Intelligence that suppresses predictions when market ambiguity exceeds quantifiable confidence thresholds.
The system operates across a 6-tier intelligence pipeline orchestrated by the Fusion Engine:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β WEB DASHBOARD (Next.js 16 + React 19) β
β Framer Motion Β· Tailwind CSS Β· Holographic Fallback β
ββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β HTTP (REST)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FASTAPI NEURAL CORTEX (main.py) β
β Port 8000 Β· CORS Enabled β
ββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TIER 4-6: COGNITIVE GOVERNANCE β
β β’ Transcendent Intelligence (Epistemic awareness, daily budget) β
β β’ Omega Intelligence (Silence protocol & ambiguity suppression)β
β β’ Elite Governance (Hard risk filters & decision audit) β
ββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TIER 1-3: FUSION & INFERENCE ENGINE β
β β’ Bayesian Belief Networks (Prior/Posterior Regime Odds) β
β β’ Decision Quality (Drawdown-aware confidence estimation) β
β β’ Fusion Aggregation: 0.6 Γ LSTM + 0.4 Γ Sentiment β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ¬ββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββββ
β LSTM TREND PREDICTOR β β FINBERT SENTIMENT β
β β’ PyTorch 2-layer LSTM β β β’ Hugging Face FinBERT β
β β’ 60-day rolling window β β β’ TextBlob / VADER fallbackβ
ββββββββββββββ¬βββββββββββββ βββββββββββββββ¬ββββββββββββββ
β β
ββββββββββββββββ¬ββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββ
β DATA INGESTION β
β β’ Yahoo Finance (yfinance) β
β β’ Alpha Vantage Connector β
βββββββββββββββββββββββββββββββ
| Tier | Name | Core Functionality | Primary Components |
|---|---|---|---|
| Tier 1 | Core Analytic | Price trend regression & short-term trajectory | PyTorch 2-layer LSTM (lstm_model.py), yfinance data loader (stock_data.py) |
| Tier 2 | Contextual | Multi-timeframe trend alignment & sentiment | FinBERT NLP model (sentiment_engine.py), Reddit/news ingestors (fetch_social.py) |
| Tier 3 | Decision Quality | Capital preservation and confidence weighting | Drawdown-aware penalty model (decision_quality.py), Bayesian belief network (bayesian_belief.py) |
| Tier 4 | Elite Governance | Institutional rules, bounds, and audit checks | Hard risk constitution (elite_governance.py), guardrails (advanced_guardrails.py) |
| Tier 5 | Omega Sentience | Silence protocol & ambiguity discrimination | Silence Intelligence (omega_intelligence.py), uncertainty tools (uncertainty_tools.py) |
| Tier 6 | Transcendent | Epistemic awareness, cognitive budgeting, ethics | Daily insight budgeting (transcendent_state.json), moral restraint (transcendent_intelligence.py) |
- Sequential Deep Learning Forecasts: 2-layer PyTorch LSTM model trained on 60-day rolling OHLCV windows to estimate expected price trajectories.
- Financial NLP Sentiment: Sentiment classification using Hugging Face Transformers (
ProsusAI/finbert) with automatic fallback to VADER and TextBlob when GPU/model weights are unavailable. - Bayesian Belief Networks: Dynamic probability distributions evaluating likelihood across Bullish, Neutral, and Bearish regimes.
- Epistemic Humility & Silence Protocol: Automatically silences buy/sell signals when epistemic ambiguity (unknown unknowns) exceeds risk thresholds, preventing over-trading during regime shifts.
- Daily Insight Budgeting: Limits cognitive inferences to preserve high conviction hypotheses and reduce noise amplification.
- Hybrid Deployment Support: Fully decoupled web dashboard (Next.js) and computation core (FastAPI), with built-in client-side holographic mock telemetry for offline demonstration.
- Multi-Asset Telemetry: Pre-configured analysis targets for
BTC-USD,AAPL,TSLA,MSFT,^NSEI, and^NSEBANK. - Offline CLI Inference: Standalone command-line inference tool (
cli_predict.py) for rapid local queries without launching the UI.
- Language: Python 3.10+ (tested on Python 3.12)
- Deep Learning: PyTorch (
torch), Scikit-learn - NLP: Hugging Face Transformers (
transformers), VADER (vaderSentiment), TextBlob - API Framework: FastAPI, Uvicorn, Pydantic
- Statistical Modeling: SciPy, NumPy, Pandas
- Data Providers: Yahoo Finance (
yfinance), Alpha Vantage (alpha_conn.py), PRAW (Reddit API)
- Framework: Next.js 16.1 (App Router, Turbopack)
- Library: React 19.2
- Language: TypeScript 5
- Styling: Tailwind CSS v4
- Animation & Visuals: Framer Motion 12, Lucide React, Recharts 3
.
βββ backend/ # Python AI & API Engine
β βββ modules/ # Core Intelligence Modules
β β βββ advanced_analysis.py # Multi-factor market analytics
β β βββ advanced_guardrails.py # Runtime boundaries & execution constraints
β β βββ alpha_conn.py # Alpha Vantage integration connector
β β βββ backtest_tracker.py # Prediction history logger
β β βββ bayesian_belief.py # Bayesian belief network & regime odds
β β βββ database.py # SQLite persistence utility
β β βββ decision_quality.py # Confidence decay and drawdown scoring
β β βββ elite_governance.py # Hard risk constitution & compliance
β β βββ fusion.py # Central ensemble fusion engine
β β βββ lstm_model.py # PyTorch 2-layer LSTM sequential model
β β βββ omega_intelligence.py # Silence protocol & ambiguity filter
β β βββ sentiment_engine.py # FinBERT and lexical sentiment analyzer
β β βββ stock_data.py # Market data ingestion (yfinance)
β β βββ transcendent_intelligence.py # Epistemic budget & ethics engine
β β βββ uncertainty_tools.py # Entropy & epistemic bounds tools
β βββ data/ # State and data ingestion scripts
β β βββ fetch_prices.py # Standalone price fetch utility
β β βββ fetch_social.py # Standalone Reddit/social scraper
β β βββ transcendent_state.json # Daily cognitive budget state store
β βββ .env.example # Template for external API credentials
β βββ cli_predict.py # CLI entry point for predictions
β βββ list_models.py # Model directory / inspection script
β βββ main.py # FastAPI server entry point
β βββ requirements.txt # Complete Python dependencies
β βββ requirements_lite.txt # Lightweight dependencies (no PyTorch/Transformers)
β βββ test_system.py # System self-verification test script
βββ data/ # Reference test fixtures & backtest data
β βββ backtest_history.json # Historical prediction log
β βββ raw/ # Sample reference CSVs (BTC-USD OHLCV & sentiment)
βββ frontend/ # Next.js Web Dashboard
β βββ app/
β β βββ actions.ts # Server action connecting UI to FastAPI / mock
β β βββ globals.css # Tailwind CSS imports & theme definitions
β β βββ layout.tsx # Root HTML layout with Geist font
β β βββ page.tsx # Dashboard interface with real-time telemetry
β βββ lib/
β β βββ mockData.ts # Holographic telemetry mock payload
β β βββ utils.ts # Class merging (clsx + tailwind-merge)
β βββ public/ # Static assets (favicon.png)
β βββ eslint.config.mjs # ESLint 9 configuration
β βββ next.config.ts # Next.js configuration
β βββ package.json # Frontend package dependencies & scripts
β βββ postcss.config.mjs # PostCSS configuration
β βββ tsconfig.json # TypeScript configuration
βββ .gitignore # Git exclusion rules
βββ LICENSE # MIT License
βββ PRODUCTION_DEPLOYMENT.md # Cloud deployment guide (Render + Vercel)
βββ README.md # Repository documentation
βββ SYSTEM_GUIDE.md # Detailed architectural walkthrough
βββ TRANSCENDENT_VISION.md # Theoretical paper on the 6-tier architecture
- Node.js:
18.18+or20+(verified with Node.js 26) - npm:
9+(verified with npm 11) - Python:
3.10+(tested with Python 3.12) - Git
git clone https://github.com/nfsprogramming/Sentinel-Intelligence.git
cd Sentinel-Intelligencecd frontend
npm install
npm run devThe web dashboard is now accessible at http://localhost:3000. By default, if the backend server is offline, the frontend operates in Holographic Demo Mode, displaying verified sample telemetry.
Open a separate terminal window:
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
.\venv\Scripts\activate
# Linux/macOS:
source venv/bin/activate
# Install dependencies (for complete deep learning & NLP pipeline):
pip install -r requirements.txt
# Or for lightweight testing without PyTorch / Transformers:
# pip install -r requirements_lite.txt
# Configure environment variables (optional):
cp .env.example .envTo run the FastAPI server:
python main.pyThe API starts at http://127.0.0.1:8000.
- Launch both the backend (
python main.py) and frontend (npm run dev). - Open http://localhost:3000.
- Select an asset (
BTC-USD,AAPL,TSLA,MSFT,^NSEI,^NSEBANK) or click Run Market Analysis. - Review the 6-tier telemetry:
- Regime Classification: Current market phase and volatility state.
- Bayesian Distribution: Bullish, Neutral, and Bearish posterior probabilities.
- Silence Status: Indicates whether the Omega tier has approved or suppressed signal output.
- Cognitive Budget: Inferences consumed vs. daily quota.
To run predictions directly from the terminal without the web server:
cd backend
python cli_predict.py --ticker BTC-USDcd frontend
npm run lint # ESLint check (passes with 0 errors)
npm run build # Next.js production build verificationWith the Python environment active:
cd backend
python test_system.py- Proprietary Bounds: As noted in institutional filings, high-frequency execution drivers and proprietary alpha weights for real-money execution are decoupled from this public repository.
- First-Run Weight Download: Initial execution of
test_system.pyormain.pyrequires downloading the FinBERT model weights (~440 MB) from Hugging Face. - API Rate Limits: Yahoo Finance and Reddit APIs impose rate limits during high-frequency querying. For continuous production streaming, dedicated API keys should be populated in
backend/.env.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/improvement). - Ensure all tests and linting pass (
npm run lintandnpm run buildinfrontend/). - Commit your changes (
git commit -m "Add feature"). - Push to the branch (
git push origin feature/improvement). - Open a Pull Request.
This project is licensed under the MIT License. Copyright (c) 2026 NFS Programming.