Skip to main content

Cognitive Orchestration

The HX47 Runtime uses a distributed orchestration model to bridge the gap between deterministic IoT protocols and stochastic AI reasoning.

The gRPC Bridge​

Communication between the TS Kernel and the Python Sidecar is strictly typed via gRPC. This ensures sub-millisecond latency for event observation and robust error handling.

Proto Definition​

The interface is defined in hx47_runtime.proto:

service CognitiveRuntime {
rpc Orchestrate(stream RuntimeEvent) returns (stream CognitionProposal);
}

Inference Pipeline​

The Python sidecar implements a multi-stage inference pipeline:

  1. Context Window Hydration: Ingests the recent graph state and device telemetry.
  2. Model Selection: Chooses between Primary (Complex reasoning) and Lightweight (Fast response) models via OpenRouter.
  3. Autonomous Proposal: Generates a set of possible actions based on the tenant's intent.

Safety Gateway​

Every cognitive proposal is intercepted by the Safety Gateway in the TS Kernel before being converted into a signed HxTP command.

Validation Steps​

  • Manifest Check: Does the proposed action exist in the device's capability manifest?
  • Rate Limiting: Has the device exceeded its command budget for the current window?
  • Tenant Lockdown: Is the tenant's account currently suspended?

Configuration​

The orchestration is controlled via these environment variables in .env.prod:

HX47_MODEL_PRIMARY="meta-llama/llama-3.2-3b-instruct:free"
HX47_MODEL_LIGHTWEIGHT="google/gemma-2-9b-it:free"
HX47_MODEL_ORCHESTRATION="openrouter/free"