PC_Workman / blog
Wednesday Code Autopsy · #6

Nine Layers Decide - Logic or AI

Most AI assistants have one layer. Mine has 9. And I didn't plan any of them.

By Marcin Firmuga·2026-04-29·2 min read·Wednesday Code Autopsy #6

Most AI assistants have one layer: send everything to ChatGPT. Mine has nine. And I didn't plan any of them.

Monday's post hit 13,500 views — people saw the app. Today I'm showing how it thinks. Every message typed into hck_GPT goes through a 9-step decision waterfall before it gets a response. Not because I designed it that way — every layer exists to fix a problem the previous one couldn't handle.

The routing waterfall, stripped to the decisions

  1. Service wizard active? The wizard handles it.
  2. Hard-route keyword? Bypass AI entirely.
  3. Help keyword? Instant help card.
  4. "Why" detected? Special why-handler, before the parser.
  5. Single-word alias ("cpu", "ram")? Instant info, no parsing.
  6. AI intent parser → confidence score. High confidence → rule engine (fast, deterministic). Low confidence + Ollama → local LLM (smart, contextual).
  7. Entity found but no intent? Route by entity type.
  8. Context carry-over — "and?" repeats the last topic.
  9. Nothing matched — graceful fallback.

Type cpu and it never reaches the parser — instant alias. Type why is my RAM high? and the why-detector catches it at layer 4. Type what should I do about my PC being slow? and the parser returns low confidence, so Ollama gets it with full system context.

The part I had most fun building: intent-aware temperature

Every AI tutorial uses one temperature setting. I use 20.

The whole engine in three lines:

confidence >= 0.60   -> rule engine   (instant, deterministic)
confidence <  0.60   -> Ollama LLM    (smart, full PC context)
Ollama timeout       -> rule fallback (best effort, never crashes)

I didn't want Ollama for everything — it's slow. I didn't want if/else for everything — it's stupid. So I gave every message a confidence score and let the score decide. Nine layers. None of them planned. All of them necessary.

Next week I start Umiejętności Jutra 3.0 — Google's AI certification through SGH. Can't wait to see how it changes the way I think about this engine.

Does a technical format like this, once a week, land for you — or is it too in-the-weeds?

BuildInPublicPythonAIOpenSource
This is the project behind the post. PC Workman is a free, open-source Windows system monitor with an offline AI assistant - everything described here is real, shipped code. Download it or read the source.
← #5The Trick Is Knowing When NOT to Flush RAM#7 →My AI Forgets You on Purpose
MF

Marcin Firmuga

Solo developer · HCK_Labs · building PC Workman in public

Every edition is written from that week's real commits. Newest posts premiere on LinkedIn - the archive lives here. More about me: my story.