StockSense Agent is a full-stack Generative AI system that analyzes real-time news and explains its potential impact on stock behavior using a multi-agent architecture.
⚠️ This system provides AI-driven insights, not financial advice or stock price predictions.
🔗 Live Link: Live Link
StockSense Agent is designed as a multi-agent pipeline where each component performs a specific responsibility:
User Query
↓
Router Agent (intent + entity extraction)
↓
Validation Layer (rule-based + LLM)
↓
Orchestrator
↓
┌───────────────┬───────────────┐
↓ ↓ ↓
News Agent Finance Agent Memory
↓ ↓
Reasoning Agent (LLM)
↓
Structured Output
↓
Frontend UI
- Extracts intent (news, impact, general)
- Identifies company names using LLM + fallback
- Handles vague and multi-company queries
- Fetches real-time news using Tavily API
- Filters and structures relevant company news
- Uses caching to reduce API calls
- Resolves company → ticker
- Fetches stock-related data
- Provides structured financial context
-
Uses LLM to:
- Analyze news impact
- Generate reasoning chain
- Identify risks
- Estimate confidence
-
Adds deterministic conclusion layer
-
Prevents invalid or random inputs
-
Hybrid approach:
- Rule-based filtering
- LLM-based verification
-
Stores:
- last company
- last query
-
Enables multi-turn conversations
-
Reduces latency and API cost
-
TTL-based caching for:
- news data
- financial data
- User submits a query via frontend
- Router Agent extracts intent and company
- Validation layer filters invalid inputs
- Orchestrator controls pipeline execution
- News + Finance agents fetch data
- Reasoning agent analyzes impact
- Structured response is returned
- Frontend renders insights
Analyze a company based on real-time news
{
"query": "Tesla latest news impact",
"user_id": "user123"
}[
{
"company": "Tesla",
"event_summary": ["News headline..."],
"event_type": "earnings / macro",
"impact_direction": "Positive",
"reasoning_chain": ["Step 1...", "Step 2..."],
"risks": ["Risk 1...", "Risk 2..."],
"confidence": "medium",
"conclusion": "Stock may increase",
"disclaimer": "This is an AI-generated analysis..."
}
]{
"message": "Please enter a valid company name (e.g., Tesla, Apple)"
}- Backend: FastAPI
- Frontend: Streamlit
- LLM: OpenAI OSS / Groq
- Search: Tavily API
- Architecture: Multi-Agent System
- Deployment: Render and streamlit cloud
- LLM responses may vary
- Not suitable for real financial decision-making
- Dependent on external APIs
- Multi-agent orchestration instead of single LLM call
- Hybrid validation to reduce hallucination
- Deterministic + LLM combined reasoning
- Session-based conversational memory
- Production-style backend/frontend separation


