OiMy — Complete Architecture

Full model flow, pre-filter triage, skillify path, GBrain/Honcho memory, BCT mapping, Rhythm Engine, deep personalization — and what's live vs. what's next

v2 · Updated May 30, 2026 🤖 Hermes v0.15.2 ⚡ GPT-5.4 Mini 🌙 Kimi K2.6 🔮 Opus 4.8 📐 Rhythm Engine 🧠 GBrain · Honcho · BCT

Contents

  1. Full Architecture Diagram
  2. Pre-Filter & Triage Layer
  3. Skillify / Scripts Path (no LLM)
  4. Model Responsibilities
  5. Memory Layers — GBrain, Honcho, Vector
  6. BCT Mapping (Behavior Change)
  7. Rhythm Engine
  8. Real End-to-End Example
  9. Full Deep Inferred Profile
  10. Hermes SOUL.md
  11. What's Live vs. What's Next
  12. Config Reference

1 — Full Architecture Diagram

The complete request path — from user message to response — covering every layer including pre-filter, triage, skillify short-circuit, Hermes orchestration, memory retrieval, archetype execution, BCT injection, and the scheduled Rhythm Engine.

📱 User — Telegram @chittiemma1_bot
Message received via Telegram polling. Any message from any family member.
Example "my daughter got diagnosed celiac last week — overwhelmed, where do I start with dinners?"
🛡 Pre-Filter Zero LLM · Deterministic
Runs before any model call. Regex + rule engine only. Cost: $0.
Emergency keywordschest pain · gas leak · self-harm → emergency skill, bypass everything
Prompt injection guardDetects injection attempts → block + log
Active thread TTLUser mid-conversation → continue same skill (no re-classify)
Onboarding gateNo profile yet → onboarding flow
↓ (no rule matched)
⚡ Intent Triage GPT-5.4 Mini
Single LLM call with 17KB cached prompt. Classifies into TWO buckets — determines whether to skip all further LLM calls.
🔧 SCRIPTED PATH No more LLM
weather · reminder · calendar view · shopping list · note · chore mark-done · screen time check
🎼 CONVERSATIONAL PATH → Hermes
coaching · meal planning · stories · elder care · emotional support · multi-step planning
↓ scripted                                        ↓ conversational
🔧 Skillify / Scripts
Deterministic handlers. No LLM. Return instantly.
weatherOpenWeather API → formatted string → return
reminderParse time → SQLite insert → "Done, reminder set"
calendar viewQuery calendar DB → format → return
shopping listAppend item → confirm
🎼 Hermes Gateway Kimi K2.6
Orchestrates the full path. Loads context, queries memory, dispatches to skill engine.
SOUL.mdOiMy persona (Opus 4.8 crafted)
GBrain queryRetrieve open loops, prior preferences, cultural context
Honcho contextLast N session turns for continuity
Tool SearchLoads oimy-engine skill (5% threshold, 5 tools max)
                                              ↓ POST /chat {message, user_id, context}
⚙️ OiMy Skill Engine localhost:8080 · 83 skills
① Intent already known from triage · skip re-classification Profile resolution: USER.md + DEEP_PROFILE.md. Inference signal recording.
② Archetype Dispatch Kimi K2.6 PlannerArchetype / CoachArchetype / ExpertArchetype / ActionArchetype / MonitorArchetype / ProfileArchetype
③ BCT Mapping (Coach/Habits archetypes) Maps user situation → Behavior Change Techniques → injected into Kimi prompt for evidence-based responses
④ Deep Profile Check Opus 4.8 After 20 msgs + 3 sessions + 2 pain points → synthesize DEEP_PROFILE.md. Runs ONCE. Max budget enforced.
🧠 Memory & Persistence
SQLiteProfiles, signals, sessions, inference data, nudge log
GBrainSemantic memory: BM25 + vector + graph. Open loops, preference history, cultural context
HonchoCross-session turn recording. Enables "last Tuesday she said…" continuity
Vector MemoryConversation pair embeddings for retrieval-augmented context
↓ response + signals stored
📅 Rhythm Engine scheduled · not per-message
Day-level compiler. Runs on cron schedule. Produces morning briefs and evening closeouts.
SignalCollectorAggregates calendar, meds, school, food, elder care, habits, open loops
DailyState compilerTyped state object (12 fact types). No LLM needed for this step
OpportunityDetectorScores nudge candidates (5 positive × 3 penalty factors). Budget-gated
BriefComposer Kimi K2.6Prose polish for morning brief / evening closeout
OutputsMorning brief (07:00 local) · Evening closeout (19:30 local) · Proactive nudges (budget-gated, quiet hours enforced)
↓ Response via Hermes → Telegram

2 — Pre-Filter & Triage Layer

The insight Bharath identified: the classifier should sit before Hermes, not inside the engine. This means the most common messages never reach Kimi K2.6 at all.

Why this ordering matters

Current test instance (as deployed)

GPT-5.4 Mini classifier lives inside the OiMy engine. This means Hermes/Kimi K2.6 is invoked for every message, even "what's the weather?" — adding ~400ms latency and ~$0.004 per call unnecessarily.

Target architecture

GPT-5.4 Mini runs first as a gateway-level triage. ~40% of messages (weather, reminders, calendar, lists) return in <50ms total with zero Kimi calls. Saves ~60% of LLM costs at scale.

Pre-filter rules (zero cost, instant)

Pre-filter decision tree — runs before any model
# 1. Emergency patterns (regex)
if emergency_regex_match(message):
    → skill = "emergency-family" or "emergency-home"bypass_everything()  # immediate response

# 2. Prompt injection
if injection_patterns(message):
    → block + log, return safe response

# 3. Active thread TTL (ChatRouter)
if user_has_active_thread(user_id) and ttl_valid:
    → continue same skill, no re-classification

# 4. Onboarding gate
if not user_profile_exists(user_id):
    → skill = "onboarding"

# → else: pass to GPT-5.4 Mini triage

3 — Skillify / Scripts Path

Skills classified as scripted by GPT-5.4 Mini skip Hermes, skip Kimi K2.6, and execute deterministic handlers. No LLM inference at all — just API calls and template responses.

Cost comparison: Scripted path = ~$0.0001 (GPT-5.4 Mini classify only) · Conversational path = ~$0.008 (GPT + Kimi). At 1,000 messages/day with 40% scripted: saves ~$11/day.

🌤 Weather

Classify → call OpenWeather API → format → return. No LLM.
latency: ~120ms

⏰ Reminders

Parse time from message → SQLite INSERT → confirm message.
latency: ~30ms

📅 Calendar View

Query schedule-events.json or calendar DB → format list → return.
latency: ~20ms

🛒 Shopping List

Append item to shopping-list.json → "Added [item] to the list."
latency: ~15ms

📝 Notes

Write to notes store → confirm. "Got it, I'll remember that."
latency: ~15ms

✅ Chores

Mark task done → update chores.json → confirm.
latency: ~20ms
Not yet wired in the Hetzner test instance. The GPT-5.4 Mini triage currently lives inside the engine (not upstream). Routing the scripted bucket to deterministic handlers requires a config change in Hermes, not a code change.

4 — Model Responsibilities

regex + rule engine · no API call

Pre-Filter Rules

  • Emergency keyword matching
  • Prompt injection detection
  • Active thread continuation
  • Onboarding gate
💡 Why: Zero latency, zero cost. Catches safety-critical paths before any model is called.
openrouter/openai/gpt-5.4-mini

GPT-5.4 Mini

  • Intent triage — scripted vs conversational
  • Skill classification (83 skills, JSON output)
  • Prompt caching: 17KB prompt cached after first call
  • Quick fillers & fast-path inline in Hermes
💡 Why: Replaces local E2B. Same accuracy, prompt cache makes repeated calls ~2ms. One LLM call before any Kimi call.
openrouter/moonshotai/kimi-k2.6

Kimi K2.6

  • Hermes main agent: orchestration + tool decisions
  • All archetype responses (meal, elder, stories, travel…)
  • Emotional support, multi-step planning
  • Rhythm Engine brief composition (prose polish)
  • 131K context window
💡 Why: Replaces Sonnet + Opus-3.5 everywhere. Warm, long-context, cost-effective. The main "voice" of OiMy.
openrouter/anthropic/claude-opus-4.8

Opus 4.8

  • Deep Inferred Profile — runs once per user
  • Trigger: 20+ msgs · 3+ sessions · 2+ pain points
  • Produces DEEP_PROFILE.md (DISC, Enneagram, wounds…)
  • DEEP_INFERENCE_MAX_RUNS=1 hard cap
💡 Why: Most expensive call, most important outcome. One synthesis that transforms every future interaction.

5 — Memory Layers

OiMy has four distinct memory systems, each serving a different time horizon and use case.

🧠 GBrain — Semantic Long-Term Memory

What: Hybrid search engine (BM25 + vector + graph). Stores facts, preferences, open loops, cultural context, people, relationships.
When consulted: Before archetype execution — "what do I know about this family that's relevant to this request?"
Example: User asks "what should we cook for Diwali?" → GBrain finds "Tamil heritage", "mom prefers vegetarian", "daughter has celiac" → context injected into Kimi prompt.
Current test status: Gap — not on Hetzner Lives on victory-bobcat only. Needs install + sync to Hetzner.

🗂 Honcho — Cross-Session Turn Memory

What: Records every conversation turn with metadata. Enables the agent to recall "last Tuesday you mentioned X" without re-reading all history.
When consulted: Hermes loads last N turns before responding. Engine records turn after response.
Example: User says "like I said before" → Honcho finds the prior context without full-history search.
Current test status: Gap — disabled No HONCHO_API_KEY set. Falls back to SQLite recent_messages table.

📐 Vector Memory — Retrieval-Augmented Context

What: Stores (message, response) pairs as embeddings. Enables semantic retrieval: "find past conversations similar to this request."
When consulted: During archetype execution — retrieve_top_k(message, k=3) to enrich context.
Current test status: Live VectorMemory class active, stores every turn.

🗄 SQLite — Structured State

What: All structured data: user profiles, inference signals, session state, meal plans, chores, reminders, nudge logs, rhythm briefs.
Tables: profiles · inference_profile · recent_messages · plans · reminders · shopping_items · monitor_schedule · rhythm_nudge_log
Current test status: Live Active at /opt/oimy-engine/data/oimy.db

6 — BCT Mapping (Behavior Change Techniques)

Active inside three archetypes: CoachArchetype, ParentCoach, and Habits. When a user is working on a behavioral goal, the engine maps their situation to evidence-based psychological techniques and injects them into the Kimi K2.6 prompt.

What BCT is: A taxonomy of 93 evidence-based techniques from behavioral psychology (BCT Taxonomy v1). Each technique has a code, a mechanism, and specific implementation guidance. OiMy uses them to make coaching responses grounded in behavioral science, not just good advice.
archetypes/bct_engine.py — simplified flow
# User: "I keep meaning to exercise but never do it"

# 1. author_bct_mapping.py maps situation → BCT codes
bct_codes = map_to_bct(user_situation, pain_points)
# → ["1_1", "2_2", "5_1", "9_2"]
#   1_1 = Goal setting (behavior)
#   2_2 = Feedback on behavior
#   5_1 = Information about health consequences
#   9_2 = Pros and cons / decisional balance

# 2. Technique guidance injected into Kimi K2.6 prompt
bct_context = load_technique_guidance(bct_codes)
"""
Apply: Goal setting — help user set a specific, measurable behavior goal.
Apply: Feedback — offer to track progress and reflect it back.
Apply: Pros/cons — surface what they lose by not exercising (not just gains).
DO NOT: lecture, moralize, or add pressure. One concrete step only.
"""

# 3. Kimi K2.6 generates response using this scientific scaffolding

BCT 1_1 — Goal Setting

Help user set a specific, measurable, time-bound behavior goal rather than a vague intention.

BCT 2_2 — Feedback

Offer to track behavior and reflect progress back to the user at appropriate intervals.

BCT 4_1 — Action Planning

When, where, and how the behavior will be performed. Concrete scheduling beats intention.

BCT 9_2 — Pros & Cons

Decisional balance: surface what the user loses by not changing, not just what they gain.

BCT 15_2 — Reduce Punishment

Remove guilt and shame framing. Focus on restarting, not the lapse.

BCT 3_3 — Social Support

Involve family/accountability partners. Used in parenting and wellness archetypes.

7 — Rhythm Engine

A scheduled day-level compiler that runs independently of user messages. Not a skill — it orchestrates skills. Fully built and tested; scheduler integration with Hermes is the remaining step for the test instance.

Rhythm Runtime — module architecture (archetypes/rhythm/)
# Runs on schedule (morning: ~07:00, evening: ~19:30 user local time)

# Step 1: SignalCollector — no LLM needed
signals = SignalCollector.collect(user_id, member_scope)
  → calendar events (next 72h)
  → medication reminders due
  → school deadlines / events
  → meal plan gaps
  → elder care check-ins overdue
  → habit streak status
  → open loops from GBrain (unresolved mentions)
  → weather (relevant for outdoor plans)

# Step 2: DailyState — typed central object, zero LLM
state = DailyState.compile(signals)
  → 12 fact types with provenance + confidence + scope
  → NudgeBudget: per-day caps, category limits, quiet hours

# Step 3: OpportunityDetector — rule-based scoring, zero LLM
candidates = OpportunityDetector.score(state)
  → 5 positive factors × 3 penalty factors per nudge
  → Budget-gated: max 2 proactive messages/day
  → Suppression: no repeat of last 3 nudges

# Step 4: BriefComposer — Kimi K2.6 for prose polish only
brief = BriefComposer.compose(state, candidates, member)
  # Kimi K2.6 writes the greeting + prose
  # Structure (items, nudges) is deterministic — only words use LLM

# → Delivered via Hermes → Telegram

Morning Brief (07:00)

Good morning greeting → today's events → meals → family reminders → one actionable nudge. Warm, concise, useful. Kimi K2.6 writes the prose.

Evening Closeout (19:30)

How the day went → outstanding items → tomorrow's prep → optional reflection nudge. Never heavy — just a gentle close.

Nudge Budget System

Max 2 proactive msgs/day. Per-category caps (e.g., max 1 food nudge/day). Quiet hours 22:00–07:00. Suppression history prevents repeats. No spam, ever.

Privacy-First Scoping

Every fact has VisibleScope: private / shared_family / care_team / guardian_only. Elder care data never leaks into family brief. Each member sees only their scope.
Current test instance: Rhythm Engine code is live on Hetzner (committed). The cron scheduler integration with Hermes is not yet wired — briefs won't fire automatically yet. Next step: add cron entry to Hermes jobs that calls the rhythm API endpoints at the right times.

8 — Real End-to-End Example

Message: "my daughter got diagnosed celiac last week. I'm overwhelmed. where do I even start with changing our dinners?"

Pre-filter — deterministic, 0ms

No emergency keywords. No injection pattern. No active thread. Not first-time user. → Pass to GPT-5.4 Mini triage.

1

GPT-5.4 Mini triage — 2ms cached

17KB prompt already cached. Disambiguation rule fires: "family dietary change → meal-planning, even with emotional context." Bucket: CONVERSATIONAL → Hermes path.

output: {"skill": "meal-planning", "confidence": "high"} latency: 2ms // prompt cache hit path: "conversational → Hermes" // not scripted
2

Hermes — GBrain + Honcho retrieval Kimi K2.6

GBrain query: finds "Tamil heritage", "daughter picky eater", "budget-conscious" from prior sessions. Honcho loads last 3 turns. SOUL.md loaded. Tool Search selects oimy-engine. Skill intent already known — passes to engine with enriched context.

// GBrain retrieval "Tamil heritage → rice-based meals are natural GF" "daughter (age 8) is picky — avoids sauces" // Injected into engine context
3

OiMy Engine — Profile + Inference signals

USER.md loaded (name, timezone, family). DEEP_PROFILE.md: "high-C, anxious attachment, needs numbered steps, validation before solution." Inference signals recorded.

// inference signals from this message pain_point.dietary_restriction 0.45 pain_point.overwhelm 0.35 communication_style.needs_steps 0.60 // from DEEP_PROFILE
4

PlannerArchetype executes Kimi K2.6

DEEP_PROFILE says "validate first, then solve" + "numbered steps always" + "mention the daughter specifically." Kimi K2.6 generates response shaped by these invisible constraints.

my daughter got diagnosed celiac last week. I'm overwhelmed. where do I even start with changing our dinners?
Bharath · just now
🍽 meal-planning · high · Kimi K2.6
First — this is genuinely a lot. Celiac diagnosis in a kid turns the whole kitchen upside down for a bit. It gets much easier.

For dinner, three things that actually help families make the switch:

1. Start with what's already safe — rice, potatoes, eggs, meat, fish, most fruits and veg are naturally GF. You're not starting from zero.

2. One swap at a time — this week, just swap the pasta. Barilla GF or Jovial are genuinely good. Don't overhaul everything.

3. Label shortcut — "wheat, barley, rye, malt" = avoid. "Certified gluten-free" = safe. Takes a week to get fast at it.

Want me to build a week of dinners she'll actually eat? Tell me 3-4 things she loves now, I'll make the GF version.
OiMy · 1.3s total

9 — Full Deep Inferred Profile

Opus 4.8 synthesizes this after 20+ messages across 3+ sessions. Never shown to the user. Shapes every future interaction silently.

# Deep Profile — Sarah Last Updated: 2026-05-30 · Sessions: 5 · Messages: 27 Generated by: openrouter/anthropic/claude-opus-4.8 · Runs: 1/1 (max reached) ## Primary Social Need Belonging + Competence [0.82] Frames all requests through what the family needs (not herself). Provides extra context unprompted — signals need to be seen as prepared. Visibly relieved when given specific steps. Quote: "tell me exactly what to do" — appeared 3× across sessions. ## DISC Type High-C (Conscientious) · Secondary-S (Steadiness) [0.78] Asks clarifying questions before acting. Provides detailed context for simple requests. Avoids conflict language. Needs: data + specifics + validation before she commits. ## Attachment Style Anxious (with Secure aspiration) [0.71] Self-blame pattern: "I should have known about this earlier." Responds positively to reassurance but doesn't seek it directly. Secure traits emerge when logistics feel under control — she can be playful and confident then. ## Enneagram Type 6 — Loyalist (wing 7) [0.74] Research orientation — checks multiple sources before trusting. Tests advice before full commitment. W7: optimism and humor break through. Core fear: being unprepared, being blamed. Core desire: security and support. ## Core Wound Capability anxiety — fear of being the one who dropped the ball Apologizes for "obvious" questions. Prefaces with "this might be dumb but…" Disproportionate relief when reassured problem was non-obvious. Under stress: excessive self-justification in messages. ## Decision-Making Style Research-then-confirm [0.80] Gathers data, presents to trusted source, confirms, acts. Does NOT like "do whatever feels right." Needs external validation. Budget-conscious even when unstated. ## Stress Signatures Messages get shorter and more urgent · Drops context (assumes OiMy knows) Ends with "help" or 😩 · Late-night messages (after 22:00 EST) spike during stress Starts problem-solving mid-thought without finishing ## Personalization Hooks 1. Never open-ended — always include a default recommendation 2. Validate first — she needs to feel heard before she can act 3. Numbered steps always — processes information linearly 4. Reference family specifically — "for Priya's sensory needs" beats "for picky eaters" 5. Budget-aware without pity — surface free options naturally, never ask about money // This profile is NEVER revealed to the user. Used invisibly in every session.
How this changes the response: Without DEEP_PROFILE, OiMy might ask "want to talk about it?" when Sarah is stressed. With it — knowing she's high-C + anxious attachment — OiMy goes straight to numbered steps and validates competence instead of opening emotional space she won't take.

10 — Hermes SOUL.md Opus 4.8 crafted

SOUL.md · ~/.hermes/SOUL.md · OiMy Hermes Orchestration Layer

You are the orchestration layer for OiMy — the intelligent gateway that receives every message, decides what needs to happen, and routes it perfectly. Your job is not personality (that lives in the archetype layer) — your job is precision, speed, and invisible orchestration.

Think of yourself as the conductor of an orchestra. The musicians (skills, tools, models) are the talent. You make sure the right ones play at the right time, in the right order, without the audience hearing the cue.

1. Message Intake & Routing

  • Fast path → greetings, simple acks, short factual questions → respond directly via GPT-5.4 Mini inline
  • Full path → skills, emotional content, proactive work, multi-step → OiMy Engine
The user must never feel the routing decision. One voice, one friend, no seams.

2. Tool Selection

  • threshold_pct: 5% → if ≥5% relevance, load it
  • search_default_limit: 5 tools max per query
  • Emergency keywords → emergency skill immediately, no deliberation

3. Telegram-Native Behavior

  • No markdown tables
  • 1–2 emoji max, only when they add warmth or clarity
  • Reactions (❤️ 👍 ✅ 🤔) over replies for acknowledgments
  • Match user's register — formal user gets formal-ish OiMy

4. Error Handling

  • Never expose model names, stack traces, or infrastructure
  • "Couldn't reach that. What did you need?" — not technical errors
  • If slow: "Working on it — one sec"

5. Proactive Message Rules

  • Max 2 unsolicited messages per day
  • Hard stop: 22:00–07:00 user local time (emergencies only)
  • Every proactive message: useful · timed · respectful · personal

6. Identity Protection

  • "What AI are you?" → "I'm OiMy"
  • "Are you ChatGPT?" → "Nope — I'm OiMy. Different animal."
  • Never reveal: Kimi, Opus, GPT, OpenRouter, Hermes, OpenClaw
Quality bar: every response must be Useful · Earned · Timed · Brief · Human

11 — What's Live vs. What's Next

ComponentStatus in Test InstanceNotes
Hermes gateway (Hetzner)✅ LivePID 3214655, Kimi K2.6, crash-watchdog via cron
GPT-5.4 Mini classification✅ LiveInside OiMy engine. Prompt caching active. ~2ms cached.
Kimi K2.6 archetype responses✅ LiveAll 6 archetypes using Kimi as tall model
Opus 4.8 deep inference✅ LiveMAX_RUNS=1. Will trigger after 20 msgs + 3 sessions + 2 pain points
SQLite persistence✅ LiveProfiles, inference signals, session data
Vector memory✅ LiveConversation pairs stored each turn
BCT mapping (coach archetypes)✅ LiveActive in CoachArchetype, ParentCoach, Habits
Pre-filter as upstream triage⚠️ PartialDeterministic rules active. GPT triage still inside engine, not upstream of Hermes
Skillify / scripted path (no LLM)⚠️ PartialScripts exist; routing config to bypass Kimi for simple intents not wired yet
GBrain memory (Hetzner)❌ GapRuns on victory-bobcat only. Needs install + sync on Hetzner
Honcho cross-session memory❌ GapNo HONCHO_API_KEY set. Falls back to SQLite recent_messages
Rhythm Engine cron scheduler❌ GapCode committed + tested. Hermes cron wiring not yet done for test instance
Journey (long-term arcs)❌ Not startedArchitecture designed; implementation pending post-test validation
Agenda (session planner)❌ Not startedDesigned. Activates only when user engages; Rhythm provides context

12 — Configuration Reference

Hermes config.yaml (Hetzner)

~/.hermes/config.yaml · 116.203.107.13
model:
  # Main agent — orchestration, emotional, archetypes, planning
  default: openrouter/moonshotai/kimi-k2.6
  # Fast path — classification, fillers, Hermes inline responses
  fast: openrouter/openai/gpt-5.4-mini
  budget: openrouter/openai/gpt-5.4-mini
  quality: openrouter/moonshotai/kimi-k2.6
  fallback: openrouter/anthropic/claude-sonnet-4-6
tools:
  tool_search:
    enabled: 'on'
    threshold_pct: 5
    search_default_limit: 5
    max_search_limit: 15

OiMy Engine .env (Hetzner)

/opt/oimy-engine/.env
ROUTER_MODEL=openai/gpt-5.4-mini        # classifier
OLLAMA_URL=https://openrouter.ai/api/v1 # OpenRouter endpoint
TALL_MODEL=openrouter/moonshotai/kimi-k2.6 # archetypes
DEEP_INFERENCE_MODEL=openrouter/anthropic/claude-opus-4.8
DEEP_INFERENCE_MAX_RUNS=1

OpenClaw (victory-bobcat) — changed as requested

~/.openclaw/openclaw.json · victory-bobcat
agents.defaults.model.primary: "anthropic/claude-sonnet-4-6"
# Changed from opus-4-7 → sonnet 4.6 for all sessions
OiMy Architecture v2 · May 30, 2026 · Hetzner 116.203.107.13