Cognitive Agent Runtime — Design Exploration

Node graph architecture grounded in cybernetics, Cynefin, actor-network theory, and signal processing

Theoretical Grounding

Cybernetics (Wiener, Ashby, Beer)

Core idea: systems that regulate themselves through feedback loops.

  • Ashby's Law of Requisite Variety — the controller must have at least as much variety as the disturbance. One monolithic agent fails because it can't match the variety of all inputs. Specialized nodes CAN.
  • Viable System Model (Beer) — every viable system has 5 subsystems: Operations (Output), Coordination (Router), Control (Input), Intelligence (Thinker), Policy (human/config). Our graph maps directly.
  • Homeostasis — the system maintains stability through feedback. The I/O Feedback node IS the homeostatic loop — detecting drift, repeated failures, frustration.
  • Circular causality — output affects input. The user's next message is shaped by the response. The graph must be a loop, not a pipeline.

Design takeaway: Every node is either a sensor, controller, or effector. Missing any breaks the feedback loop.

Cynefin (Snowden)

Core idea: different problem domains need different response strategies.

  • Clear — "what time is it?" → sense-categorize-respond. Input routes directly to Output, no Thinker needed. Fast.
  • Complicated — "how do I deploy to K3s?" → sense-analyze-respond. Input routes to Thinker with tools. Expert knowledge.
  • Complex — "should we use microservices?" → probe-sense-respond. Thinker explores, Memorizer tracks evolving understanding. No single right answer.
  • Chaotic — system is down, user panicking → act-sense-respond. Output responds FIRST (acknowledge), then Input figures out what happened.
  • Confused — unclear what domain we're in → Input's primary job! Classify before routing.

Design takeaway: Input node IS the Cynefin classifier. Different domains = different graph paths.

Actor-Network Theory (Latour)

Core idea: capability emerges from the network, not individual actors.

  • Actants — both human and non-human entities have agency. Each node is an actant. The user is an actant. The LLM API is an actant.
  • Translation — messages change form as they pass through the network. User text → envelope → command → LLM prompt → stream → display. Each node translates.
  • Irreducibility — you can't reduce the system to one actor. No single node "is" the agent. The GRAPH is the agent.
  • Enrollment — new nodes join the network as needed. Tool nodes, sensor nodes, human-in-the-loop nodes. The graph grows.

Design takeaway: The graph IS the intelligence. Nodes are replaceable. Edges are where meaning happens.

Node Taxonomy (from signal processing + cybernetics)

Sensors (perceive)

  • Input — user message sensor
  • Timer — periodic trigger (cron, polling)
  • Webhook — external event sensor
  • FileWatch — filesystem change sensor
  • SystemProbe — health/load sensor

Like a webcam node in TouchDesigner. Always on, emits when something happens.

Controllers (decide + transform)

  • Classifier — categorize input (Cynefin domain, intent, tone)
  • Router — direct to different paths based on classification
  • Thinker — deep reasoning, tool use
  • Filter — reduce, summarize, extract
  • Accumulator — aggregate over time (topic tracker)

Like filter/transform nodes in Max/MSP. Shape the signal.

Effectors (act)

  • Output — stream text to user
  • Feedback — emit HUD/status events
  • ToolExec — execute external tools
  • Writer — persist to storage
  • Notifier — push to external systems

Like output nodes in Unreal Blueprints. Make something happen in the world.

Memory (special: both reads and writes)

Memory nodes are unique: they're called BY other nodes, not just wired in sequence. They're shared state — the "blackboard" in classic AI.

Graph Architecture — Full Vision

┌─────────────────────────────────────────────────┐ │ │ ▼ │ [User WS] ──► [Input/Classifier] ──┬──────────────────────────┐ │ │ │ │ │ │ ┌─────────┘ │ │ │ │ │ │ │ │ │ │ │ │ Complicated/Complex: │ │ (skip │ │ ▼ │ thinker) │ ▼ [Memorizer] [Thinker] ◄── context ──────── │ │ │ │ │ └──── memory updates ──────── │ │ │ │ │ │ │ └──► [ToolExec] ─── results ──► │ │ │ │ │ ▼ ▼ │ [Output] ──► [User WS] (stream delta/done) │ │ │ └──► ──► [User WS] (hud events) │ │ │ └──► ── hints ──────────┘ [Timer] ──────────────────────────────►│ [Webhook] ────────────────────────────►│ [SystemProbe] ────────────────────────►│ [TopicTracker] ──► [UI: topic list, action buttons]

Node-Based Programming Analogy

TouchDesigner / Max/MSP

  • Webcam → filter → skeleton detector → output display
  • Always running — not request/response
  • Nodes have typed inputs/outputs
  • Graph is the program

ComfyUI (Stable Diffusion)

  • Prompt → CLIP → sampler → VAE → image
  • Each node: one model, one job
  • Swap nodes to change behavior
  • Visual graph = full transparency

Our Cognitive Runtime

  • User msg → classify → think → stream → display
  • Each node: one LLM (or none), one job
  • Swap models per node via config
  • Three-column view = our visual debugger

Key insight: like node-based visual programming, the graph runs continuously. Sensors fire, signals propagate, effectors act. The chat is just ONE sensor. Timer events, webhooks, system probes — all feed the same graph.

10 Test Use Cases

#Use CaseTestsNodes NeededPhase
1 Greeting — "hey!" Input classifies casual, Output responds warmly. Verify command + context visible in panels. Input Output NOW
2 Technical question — "how does asyncio.Queue work?" Input classifies knowledge-needed. Output gives detailed answer. Context panel shows history growth. Input Output NOW
3 Multi-turn follow-up — ask, then "tell me more" Input sees follow-up pattern. Output uses history for continuity. Watch context grow in both panels. Input Output NOW
4 Tone shift — friendly then frustrated "this is broken!" Input detects tone change, adjusts command. Output shifts from casual to empathetic/helpful. Input Output NOW
5 Memory persistence — "my name is Nico" ... later ... "what's my name?" Memorizer stores user fact. On later question, provides context to Thinker. Output answers correctly. Input Memorizer Output NEXT
6 Background monitoring — "watch CPU load, alert if >80%" Timer/SystemProbe sensor fires periodically. Input classifies as monitoring. Feedback emits to UI without chat message. Timer SystemProbe Feedback LATER
7 System unresponsive — LLM takes 30s+ Feedback node shows "thinking..." immediately. Timeout handling. User sees activity, not silence. Input Feedback Output NEXT
8 Cynefin: Clear domain — "what's 2+2?" Input classifies as Clear, skips Thinker, routes directly to Output. Faster response, cheaper. Input Router Output LATER
9 Topic tracking — conversation covers 3 topics, user says "back to the first thing" TopicTracker accumulates topics. UI shows topic list. User can click to refocus. Memorizer provides relevant context. TopicTracker Memorizer UI LATER
10 UI action — button in top bar triggers "summarize this conversation" Non-chat input (button click) enters the graph as a sensor event. Input classifies, routes to Thinker+Memorizer. Output renders summary. UI Sensor Thinker Memorizer LATER

Build Roadmap — What To Validate

1

Input + Output (NOW — we're here)

Validates: Two-node communication works. LLM-to-LLM command passing. Context isolation visible. Streaming through graph.

Test cases: #1-4 (greeting, technical, follow-up, tone shift)

Success = You can see Input's reasoning and Output's execution as separate contexts. The command is meaningful, not just pass-through.

2

+ Feedback Node (pure Python, no LLM)

Validates: Non-LLM nodes in the graph. Real-time status. Parallel event emission (HUD fires while Output streams).

Test cases: #7 (unresponsive system — user sees "thinking..." not silence)

Success = User always sees activity within 200ms. Feedback panel in the UI shows event timeline.

3

+ Memorizer Node (LLM: Gemini Flash + SQLite)

Validates: Persistent state across the graph. Node-to-node context requests (Thinker asks Memorizer for context). Three LLM calls per turn, each with different context.

Test cases: #5 (memory persistence — "what's my name?")

Success = Conversation survives page reload. Memorizer panel shows what it stores vs what it provides.

4

+ Timer Sensor + SystemProbe (always-on)

Validates: The graph runs without user input. Sensor-driven processing. Background monitoring. The system is ALIVE, not just reactive.

Test cases: #6 (background CPU monitoring)

Success = UI shows activity without chat. Alerts appear. The graph is a living system, not a request/response pipe.

5

+ Router + Cynefin Classification

Validates: Multi-path graph. Input classifies domain, routes differently. Clear = fast path (skip Thinker). Complex = deep path (Thinker + tools + Memorizer). The graph adapts to the problem.

Test cases: #8 (Clear domain — fast path)

Success = Simple questions are 3x faster. Complex questions get deeper treatment. Visible in the graph view.

6

+ UI Extensions (topic list, action buttons, productivity)

Validates: The graph doesn't just do chat. Non-chat inputs (buttons, lists) enter the graph. Non-chat outputs (topic sidebar, action bar) exit the graph. Full cybernetic loop with rich UI.

Test cases: #9 (topic tracking), #10 (UI button triggers graph)

Success = The agent is a workspace tool, not just a chatbot.

Viable System Model (Beer) — The Graph as Organism

System 1 — Operations

The worker nodes doing actual work.

  • Thinker — reasoning, tool calls
  • Output — response generation
  • ToolExec — external actions

System 2 — Coordination

Prevents conflicts between System 1 nodes.

  • Router — sequencing, dedup
  • ContextBuilder — shared context
  • Message queue ordering

System 3 — Control

Monitors performance, enforces policies.

  • Feedback — quality gates
  • Token budget manager
  • Rate limiter, safety filter

System 4 — Intelligence

Looks outward + forward. Adapts.

  • I/O Monitor — pattern detection
  • Learns from failures
  • Adapts routing rules over time

System 5 — Identity

What the graph IS and won't do.

  • System prompts, persona
  • Safety boundaries
  • graph.md config

The Human Node

User isn't outside the system — they're an actant (ANT).

  • Messages = sensor signals
  • Approvals = gate controls
  • Corrections = feedback loops
  • The graph includes the human

Design Principles (Synthesis)

1. Three-Layer Architecture

From cybernetics

Perception (sensors, classifiers) → Decision (routers, controllers) → Action (processors, effectors). Feedback from action back to perception. Missing any layer breaks the loop.

2. Invest in Translations

From ANT

Message schemas and inter-node protocols matter MORE than individual node intelligence. A mediocre LLM with excellent routing outperforms a brilliant LLM with bad routing. Capability is emergent from topology.

3. Mixed Compute

From signal processing

Only Processor nodes need LLMs. Classifiers, routers, filters, accumulators can be lightweight models or pure code. Keeps cost and latency sane. Reserve expensive calls for where reasoning matters.

4. Typed Event-Driven Connections

From Max/MSP, Blueprints

Distinguish trigger inputs (fire processing) from context inputs (available but passive). Type the message wires. Dampen every feedback cycle (max iterations, circuit breakers).

5. Requisite Variety

From Ashby

Classifier/router layer must distinguish at least as many input types as you have processing strategies. Under-classification = wasted capability. Over-classification = premature complexity.

6. Domain-Aware Routing

From Cynefin

Clear = shallow/fast (skip Thinker). Complicated = specialist path. Complex = parallel probes. Chaotic = hardcoded fallback, act first. Different domains = different graph depths.

The Key Insight

The graph IS the agent. Not a single LLM with a prompt. Not a chain of API calls. A living, always-on, multi-model network of specialized processors — exactly like a signal processing graph, but for language and reasoning.

Each phase adds a node. Each node validates one architectural claim. If any claim fails, we learn something. If they all hold, we have a new kind of agent runtime.

The network is the capability (ANT). The variety must match the disturbance (Ashby). The domain determines the strategy (Cynefin). The organism needs all five systems to be viable (Beer).