# V3.3 Hybrid AI Local News Classification

## What changed
- RSS and scraping sources now share the same category/location classifier.
- Source-level modes: `strict`, `smart`, `auto`.
- Category modes: `fixed` or `auto`.
- Optional AI fallback uses the existing configured provider/API key; category output is whitelist-restricted.
- Global admin controls: AI classification ON/OFF, minimum confidence, daily call limit.
- Classification provenance is stored on news rows (`category_source`, `location_source`, `ai_confidence`).
- Local News API supports `district`, `districts`, and `division` without GPS while preserving GPS/radius mode.
- Bangladesh geo dictionary now contains all 64 districts (Rajbari added).

## Required production migration
Existing installations must import once:

`database/migration_hybrid_local_classification.sql`

This migration is additive; it does not delete existing news/source rows.

## Sunamganj page example
For a page/feed that is specifically for Sunamganj:
1. Add the RSS or Scrape Source.
2. Select district: `সুনামগঞ্জ`.
3. Choose **Strict** if every article on that page must be treated as Sunamganj.
4. Choose **Smart** if Sunamganj should be the default but explicit article text may override it.
5. Keep AI fallback enabled only when you want ambiguous items checked by the configured AI provider.

## API examples
- `/api/local_news.php?district=sunamganj`
- `/api/local_news.php?districts=sunamganj,sylhet`
- `/api/local_news.php?division=sylhet`
- Existing GPS mode remains: `/api/local_news.php?lat=25.06&lon=91.39&radius=50`

## AI quota safety
AI classification never blocks ingestion. If the API key is absent, classification is disabled, the daily limit is reached, or the provider returns an error, deterministic/source rules are used instead.
