User Input
User types: "How do I help my kid sleep better?"
Text input
On-Device Model — Gemma 4 E4B
Purpose: Intent classification only
Input: User message + compressed context (~1,750 tokens)
Output: {skill_id: "parent-coach", confidence: "high"}
Latency: ~200ms, zero server cost
Classification only
If confidence > 0.6 → local action, else → call server
Local Actions (Zero-Token)
For deterministic skills:
"Remind me to call doctor" → creates reminder (0 tokens)
"Add milk" → adds to shopping list (0 tokens)
Skillify scripts — cached, native execution
0 token, native
On-Device Storage
SwiftData / SQLite
• Chat history (6 turns)
• Deep Profile (snapshot)
• Skillify scripts
• learnings.jsonl
Private · Never leaves
🚀
Server (HERMES Cluster)
HERMES Gateway
• Routes Telegram → user profile lookup
• Stateful persistence (logins, cookies)
• No intelligence — just orchestration
Routing only
Skill Engine API — CORE INTELLIGENCE
This is where the magic happens:
• Receives: {message, skill_id, user_id}
• Routes to 6 archetypes (Action, Coach, etc.)
• Runs workflow with community-augmented gBrain
• Executes BCTs, Journey pipelines, Skillify
• Calls LLMs only when needed
Central intelligence
Personalization & Deep Profiling
Happens ONLY in Skill Engine:
• Daily deep_profile.run_pipeline()
• BCT classification, Maslow level, Hughes needs
• Formative years, rapport tracking
• Injects hints into response context
• Updates learnings.db and JSONL
Only here
LLM Tier Routing
• If template → returns response (0 tokens)
• Else → call LLM:
① Gemma 4 4B/8B/O4B (local GPU via Ollama)
② Claude Sonnet (OpenRouter)
③ Opus/DeepSeek (escalation)
As needed
Hermès Learning (Opt-in)
• Private: Per-user gBrain (SQLite)
• Community: Global patterns (anonymized)
— "78% of parents with 6yo struggle with sleep"
— "3:30 PM = peak reminder time"
• Only after 10+ messages
• Opt-in: Settings → Community Learning
Enhances Skill Engine