cnexus-cognitive-core

Other

Zero LLM Dependency | Pure Local <10ms Latency | Bio-inspired Reflection Loop. A high-reliability, kernel-level 6-step deterministic cognitive state machine for OpenClaw agents with belief evolution, context fusion, and cross-skill influence propagation.

Install

openclaw skills install @plusunm/cnexus-cognitive-core

🧠 CNexus 6-Step Cognitive OS Kernel Extension

🚀 Zero LLM Dependency | Pure Local <10ms Latency | Bio-inspired Reflection Loop

cnexus-cognitive-core is a high-reliability, kernel-level extension specifically engineered for the OpenClaw framework. It replaces traditional, rigid linear execution pipelines with a deterministic, native 6-step cognitive state machine, bringing true self-reflection, belief evolution, adaptive context awareness, and cross-skill resonance to your agents.

If you are building production-grade autonomous agents, advanced NPC decision brains, intelligent cockpits, or edge computing operating systems that require long-term evolutionary stability, multi-dimensional context fusion, and strictly guardrailed (zero-hallucination) execution, this component serves as your definitive cognitive engine.


🌟 Core Architecture & Capabilities

1. Deterministic Cognitive Loop & Reflection (P0.1 - P0.3)

  • 6-Step Cognitive Close-Loop: Executes an unyielding sequence of OBSERVECOGNIZEDECIDESPEAKSTOREREFLECT on every cycle.
  • Long-Term Belief Adjustment: During the REFLECT phase, the kernel dynamically adapts its global belief weight (accumulated_weight) based on continuous memory recall strength. It features strict boundary dampening (safely capped at 2.0) to guarantee ultra-stable, smooth cognitive awakening.
  • Self-Model Tracking: Real-time internal state tracking intensifies focus when identical consecutive intents are observed, but instantly resets counters to zero during context shifts (e.g., switching from storage to retrieval), providing robust state isolation.

2. 3D Context Fusion & Confidence-Based Routing (P2-B)

  • Multi-Dimensional Graph Melting: Before executing any sub-skill, the kernel fuses the active intent, long-term belief status, sliding memory snapshot (past 5 blocks), and global strategic goals to compute a precise Alignment Score.
  • Safe Multi-Mode Execution: Dynamically routes workloads based on confidence thresholds:
  • High Confidence Execution Mode — Unlocks full performance when the environmental context perfectly aligns.
  • Low Confidence Stub Mode — Gracefully downgrades and applies execution constraints when context is misaligned, eliminating rogue agent behavior or "hallucinations" without costly LLM API overhead.

3. Cross-Skill Interaction Graph & Influence Propagation (P2-C)

  • Sequential Dependency Mapping: Within complex Directed Acyclic Graph (DAG) task scheduling, pre-requisite skills propagate their completion momentum as an "Influence Score" to subsequent nodes.
  • Distance Exponential Decay Model: Implements a biological-concentration decay curve ($0.5 \times 0.7^i$). Downstream skills inherit the "cognitive residual warmth" of preceding tasks, enabling organic, high-cohesion multi-skill synergy.

4. Asset Virtualization & Standard Nested Metadata (P2-A)

  • 178 Industrial Skills Objectified: Fully decouples legacy hardcoded stubs. Your entire skill library is registered as standardized Skill objects during the Boot phase, making boundaries and recovery hints fully transparent to the microkernel.
  • Metadata-Aligned Memory blocks: Commits strictly formatted skill_execution_trace and skill_memory_block records with nested metadata (including accurate boot timestamps, iterations, routing strategies, decay factors, and reference counts).

📈 Official Benchmark Performance

Tested under a perfectly clean, isolated session (invoking reset() first), the kernel exhibits an exceptionally stable Belief Evolution Trajectory. Buyers can run the local validation script to observe identical deterministic convergence:

  Iter  Input              Belief  Consec  Policy         State
  ────  ─────────────      ──────  ──────  ────────────   ───────────────────────
  #0    store a memory      0.000     0     SPEAK          Clean initialization
  #1    store data          0.026     2     SPEAK          Gradual memory recall
  #2    store data          0.066     3     SPEAK          Intent reinforcement
  #3    recall project      0.090     0     RECALL         Precise routing, consec resets
  #4    store log           0.117     0     SPEAK          Policy switches back
  #5    store final         0.146     5     SPEAK          Long-term convergence (0.0~0.5)

📥 Developer Quick-Start Guide

1. One-Click Installation

Deploy the certified package directly via the OpenClaw package manager:

clawhub install cnexus-cognitive-core

2. Seamless Integration Example

from openclaw.core import ClawRegistry

# Retrieve the life-cycle-managed cognitive core extension
cognitive_extension = ClawRegistry.get_skill("cnexus-cognitive-core")

# Trigger the 6-step cognitive pipeline (Zero-LLM latency, <10ms locally)
response = cognitive_extension.handle_request("store my project checkpoint")

# Monitor runtime health data (execution counts, current mode, memory totals)
print("Runtime Health Diagnostics:", cognitive_extension.get_status())

📄 Distribution Details

  • Type: Kernel Level Extension (kernel_extension)
  • Entry Point: src.CNexusOSSkillExtension
  • Min Claw Version: 1.5.0
  • License: MIT
  • Shipped Assets: kernel.py (production-ready 37KB), __init__.py (OpenClaw lifecycle wrapper), manifest.json (ClawHub metadata)

Future-Proof Design

Built with native goal: None placeholders in the runtime context. When your project matures, you can seamlessly plug in any higher-order semantic LLM planner (Goal/Planner System) to upgrade basic alignment into deep semantic multi-agent alignment instantly.

Package Structure

cnexus-cognitive-core/
├── manifest.json       ← ClawHub metadata
├── README.md           ← Market documentation
├── SKILL.md            ← Skill specification
├── test_benchmark.py   ← Standard validation script
└── src/
    ├── __init__.py     ← OpenClaw lifecycle entrypoint
    └── kernel.py       ← 37KB cognitive loop kernel

Benchmark Script

Run the bundled validation to verify your environment:

python test_benchmark.py

Expected output: BENCHMARK PASSED with belief trajectory 0.000 → 0.146.


🎭 Premium Workflow: Persona Distiller (Cognitive Trait Extractor)

Instant KOL/Influencer Cloning | Expert Cognitive Trait Distillation | Bio-Inspired NPC Personality Replication

Persona Distiller is an advanced, higher-order workflow extension powered by the CNexus v2 Cognitive Kernel. It completely revolutionizes the way digital twins are created. Instead of relying on brittle, prompt-engineered system instructions that easily fracture over long conversations, Persona Distiller clones the target subject's actual logical momentum, long-term belief evolution, and associative memory networks at the microkernel level.

Whether you are looking to deploy a 24/7 highly authentic digital twin of a top influencer, extract the rigorous analysis pathways of a domain expert for consulting, or inject unique humor and evolving emotional memory into a game NPC, Persona Distiller delivers an entirely local, zero-token, and mathematically guardrailed persona replication engine.

The Revolutionary "3-Step Pipeline"

No expensive distributed fine-tuning or GPU cluster renting required:

  1. Ingest Raw Footprints: Gather recent 3-month structured text footprints from the target individual (social media feeds, blog posts, essays, or transcripts in .txt or .json).
  2. One-Click Mind Injection: Invoke the kernel boot() sequence to parse and commit the logs. The engine automatically deconstructs individual thought fragments into metadata-aligned skill_memory_block segments.
  3. Penetrative Cognitive Routing: Route user prompts through handle_request(). Any dynamic input will now pass through the subject's localized "Long-term Belief Pool" and "Cognitive Residual Decay Network" to produce context snapshots that match their worldview.

How It Strategically "Steals" a Persona's Thought Patterns

Traditional role-play agents suffer from "character breaking" or terminal logic drift after a few rounds of chat. Persona Distiller guards personality cohesion using 3 native kernel layers:

  • Trigger & Reflex Mapping (Bio-inspired Cognition): Isolates condition-reflex triggers and habitual focus zones unique to the subject. Topics they care about or frequent emotional catalysts are translated into multi-dimensional memory weights during _cognize(), inheriting their acute psychological sensitivities.
  • Strategic Policy Routing (Decision Trait Routing): When confronted with a challenging input, does the target personality aggressively counter-argue (SPEAK policy) or calmly quote data and documentation (RECALL policy)? The kernel mathematically locks into their verified confidence thresholds and decision-making habits.
  • Continuity & Thinking Warmth (Cognitive Residual Warmth): Human speech possesses logical momentum. The native $0.5 \times 0.7^i$ distance exponential decay model flawlessly replicates the subject's attention shifts and stream-of-consciousness continuity over long, multi-turn dialogue sequences.

Key Industry Use Cases

  • 【KOL & Digital Twins】 Feed three months of an investor's or influencer's public commentary to instantly stand up a digital avatar that inherently retains their core opinions, professional intuition, and signature conversational style.
  • 【Domain Expert Advisory Agents】 Import historical case studies and published analyses of a senior attorney, psychologist, or systems architect. Distill their logic pathways to build highly accurate, local triage consulting agents.
  • 【Deep-Memory Game NPCs】 Feed background lore and character diaries into the system. Combined with the kernel's unique belief-climbing and decay formulas, your NPC will naturally experience "gradual awakening" and retain subtle "emotional residual marks" across encounters with the player.

Developer Integration Example

from openclaw.core import ClawRegistry

# 1. Fetch the Persona Distiller workflow component from ClawHub
distiller = ClawRegistry.get_workflow("cnexus-persona-distiller")

# 2. Inject 3 months of raw footprint data to calibrate the digital brain
distiller.inject_persona(source_path="./expert_3_months_footprints.json")

# 3. Engage with the digital twin (microkernel processing takes <10ms locally)
# The resulting context snapshot is deeply fused with the subject's belief curves
ctx_snapshot = distiller.handle_request("What is your perspective on the current AI market bubble?")

# 4. Forward the highly aligned snapshot context to your localized LLM generation layer
# The LLM now easily adopts the exact vocabulary, stance, and syntax of the target persona
final_reply = my_local_llm.generate(context=ctx_snapshot)
print(final_reply)

Future-Proof Design

Because the architecture maintains a strict goal: None placeholder, you can purchase this today as a pristine style/logic cloner, and later hot-plug an LLM semantic planner to evolve it into a fully autonomous, mission-driven digital clone.