Greeting System¶
The Greeting System generates personalized welcome messages when users open Swisper. It selects the most relevant stored facts using a configurable priority scoring formula (time urgency + fact type + confidence - recency penalty), includes warmth facts for emotional connection, and streams a natural-language greeting with proactive suggestions. The system operates independently from the main chat pipeline for speed, with all scoring parameters tunable at runtime via a database-backed configuration table.
Key Components¶
| Component | Purpose |
|---|---|
| Greeting Node | Orchestrates greeting generation: language detection, prompt variant selection, LLM streaming |
| Fact Preloading Service | Loads and scores facts using the priority formula, caches in Redis for downstream pipeline use |
| Fact Scoring Engine | 0–100 point formula: time urgency (0–50) + fact type priority (0–30) + confidence (0–20) + recency malus (-60–0) |
| Frequency Gate | Prevents over-greeting: configurable minimum gap (default 4 hours) between personalized greetings |
| Greeting Builder | Loads prompt templates, injects facts with temporal metadata, triggers fact rotation marking |
| Runtime Configuration | All scoring parameters stored in fact_preloading_config table, editable via Admin API |
Documentation Sections¶
- Overview — What this module does, how fact selection works, and the scoring system explained
- Architecture — System design, fact scoring formula details, and every configuration knob