insideX is an AI-driven platform that monitors financial news, detects anomalies, and provides threat-level insights (0–10) for stocks in real-time. It combines Perplexity AI for latest news, Pathway for memory & vector retrieval, Claude AI for anomaly detection, and MongoDB for persistence.
- 📡 Live Stock News Fetching via Perplexity API
- 🧠 Real-time Vector Memory using Pathway (RAG-style retrieval)
- 💾 Persistent Storage of raw news in MongoDB
- 🔍 Anomaly Detection powered by Claude 3.5 Sonnet
- ⚖️ Threat Level Scoring (0–10) with reasoning based on past cases
- 💬 Follow-up Questions (Chat-style queries for deeper insights)
- ⚡ FastAPI + Uvicorn backend with REST API endpoints
┌──────────────┐
│ User Query │
└──────┬───────┘
│
/analyze (FastAPI)
│
┌───────────┴─────────────┐
│ │
Perplexity API Pathway Memory (Vector DB)
(latest news) + MongoDB (persistent store)
│ │
└───────────┬─────────────┘
│
Claude 3.5 Sonnet
(Anomaly detection + summary)
│
Threat Score (0–10) + Report
- Backend Framework: FastAPI (Python)
- Vector Database / Memory: Pathway (real-time indexing + retrieval)
- Embeddings Model: BGE-base-en-v1.5 (Hugging Face)
- LLM Reasoning: Claude 3.5 Sonnet (Anthropic)
- External Data Source: Perplexity API
- Database: MongoDB (stores raw news docs)
- Server: Uvicorn (ASGI for FastAPI)
- Config & Secrets: dotenv (.env)
- Frontend (planned): React.js + TailwindCSS
insideX/
│── backend/
│ ├── main.py # FastAPI app entry
│ ├── llm.py # LLM orchestration (Perplexity + Claude + Threat model)
│ ├── vector_store.py # Pathway memory & retrieval
│ ├── embeddings.py # Embedding model (BGE)
│ ├── db.py # MongoDB helper (save/retrieve news)
│ └── requirements.txt # Python dependencies
│
│── frontend/ (planned) # React.js + Tailwind UI
│
│── .env.example # Sample env file
│── README.md # Documentation
git clone https://github.com/your-username/insideX.git
cd insideXpython3 -m venv .venv
source .venv/bin/activate # Linux/Mac
# OR
.venv\Scripts\activate # Windows PowerShellpip install -r backend/requirements.txtCreate a .env file in the project root:
# MongoDB
MONGO_URI=mongodb://localhost:27017
MONGO_DB=insideX
MONGO_COLLECTION=news
# API Keys
perplexity_api=your_perplexity_api_key
perplexity_url=https://api.perplexity.ai/chat/completions
ANTHROPIC_API_KEY=your_anthropic_api_keyuvicorn backend.main:app --reloadPOST /analyze
Request body:
{
"stock": "Tata Motors"
}Response:
{
"stock": "Tata Motors",
"perplexity_analysis": "...",
"retrieved_context": [...],
"final_report": [
"• Anomaly detected in EV unit... (source link)",
"• No issue found in quarterly earnings... (source link)",
"• Threat Score: 7/10"
]
}- User queries:
"Analyze Tata Motors" - Perplexity fetches latest stock news.
- News gets stored in MongoDB + Pathway memory (for RAG).
- Claude AI summarizes anomalies into 5 bullet points.
- A Threat Score (0–10) is generated based on past similar cases.
- User can ask follow-up questions (“What was all-time high?”).
- 📈 Add frontend dashboard (React + Tailwind)
- 🔔 Real-time alerts (email/Slack integration)
- ⚡ Upgrade Pathway to ANN index (HNSW/USearch) for scaling
- 📊 Add stock price + chart integration
- 🔮 More advanced risk modeling
Contributions, issues, and feature requests are welcome! Open a PR or start a discussion under Issues.
MIT License © 2025 insideX