Phase 10 — Local Intelligence Engine
Makes the AI hyper-local — aware of national and regional holidays, cultural greetings, religious calendar, weather disruptions, and seasonal context for the tenant's timezone and location.
What It Does
The Local Intelligence Engine enriches every AI call with contextual awareness. When a caller rings a dental clinic in Chennai on Pongal, the AI knows it's a Tamil Nadu state holiday, greets them with "Vanakkam", mentions the clinic may have adjusted hours, and suggests monsoon-appropriate health tips. All of this is injected automatically into the system prompt before each call.
Key Routes
| URL | Description |
|---|---|
GET /settings/local-intelligence | Local Intelligence settings tab |
POST /settings/local-intelligence | Save location, language, religion, and toggle settings |
GET /settings/local-intelligence/preview | JSON preview of AI context that will be injected |
Key Files
| Type | Path |
|---|---|
| Service | app/Services/LocalIntelligenceService.php — buildAiContext() |
| Model | app/Models/HolidayTemplate.php |
| Table | holiday_templates — country, state, date, name, type (national/religious/regional), religion |
| Seeder | database/seeders/HolidayTemplatesSeeder.php — 98 holidays across 6 countries |
| View | resources/views/settings/local-intelligence.blade.php |
Holiday Database
| Country | Holidays Seeded | Includes |
|---|---|---|
| India 🇮🇳 | ~40 | National + all major religious + state-specific (MH, GJ, TN, PB, KL, WB) |
| United States 🇺🇸 | ~12 | Federal holidays |
| United Kingdom 🇬🇧 | ~8 | Bank holidays |
| UAE 🇦🇪 | ~10 | National + Islamic holidays |
| Singapore 🇸🇬 | ~11 | National holidays |
| Australia 🇦🇺 | ~10 | National public holidays |
Religion-Aware Greetings
| Religion | Greeting | Language |
|---|---|---|
| Hindu | Namaste / Jai Shri Krishna | Hindi |
| Muslim | Assalamu Alaikum | Arabic / Urdu |
| Christian | God bless you / Hello | English |
| Sikh | Sat Sri Akal | Punjabi |
| Jewish | Shalom | Hebrew |
| Tamil | Vanakkam | Tamil |
Weather Disruption Detection
Uses the Open-Meteo free API (no API key required) to detect significant weather events based on WMO weather code. If heavy rain, snow, or storms are detected for the tenant's location, the AI adds a contextual note:
Weather note: Heavy rainfall expected in Mumbai today (WMO code 65).
Patients calling about travel may mention disruptions.
Suggest the business can accommodate appointment reschedules due to weather.
What Gets Injected into the AI System Prompt
LOCAL INTELLIGENCE:
Date: Saturday, 14 Jan 2026 | Time: 10:30 AM IST | Timezone: Asia/Kolkata
Season: Winter (North India) | Region: Maharashtra
Cultural greeting for this context: "Namaste"
Upcoming holiday: Makar Sankranti (15 Jan) — business may be closed.
Today's weather: Clear sky. No disruptions expected.
Regional note: Pongal celebrations ongoing in Tamil Nadu — mention if caller is from TN.
Settings Toggles
At Settings → Local Intelligence, tenants can enable or disable:
- Holiday awareness (show upcoming closures to AI)
- Cultural greetings (religion-aware greeting injection)
- Weather disruption awareness (inject weather context)
- Seasonal recommendations (monsoon/summer/winter service tips)
What's Complete
- 98-holiday database seeded across 6 countries
- Religious holidays engine (6 religion calendars)
- Regional festivals calendar (6 Indian states)
- Local language packs (Hindi, Tamil, Arabic, English) with time-of-day greetings
- Cultural etiquette logic with religion-aware greetings
- Timezone intelligence and season detection per tenant timezone
- Open-Meteo weather disruption detection (WMO code-based)
- Seasonal service recommendations in AI prompt
- LocalIntelligenceService::buildAiContext() wired into ConversationEngine
- Settings UI with 4 toggle switches and upcoming holidays panel (next 60 days)
- Preview API endpoint returning JSON context
What's Deferred
- Accent/local tone engine (needs multilingual TTS)
- Local dialect support (Hindi, Tamil voice — needs multilingual LLM)
- Traffic delay awareness (Google Maps API — paid)
- Geo-location auto-detect (browser geolocation)
- Emergency closure rules from local government alerts