OiMy — Cloud Architecture (Non-Local)

Full E2E flow · Telegram-native · No on-device model dependency · Tested on Hetzner

📱 Telegram / WhatsApp / Web

User sends message via any platform. Routed through Hermes Gateway to Skill Engine API.

User types message
Telegram Bot API
Hermes Gateway (port 18789)
Skill Engine API (port 8001/8002)

🧠 Intent Classification

Gemma 4 31B via OpenRouter TESTED 5/5

System prompt: 83 skills compressed into ~9K chars. Model returns skill_id only. Temperature 0, max 20 tokens.

Router Performance

Accuracy: 100% (5/5 test messages)
Avg latency: 843ms
Cost: $0.12/1M tokens (~$0.00002/route)
Daily cost @ 100 msgs/user: $0.002

Output Format

{"skill_id": "patpat", "confidence": "high"}

If confidence < threshold → escalate to chat-turn (free-form conversation)

Action

20

Deterministic. SQLite CRUD. Zero LLM after codification.

shopping-list, reminders, notes

Coach

30

Template + tall model escalation. BCT nudges injected.

patpat, wellness, parenting

Expert

7

Knowledge + triage. Medical disclaimer. Always tall model.

symptom-triage, speech-therapy

Planner

10

Structured pipeline. Constraint extraction → plan assembly.

travel, meal-plan, study-plan

Monitor

8

Cron-triggered. State diff. Alert on change.

weather, elder-checkin, commute

Profile

3

CRUD. Onboarding flow. No LLM needed.

onboarding, profile-system

🔬 Inference Engine BUILT

Passively extracts signals from every conversation. No explicit interview. Builds confidence over time.

VariableSourceStatus
Family roleSignal extractionBuilt
Pain pointsSignal extractionBuilt
Communication styleSignal extractionBuilt
Message paceTiming analysisBuilt
Goals (inferred)Signal extractionBuilt
Kids' needsSignal extractionBuilt
Preferred timingUsage patternsBuilt
Weekly rhythmPattern detectionBuilt
Avoid topicsNegative signalsBuilt
Skills usageTrackingBuilt

🧬 Deep Profiling Pipeline PARTIAL

Multi-classification pipeline using tall model. Runs after N messages (threshold-gated).

ClassificationModelStatus
Chase Hughes NeedsClaude SonnetBuilt (6 needs)
Hughes Decision StyleClaude SonnetBuilt (6 styles)
Maslow LevelClaude SonnetBuilt
Rapport ScoreRule-basedBuilt
Stage of ChangeClaude SonnetBuilt (per-goal)
Formative YearsClaude SonnetBuilt
Big Five (OCEAN)EMA from signalsSchema only
DISCWeb app onlyNot in engine
Attachment StyleWeb app onlyNot in engine
Core WoundWeb app onlyNot in engine

⚙️ Barrier → Stage → BCT → NLP → Response

BCT_MAP NLP patterns Agenda templates Barrier detection Motivator detection

Barrier Detection

10 categories: forgetfulness, overwhelmed, lack_of_confidence, lack_of_planning, low_motivation, social_pressure, environment, knowledge_gap, guilt_shame, plateau

⚠️ Aliases exist but no auto-extraction from chat. Must be passed explicitly.

Motivator Detection

Hughes Decision: security, comfort, status, belonging, autonomy, identity

❌ Stored in DB (profile_hughes_decision) but never auto-detected from conversation. Only set by deep profile pipeline.

BCT Selection

20 BCTs mapped. Formula:
barrier × stage × needs → BCT + NLP pattern

✅ Full lookup engine with NLP opener generation.

BCT Flow (per coaching interaction)

Detect barrier from message
Look up user's stage of change
Get Hughes needs from profile
Select BCT + NLP pattern
Generate personalized opener

📋 Agenda Manager NOT WIRED

Schema exists. CRUD methods exist. But not called by api.py.

What should happen per session:

  1. Load previous session's uncompleted actions
  2. Check if atomic actions were done (gentle ask)
  3. Inject hypothesis tests into conversation
  4. Track new actions committed this session

📝 Journey Planner BUILT

Multi-session BCT implementation plan. Different from Agenda Manager.

Templates: action_planning, habit_formation, awareness_building, social_restructuring

Each has 4 sessions with specific BCT targets and goals. Generated from bct_engine.generate_agenda().

🤖 Model Selection

Tier 1: Template

0 tokens. Pre-written responses for common coaching scenarios. 6 skill categories × ~6 scenarios each.

Covers ~40% of coach interactions

Tier 2: Gemma 4 31B

$0.12/1M. Intent routing, scenario classification, parameter extraction.

google/gemma-4-31b-it via OpenRouter

Tier 3: Claude Sonnet 4.6

$3/1M in, $15/1M out. Complex coaching, deep profile synthesis, expert triage.

anthropic/claude-sonnet-4-6 via OpenRouter

💾 Storage Layer

SQLite (Per-User)

23 tables: profiles, coach_sessions, plans, inference_signals, profile_rapport, profile_maslow, profile_hughes_needs, profile_hughes_decision, profile_stage_change, profile_formative_years, recent_messages, etc.

GBrain (Cross-Session)

PGLite + pgvector. Entity extraction, semantic search, knowledge graph. Used for long-term context recall.

Hermes Memory

MEMORY.md (2200 chars) + USER.md (1375 chars) injected into system prompt. SQLite FTS5 for full-text session search.

🛡️ Cultural Guardrails BUILT

Restricted phrases for collectivist/multi-generational families:

  • Never say "set a boundary" or "your house your rules"
  • Never say "tell your mother-in-law"
  • Use indirect framing through partner as intermediary
  • Frame as expert recommendation to preserve elder dignity

⚕️ Medical Disclaimer BUILT

All expert archetype responses include:

"⚠️ I'm an AI assistant, not a doctor. This information is for reference only. If you're experiencing a medical emergency, call 911."

GapSeverityWhat ExistsWhat's Missing
Agenda wiring HIGH Schema + CRUD in profile.py api.py doesn't load/inject/verify agenda per session
Barrier auto-detection HIGH BARRIER_ALIASES dict with keyword lists No NLP extraction step in coach flow — barriers must be passed explicitly
Motivator auto-detection HIGH Hughes decision table in DB Only set by deep profile pipeline — not extracted from individual messages
Cross-session action check HIGH complete_session_action() method Coach doesn't check previous session's uncompleted actions
Big Five inference MED Schema + update_big_five() with EMA Inference engine doesn't call it — no signal→trait mapping
Action archetype OpenRouter MED Router adapted for OpenRouter Action param extraction still calls local Ollama endpoint
DISC / Attachment / Core Wound MED In web app profile-context.ts Not in skill engine — only in production web app
Built & tested
Partial / schema only
Gap — needs implementation
Model/infra component

OiMy Platform · Cloud Architecture v2 · May 2026 · Tested on Hetzner 116.203.107.13