Skip to content
/ Scout Public

Pull news stories based on topic, have LLM summarize and track clusters of events. A simple event monitoring system.

Notifications You must be signed in to change notification settings

cas1m1r/Scout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“° Scout - News Monitor

A powerful real-time news monitoring and analysis system that uses AI to track, cluster, and alert on breaking news events. Built with Python, Flask, and powered by local LLMs via Ollama.

News Monitor Dashboard Python Flask Ollama

✨ Features

πŸ” Smart News Discovery

  • Real-time Google News RSS feed monitoring
  • Custom search topics with 24-hour lookback
  • Automatic story deduplication and clustering (IN PROGRESS)

πŸ€– AI-Powered Analysis

  • Local LLM integration via Ollama (privacy-first)
  • Intelligent event extraction and categorization
  • Context-aware story summarization
  • Status detection (ongoing, announced, escalating)

πŸ“Š Advanced Event Tracking

  • Multi-story event clustering with similarity scoring
  • Freshness, specificity, and impact scoring
  • Cross-source corroboration validation (TODO)
  • Alert cooldown system to prevent spam (TODO)

🌐 Modern Web Interface

  • Responsive Flask web application
  • Real-time search progress with live updates
  • Interactive dashboards for event monitoring (TODO)

🚨 Intelligent Alerting

  • Configurable scoring thresholds (TODO)
  • High-priority event highlighting
  • Timeline tracking with persistent storage (TODO)
  • Status-based alert triggers

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Ollama installed and running
  • Basic familiarity with command line

Installation

  1. Clone the repository

    git clone https://github.com/cas1m1r/Scout.git
    cd news-monitor
  2. Install dependencies

    pip install -r requirements.txt
  3. Configure environment

    cp .env.template .env
    # Edit .env with your settings
  4. Start Ollama and pull a model

    ollama serve
    ollama pull gemma2:2b  # or your preferred model
  5. Run the application

    python flask_news_frontend.py
  6. Open your browser

    http://localhost:5000
    

πŸ“ Project Structure

Scout/
β”œβ”€β”€ πŸ“„ flask_news_frontend.py # Main Flask web application
β”œβ”€β”€ 🧠 llama_utils.py         # Ollama/LLM integration utilities
β”œβ”€β”€ πŸ“° main.py               # Core news processing logic
β”œβ”€β”€ πŸ“Š tracker.py            # Event clustering and tracking system
β”œβ”€β”€ βš™οΈ  template_setup.py     # Template installation script
β”œβ”€β”€ πŸ“‹ requirements.txt      # Python dependencies
β”œβ”€β”€ 🌍 .env.template         # Environment configuration template
β”œβ”€β”€ πŸ“ prompts/
β”‚   └── news_prepper.txt     # LLM prompt for news analysis
β”œβ”€β”€ 🎨 templates/            # Flask HTML templates
β”‚   β”œβ”€β”€ base.html           # Main layout template
β”‚   β”œβ”€β”€ index.html          # Homepage with search
β”‚   β”œβ”€β”€ results.html        # Search results display
β”‚   β”œβ”€β”€ historical.html     # Historical data browser
β”‚   β”œβ”€β”€ event_store.html    # Event tracking dashboard
β”‚   └── error.html          # Error pages
β”œβ”€β”€ πŸ’Ύ logs/                # Application logs
└── πŸ“Š event_store.jsonl    # Persistent event tracking data

🎯 Usage Examples

ui

Basic News Monitoring

  1. Enter a search topic: "climate protests"
  2. Watch real-time progress as stories are analyzed
  3. Review clustered events with AI-generated summaries
  4. Monitor alerts for high-priority developments

Advanced Event Tracking

# Customize scoring parameters
tracker = EventTracker(
    cooldown_minutes=30,    # Time between alerts for same event
    min_score=60           # Minimum score for high-priority alerts
)

API Integration

# Get system status
curl http://localhost:5000/api/status

# Export topic data
curl http://localhost:5000/api/export/climate_protests

# Get cluster details
curl http://localhost:5000/api/cluster/ice-enforcement-chicago

βš™οΈ Configuration

Environment Variables

# Required: Ollama host (without http://)
URL=localhost

# Optional: ComfyUI integration (for future image analysis)
COMFY=localhost

# Flask settings
FLASK_ENV=production
FLASK_DEBUG=False

# Model configuration
DEFAULT_MODEL=gemma2:2b

Customizing Event Scoring

The system scores events on multiple dimensions:

  • Freshness (0-40): How recent the story is
  • Specificity (0-30): Concrete locations, actors, actions
  • Corroboration (0-20): Multiple credible sources
  • Impact (0-10): Public safety implications

Edit tracker.py to adjust scoring weights for your use case.

LLM Models

Compatible with any Ollama model. Recommended options:

Model Size Speed Quality Best For
gemma2:2b 1.6GB ⚑ Fast Good Development/Testing
llama3.1:8b 4.7GB πŸ”„ Medium Better Production
qwen2.5:14b 8.7GB 🐌 Slow Best High Accuracy

πŸ”§ Advanced Features

Historical Data Analysis

  • Browse all previously monitored topics
  • Export complete datasets as JSON
  • Timeline analysis of event evolution
  • Cross-topic pattern recognition

Real-time Monitoring

  • WebSocket-based live updates
  • Configurable refresh intervals
  • Background processing with progress tracking
  • Multi-topic concurrent monitoring

Integration Ready

  • RESTful API endpoints
  • JSON export functionality
  • Webhook support (coming soon)
  • Database integration options

πŸ“ˆ Monitoring Dashboard

The web interface provides several views:

🏠 Home Dashboard

  • Start new topic searches
  • Real-time progress tracking
  • Quick access to recent searches

πŸ“Š Event Store

  • All tracked events with scores
  • Alert history and patterns
  • Cluster analysis and trends

πŸ“ Historical Browser

  • Previously searched topics
  • Data export capabilities
  • Timeline views

πŸ›‘οΈ Privacy & Security

  • Local Processing: All AI analysis runs on your hardware
  • No Data Sharing: Stories and analysis stay on your system
  • Configurable Sources: Control which news feeds to monitor
  • Rate Limiting: Respects news source rate limits

🚨 Troubleshooting

Common Issues

"URL environment variable not set"

# Check your .env file
cat .env
# Should contain: URL=localhost

"No news articles found"

  • Try broader search terms
  • Check internet connectivity
  • Verify Google News access

LLM Processing Errors

# Check if Ollama is running
curl http://localhost:11434/api/tags

# Pull the model if needed
ollama pull gemma2:2b

Template Errors

# Regenerate templates
python template_setup.py

Performance Optimization

  • Use smaller models for faster processing
  • Adjust cooldown_minutes for your monitoring needs
  • Clean up old data files periodically
  • Monitor disk space usage

🀝 Contributing

We welcome contributions! Here are some areas where help is needed:

🌟 Enhancement Ideas

  • Additional news source integrations (Reddit, Twitter, etc.)
  • Advanced clustering algorithms (semantic similarity)
  • Email/SMS alerting system
  • Mobile-responsive improvements
  • Database backend
  • Docker containerization

πŸ› Bug Reports

Please include:

  • Operating system and Python version
  • Ollama version and model used
  • Complete error traceback
  • Steps to reproduce

πŸ“ Documentation

  • Use case examples
  • API documentation
  • Deployment guides

πŸ“„ License

This project is released under the MIT License. See LICENSE for details.

πŸ™ Acknowledgments

  • Ollama for local LLM infrastructure
  • Flask for the web framework
  • feedparser for RSS processing
  • The open source community for inspiration and tools

⭐ If you find this project useful, please star it on GitHub!

Built with ❀️ for journalists, researchers, and anyone who needs to stay informed about rapidly evolving news events.

About

Pull news stories based on topic, have LLM summarize and track clusters of events. A simple event monitoring system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published