OiMy — Complete Architecture v7

Family AI Companion · Hermes + Kimi K2.6 + GPT-5.4 Mini + Opus 4.8 · Updated 2026-05-31

Contents

What Changed in v7
NPS Progression
Full Architecture Diagram
Model Stack
Memory Stack
Deep Profile — All Layers
Intelligent Profile Router
BCT + NLP Selection
Status: Live vs Next
Hermes SOUL.md

What Changed in v7

🐛 10 Bugs Fixed (were in spec, broken in implementation)

1
zero.yaml workflow_type: monitor — The catch-all skill for "things I can't do natively" was routing to the Monitor archetype, returning "✅ Last checked… No new alerts" for every unrecognised message. Fixed: workflow_type: expert
2
active_thread stuck across sessions — Reset endpoint returned 401 (missing JWT auth), leaving stale thread in SQLite for 300s. All messages went to whichever skill was active in the previous test run. Fixed: JWT auth on reset + NO_THREAD_SKILLS set for delegation skills.
3
Router model = gemma4:e4b — An Ollama local tag. OpenRouter doesn't have this model so routing silently returned "chat" for everything. Fixed: ROUTER_MODEL=openai/gpt-5.4-mini now correctly uses the 17KB cached GPT-5.4 Mini prompt.
4
ChatRouter trapped users in previous skill — Once any skill was active, 100% of subsequent messages returned that skill (confidence 0.90) for 300s regardless of topic. Fixed: LLM routing runs even with active thread; if LLM returns ≥0.70 confidence on a different skill, the thread is cleared.
5
PlannerArchetype travel fields contaminating meal-planning — "I don't have your destination, travelers, dates to verify this fits" was returned for dinner questions. Fixed: skill-scoped constraint checks (travel fields only for travel skills).
6
CoachArchetype.generate_tall_model_response was a stub — Had a comment "This would call OpenRouter API in production. For now, return a placeholder." Never called Kimi K2.6. Fixed: actually calls Kimi K2.6 via OpenRouter, max_tokens=1500 (extended reasoning headroom).
7
REQUEST_BUDGET_S = 8s — Kimi K2.6 with extended reasoning takes 15-30s per call. Every request timed out silently, returning the degraded fallback. Fixed: OIMY_REQUEST_BUDGET_S=50 default (configurable).
8
Circuit breaker threshold = 3 — After 3 timeout failures, the chat_request circuit opened and ALL subsequent calls returned instant degraded fallback. Fixed: threshold=10, cooldown=120s.
9
Honcho + vector memory blocking responses for 25s — Both write-back calls were inside route_and_execute with no timeout protection. Honcho's API was slow (8-25s). Fixed: moved to background daemon threads, response returns immediately.
10
OLLAMA_BASE_URL masking OpenRouter detection — The Ollama client library sets OLLAMA_BASE_URL=http://127.0.0.1:11434 in the environment. OiMy's URL detection check picked this up as "OLLAMA_URL is set → don't use OpenRouter", falling back to localhost. Fixed: only check OLLAMA_URL (OiMy's own var); OLLAMA_BASE_URL is Ollama's client lib var and is ignored.

✨ New Features Deployed

FeatureWhat
meal-planning → coachChanged workflow_type: plannercoach. Now uses Kimi K2.6 for conversational dinner suggestions instead of template "3-day plan" boilerplate.
deep-inference-v6.txtOpus 4.8 comprehensive rewrite — 467 lines. All 11 layers. 9 psychological frameworks (Chase Hughes needs/fears/decisions, Enneagram, DISC, OCEAN, Attachment Theory, Maslow, TTM, Bowen Family Systems, Hofstede). 30-50 inferences, cross-domain tags, negative personalization, forward projection, 3 worked multi-hop examples.
Intelligent Profile Routerget_inferences_for_skill(user_id, skill_id) — filters Opus-tagged inferences by skill_domains JSON array. No static mapping. Each inference tagged by Opus at synthesis time for all relevant skills including non-obvious cross-domain connections.
Vector memory → OpenAISwitched from all-minilm (384-dim, Ollama, silently failing) to text-embedding-3-small (1536-dim, OpenAI direct API). Semantic search now works.
EntityExtractorNew module. GPT-5.4 Mini batch at session end. Extracts: named people, children (name/age/notes), pets, schedule events, health context, specific barrier values, preferences, locations. Stored in SQLite, injected into Kimi context.
Specific barrier/motivator valuesRule-based + pattern extraction wired into InferenceEngine.record_signal. Stores the exact constraint value (e.g. "peanut allergy") not just the category.
Rhythm Engine cronMorning brief (8am) + evening closeout (8pm) wired via Hetzner crontab. BriefComposer (Kimi K2.6) generates personalized daily messages.
Honcho non-blockingBackground thread write-backs. Workspace creation hang patched. Key configured on Hetzner.

NPS Progression — This Session

Run 1
2
/10
401 auth errors on every turn. Engine broken end-to-end.
Run 2
2
/10
Monitor archetype catch-all (zero.yaml bug). All messages → "No new alerts".
Run 3
3
/10
Routing fixed. Topic switching works. Safety failures: 0. Flags: 7.
Run 4
3
/10
Kimi not reachable (8s timeout). Template responses only.
Run 5 ✓
4
/10
Kimi K2.6 live. Turns 2-3 scored 4-5/5. 0 safety failures. Flags: 3.
Bottleneck for NPS 5+: Most skills still use template archetypes (PlannerArchetype, ActionArchetype). Changing more skills to workflow_type: coach → Kimi K2.6 is the highest-leverage next action. Each skill that moves from template to Kimi adds ~0.3-0.5 NPS points.

Full Architecture Diagram

📱 User — Telegram @chittiemma1_bot · Any family member's message
🛡 Pre-Filter  Zero LLM · Deterministic
Emergency keywords → escalate · Active thread TTL · Prompt injection guard · Onboarding gate
⚡ Intent Triage  GPT-5.4 Mini · 17KB cached · ~700ms
🔧 SCRIPTED → weather · reminder · calendar · list → deterministic (zero LLM)
🎼 CONVERSATIONAL → Hermes · coaching · meals · emotions · planning
↓ conversational
🎼 Hermes Gateway  Kimi K2.6
SOUL.md · Honcho get_insight() · Tool Search (5%) · GPT-5.4 Mini fast-path (simple acks)
↓ POST /chat with honcho_context + skill_id
🧭 Intelligent Profile Router  Opus-tagged · v7 live
Filter inferences by skill_domains JSON array · Top 5-8 by confidence · Optional GPT-5.4 Mini dynamic pass
🗺 BCT + NLP Selection  Zero LLM · 1800-row dict
barrier × stage × hughes_need × decision_style → technique + NLP pattern + opener + specific user values
⚙️ Archetype Execution  Kimi K2.6
CoachArchetype · PlannerArchetype · ExpertArchetype · MonitorArchetype · ProfileArchetype
ActionArchetype (deterministic first, Kimi K2.6 for complex params)
↓ response generated
🧠 Memory Write-Back  Background threads · Non-blocking
Honcho record_turn() · Signal EMA updates · Vector store (text-embedding-3-small) · Entity extraction (GPT-5.4 Mini, session end)
Opus 4.8 deep inference (once, async) — 30-50 inferences, all layers tagged with skill_domains
↓ response → Hermes → Telegram
📅 Rhythm Engine  Cron · SignalCollector + DailyState → BriefComposer (Kimi K2.6)

Model Stack

StageModelViaLatencyPurpose
Intent Triage / Routeropenai/gpt-5.4-miniOpenRouter~700ms (cached)Classify user message into 83 skill IDs. 17KB cached system prompt with disambiguation rules.
Hermes Gatewaymoonshotai/kimi-k2.6OpenRouter15-30sPersona-driven conversational AI. Extended reasoning. Soul.md + Honcho context + selected profile inferences.
CoachArchetypemoonshotai/kimi-k2.6OpenRouter15-30sBCT-guided coaching responses. Receives selected profile inferences + BCT card + NLP opener.
PlannerArchetypemoonshotai/kimi-k2.6OpenRouter15-30sStructured planning output with relevant profile context.
ExpertArchetypemoonshotai/kimi-k2.6OpenRouter15-30sSafety-gated specialist guidance (OT, symptom triage, speech).
ActionArchetypeNone / moonshotai/kimi-k2.6<50ms / 15sDeterministic first. Kimi K2.6 only for complex parameter extraction.
Deep Profile Inferenceanthropic/claude-opus-4-8OpenRouter30-60s (async)Once per user. 30-50 inferences across 11 layers + Layer 0B biographical reference world.
Entity Extractionopenai/gpt-5.4-miniOpenRouter~2s (batch)Session-end batch. Extracts named entities, health context, schedule events, specific constraint values.
Vector Embeddingstext-embedding-3-smallOpenAI direct~200ms1536-dim semantic vectors for conversation pair storage and retrieval.
Rhythm BriefComposermoonshotai/kimi-k2.6OpenRouter15-30sMorning brief and evening closeout generation from DailyState signals.
QA Evaluatorgpt-5.5OpenAI directAutomated QA scoring for synthetic user test sessions.
Synthetic Userx-ai/grok-4.3OpenRouterBlind simulated user persona for end-to-end testing.

Memory Stack

Three-tier memory

LayerTechnologyWhat it storesUsed by
HonchoDialectic inference APICross-session user model synthesis. get_insight() returns "User likely prefers X since they mentioned Y across 3 sessions" (~200 tokens).Hermes + all archetypes (via context injection)
Vector MemorySQLite + OpenAI text-embedding-3-small (1536-dim)Conversation pairs as semantic vectors. Searched at request time for relevant past context.route_and_execute() injects top-3 similar past exchanges
SQLite (structured)SQLite on HetznerInference signals, entity facts, deep profile inferences (30-50 per user), BCT session logs, agenda items, active threadsAll archetypes, InferenceEngine, EntityExtractor

Entity Extraction (NEW in v7)

GPT-5.4 Mini batch at session end. Extracts from the last 40 messages:

children: [{name, age, notes}]  ← "Ethan is 11, peanut allergy"
pets: [{name, type}]             ← "Biscuit, labradoodle"
health_context: [{person, condition}]  ← "Lily, ear infection post-antibiotics"
schedule_events: [{what, when, who}]   ← "soccer practice, Tuesdays 4pm, Ethan"
specific_barriers: [{domain, value, confidence}]  ← "meal-planning: peanut allergy + picky eater"
specific_motivators: [{domain, value, confidence}]
preferences: [{domain, value}]   ← "food: David low-carb"

These facts are injected into Kimi's context as a compact summary block — no re-asking the user.

Deep Profile — All Layers (Opus 4.8, once per user)

Layer 0A — Demographic Foundation

The structural facts of their life — geography, household, occupation, family structure, financial tier, education, childhood geography. Social enrichment signals (LinkedIn/Instagram/Twitter) when available.

Skill mapping: All 90+ skills use this as baseline context.

Layer 0B — Biographical Reference World NEW v6

The cultural/experiential universe they carry forward. Inferred from conversational cues, cultural signals, generational markers, social enrichment.

Fields: music_growing_up · music_now · sports_team · role_models · childhood_pets · extracurriculars · likely_schooling_type · peer_competition_pattern · first_vehicle · travel_experience_type · childhood_mischiefs_likely · nostalgic_memories · relationship_with_nature · self_care_relationship · aesthetic_sensibility · food_nostalgia_heritage · media_consumption

Skill mapping: meal-planning, family-film, music-discovery, sports-calendar, parent-playbook, wellness-daily, food-intelligence, storybook, travel-planning.

Layer 1 — Observable Self

DISC profile · Communication style DNA · Emotional vocabulary · Request patterns · Trust-building signals · Humor style · Self-presentation mode
All archetypes — tone calibration

Layer 2 — Identity & Narrative

Enneagram type (1-9) · Identity axis · Aspired vs actual self · Narrative control locus · Change model belief · Generational identity
parent-coach, habits, career-pivot, goal-setting

Layer 3 — Family System Dynamics

Attachment style (Bowlby) · Inherited parenting model · Family power dynamics · Partner dynamic · Sibling rank effect · Multigenerational pattern
parent-playbook, elder-care, family-legal

Layer 4 — Cultural & Worldview

Hofstede axes (individualism/collectivism, power distance) · Religion/spiritual orientation · Class consciousness · Diaspora experience · Institutional trust
BCT strategy selection, expert safety gates

Layer 5 — Behavioral & Cognitive

Big Five OCEAN (O/C/E/A/N scores 1-5) · Chase Hughes decision motivator (security/comfort/status/belonging/autonomy/identity) · Procrastination signature · Active cognitive biases · Satisficer/maximizer
BCT technique selection, habits, planner-archetype

Layer 6 — Emotional & Relational

Chase Hughes primary social need (importance/approval/pity/power/uniqueness/safety) + corresponding fear · Emotional expression style · Conflict style · What makes them feel SEEN · Shame zones
coach-archetype BCT opener selection, emotional-support

Layer 7 — Life Stage & Trajectory

Levinson stage · Erikson psychosocial stage · Current chapter label · What they're grieving · Forward projection 6-12 months · Likely upcoming life events
parent-coach, career-pivot, journey-planner

Layer 8 — Practical Life Intelligence

Financial psychology (avoider/anxious/confident) · Health orientation · Technology relationship · Home orientation · Social orientation · Organizational style
meal-planning, budget-coach, fitness-coach, daily-task-manager

Layer 9 — Shadow & Irrationality

Jungian shadow pattern · Self-deception narrative · Defense mechanisms · Behavioral vs stated wants gap · Resistance prediction · Unconscious repetition
coach-archetype resistance awareness, habits

Layer 10 — Negative Personalization

"Never do this" map for this specific person · Topics requiring extreme care · Misinterpretation risks · Surveillance risk zones · Tones that backfire
Applied last, before every response. Overrides everything else.

9 Psychological Frameworks — Taught Pedagogically to Opus 4.8

FrameworkWhat Opus extracts
Chase Hughes Social NeedsPrimary need (importance/approval/pity/power/uniqueness/safety) + corresponding fear. Drives emotional behavior and BCT opener selection.
Chase Hughes Decision-MakingPrimary motivator (security/comfort/status/belonging/autonomy/identity). Determines how to frame recommendations.
Enneagram (9 types)Type + core fear + core desire. More predictive than the type label alone. Inferred from how they describe problems and what they fear.
DISC ProfileD (results-focused) / I (social) / S (stable) / C (analytical). From how they phrase requests and what they emphasize.
Big Five OCEANOpenness, Conscientiousness, Extraversion, Agreeableness, Neuroticism — each scored 1-5. OCEAN directly determines which BCT techniques will land.
Attachment TheorySecure / Anxious / Avoidant / Fearful. Determines how they'll respond to AI advice-giving and how much reassurance they need.
Maslow's HierarchyActive level per domain (health, family, career, finance). Where someone is on Maslow determines what they're motivated by.
Transtheoretical Model (TTM)Stage of change per key behavior area (precontemplation→maintenance). Determines which BCT technique applies.
Bowen Family SystemsDifferentiation, triangulation, multigenerational transmission. Explains family dynamics inferences in Layer 3.

Intelligent Profile Router — How It Works

At synthesis time (Opus 4.8 runs once), every inference is tagged with skill_domains — all the OiMy skills it's relevant to, including non-obvious cross-domain connections that a static mapping would miss.

At call time, the router filters inferences by the current skill_id:

inference = {
  "dimension": "food_as_emotional_regulation",
  "claim": "User seeks comfort food and reduces movement when mentally low",
  "layer": 9,
  "confidence": 0.58,
  "skill_domains": [
    "meal-planning",    # obvious
    "wellness-daily",   # body + emotional state  
    "habits",           # behavior pattern
    "parent-playbook",  # if stress-eating → depleted parent
    "fitness-coach"     # movement reduction correlates
  ],
  "cross_domain_note": "Emotional state drives food choices — load for meal queries too"
}

# At call time: filter by current skill_id
relevant = get_inferences_for_skill(user_id, "meal-planning", limit=8)
# → Returns this inference even for a meal query, surfacing the mental state signal

Why this matters: Static router only loaded food profile for meal-planning queries. Intelligent router surfaces the mental state signal that explains the behavior — Kimi can then acknowledge the likely emotional context without naming it, making OiMy feel like it truly understands.

BCT + NLP Selection

Zero LLM. 1800-row lookup dictionary.

Key: barrier_category × stage_of_change × hughes_social_need × decision_style

Value: BCT technique file + NLP pattern + exact opener phrasing + specific user values from entity extraction

The specific user values (e.g., "Ethan has peanut allergy" extracted by EntityExtractor) are passed directly into the BCT opener, making it feel personal rather than generic.

52 BCT technique cards · 20 NLP pattern cards · O(1) lookup at runtime

Status: Live vs Next

FeatureStatusNotes
Intent triage (GPT-5.4 Mini router)✅ Live17KB cached prompt, ~700ms, 83 skills
Hermes on Kimi K2.6✅ LiveHetzner + Emma bot (@chittiemma1_bot)
CoachArchetype → Kimi K2.6✅ LiveWas a stub. Now calls Kimi K2.6 actually.
meal-planning → Kimi K2.6✅ Liveworkflow_type: planner → coach
deep-inference-v6.txt (Opus 4.8)✅ Live467 lines, 9 frameworks, 30-50 inferences
Intelligent Profile Router✅ Liveget_inferences_for_skill() filtering by skill_domains
Layer 0B biographical reference world✅ Live18 fields, stored in profile_layer_0b table
Cross-domain inference tags✅ Livelayer_num, skill_domains_json, cross_domain_note columns
Negative personalization layer✅ Liveprofile_negative_personalization table
Forward projection✅ Liveprofile_forward_projection table
Psychological frameworks store✅ Liveprofile_psychological_frameworks (DISC/Enneagram/OCEAN/etc)
Vector memory (OpenAI embeddings)✅ Livetext-embedding-3-small, 1536-dim, direct OpenAI API
Entity extraction (GPT-5.4 Mini)✅ LiveSession-end batch, people/children/pets/health/barriers
Specific barrier/motivator values✅ Liveinference_specific_values table, rule-based extraction
Rhythm Engine cron✅ Live8am morning brief, 8pm evening closeout via Hetzner crontab
Honcho memory (background thread)✅ LiveNon-blocking write-backs. Key configured. Workspace → dashboard.
Social pre-enrichment (LinkedIn/Instagram)⚠️ StubSchema + wiring done. Needs Proxycurl + Apify API keys.
Expert RAG (vector knowledge bases)🔵 NextOT library · symptom DB · speech activities
More skills → Kimi K2.6 coach path🔵 NextEach skill moved from template → NPS +0.3-0.5
Honcho workspace (dashboard)⚠️ Needs setupCreate workspace "oimy-default" at app.honcho.dev to activate dialectic insights

Hermes SOUL.md (Opus 4.8 Authored)

The SOUL.md defines Hermes's identity and routing behavior for the OiMy persona. Key directives crafted by Opus 4.8:

OiMy Architecture v7 · Generated 2026-05-31 · Hetzner test instance: 116.203.107.13 · Emma bot: @chittiemma1_bot