An AI-powered multi-agent system for real-time financial news analysis using OpenAI GPT-4o and Exa API.
- Python 3.9+
- OpenAI API Key
- Exa API Key
- Redis (optional)
- PostgreSQL (optional)
- Clone and Setup
git clone https://github.com/yourusername/FinFlash.git
cd FinFlash
# Windows
scripts\setup.bat
# Linux/Mac
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt- Configure Environment
cp .env.example .env
# Edit .env with your API keys- Run Application
python run.py # Default
python run.py --port 8080 # Custom port
python run.py --debug # Debug modegraph TB
subgraph "Input Sources"
Text[Text Query]
Audio[Audio File]
YouTube[YouTube URL]
end
subgraph "Data Collection"
ResearchAgent[Research Agent<br/>Exa API]
SpeechAgent[Speech Agent<br/>Whisper API]
end
subgraph "Analysis Pipeline"
SentimentAgent[Sentiment Agent<br/>GPT-4o]
ExtractionAgent[Extraction Agent<br/>GPT-4o]
RiskAgent[Risk Agent<br/>GPT-4o]
end
Orchestrator[Orchestrator]
SummaryAgent[Summary Agent<br/>GPT-4o]
Output[Analysis Report]
%% Flow connections
Text --> ResearchAgent
Audio --> SpeechAgent
YouTube --> SpeechAgent
ResearchAgent --> Orchestrator
SpeechAgent --> Orchestrator
Orchestrator --> SentimentAgent
Orchestrator --> ExtractionAgent
Orchestrator --> RiskAgent
SentimentAgent --> SummaryAgent
ExtractionAgent --> SummaryAgent
RiskAgent --> SummaryAgent
SummaryAgent --> Output
%% Styling
classDef inputStyle fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
classDef collectionStyle fill:#48bb78,stroke:#38a169,stroke-width:2px,color:#fff
classDef analysisStyle fill:#ed8936,stroke:#dd6b20,stroke-width:2px,color:#fff
classDef orchestratorStyle fill:#9f7aea,stroke:#805ad5,stroke-width:2px,color:#fff
classDef outputStyle fill:#4ade80,stroke:#fff,stroke-width:2px,color:#000
class Text,Audio,YouTube inputStyle
class ResearchAgent,SpeechAgent collectionStyle
class SentimentAgent,ExtractionAgent,RiskAgent analysisStyle
class Orchestrator,SummaryAgent orchestratorStyle
class Output outputStyle
- Research Agent: Searches and collects financial news using Exa API
- Speech Agent: Transcribes audio/video content using Whisper API
- Sentiment Agent: Analyzes market sentiment and fear/greed indicators
- Extraction Agent: Extracts entities, events, and financial metrics
- Risk Agent: Assesses risks and provides investment recommendations
- Summary Agent: Generates comprehensive analysis reports
- Real-time news acquisition and analysis
- Flexible processing modes (sequential/parallel/adaptive)
- Comprehensive RESTful API
- Batch processing capabilities
- WebSocket support for live updates
curl -X POST http://localhost:5000/api/analysis/text \
-H "Content-Type: application/json" \
-d '{
"content": "Apple reports record Q4 earnings...",
"source": "Reuters"
}'curl -X POST http://localhost:5000/api/analysis/audio \
-F "file=@news_audio.mp3" \
-F "source=podcast"curl -X POST http://localhost:5000/api/analysis/search \
-H "Content-Type: application/json" \
-d '{
"query": "Tesla earnings report",
"num_results": 10
}'{
"news_id": "uuid",
"status": "completed",
"analyses": {
"sentiment": {
"sentiment": "positive",
"score": 0.85,
"fear_greed_index": 72
},
"extraction": {
"entities": {...},
"events": [...],
"metrics": {...}
},
"risk": {
"risk_level": "medium",
"impact_score": 6.5,
"recommendations": [...]
}
},
"summary": {
"executive_summary": "...",
"key_insights": [...],
"action_items": [...]
}
}# Required
OPENAI_API_KEY=your-openai-key
EXA_API_KEY=your-exa-key
# Optional
DATABASE_URL=sqlite:///financial_news.db
REDIS_URL=redis://localhost:6379/0
SECRET_KEY=your-secret-keyconfig/config.yaml- Base configurationconfig/development.yaml- Development settingsconfig/production.yaml- Production settingsconfig/testing.yaml- Test configuration
FinFlash/
├── agents/ # AI Agents
├── app/ # Flask Application
│ ├── routes/ # API endpoints
│ ├── templates/ # HTML templates
│ └── static/ # CSS/JS/Images
├── config/ # Configuration files
├── core/ # Core components
├── services/ # External services
├── scripts/ # Utility scripts
└── docker/ # Docker configuration
# Build and run
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down# Run all tests
python run.py --test
# Run with coverage
pytest --cov=. --cov-report=htmlMIT License - see LICENSE file for details.
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Create an issue on GitHub
- Check logs in
logs/directory - Review configuration in
config/directory