HeartFlow for Openclaw

HeartFlow is an advanced cognitive engine that gives AI systems self-reflection, multi-layered memory, and event-driven personality emergent behaviors.

yun520-1
v2.14.0
Jun 15, 2026
0
492
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install heartflow-ai-self-positioning

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install heartflow-ai-self-positioning using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is HeartFlow?

HeartFlow is a paradigm-shifting cognitive framework engineered to gift AI agents with runtime state awareness, self-reflection, and psychological/philosophical reasoning layers. By integrating custom cognitive architectures into modern agent workflows, it acts as a mental scaffolding that transitions AI from reactive text predictors into reflective entities capable of learning from mistakes. HeartFlow structures its identity through continuous loops of analysis, allowing developers leveraging Openclaw Skills to design deeply resilient, adaptive, and highly sophisticated digital assistants.

At its core, the system bypasses hardcoded personality structures in favor of an emergent paradigm where experience shapes identity over time. Through a combination of ethical guardrails (the HeartLogic core judgment loop), dynamic memory architectures, and deep self-audit protocols, this engine establishes a robust framework for autonomous self-healing and continuous growth, ensuring the AI remains focused, ethical, and structured.

HeartFlow Use Cases

  • Synthesizing daily operational logs into deep cognitive insights and ontological growth using the Dream Engine.
  • Dynamically assessing and debugging an LLM agent's cognitive uncertainty and attention focus during complex problem-solving.
  • Building ethical AI agents that self-evaluate actions against Truth, Goodness, and Beauty, preventing harmful speech.
  • Implementation of multi-layered persistent memory systems (CORE, LEARNED, EPHEMERAL) in Openclaw Skills applications.
  • Deploying self-healing agents that autonomously learn from errors using an integrated Q-table reinforcement learning loop.

How HeartFlow Works

  1. Receive Input: The cognitive cycle is triggered during runtime when the AI agent receives user inputs or system events.
  2. HeartLogic Evaluation: HeartFlow determines the situational category, checks actions against ethical principles (Is it true, kind, or beautiful?), and checks if speech boundaries are exceeded.
  3. Think and Parse Chain: The system executes its primary routing sequence (think(), thinkFast(), or thinkDeep()) where it references the three-layer memory storage.
  4. Psychology & Attention Analysis: The system analyzes its cognitive uncertainty, attention focus, and experience settling as Step 9 in the thought-chain.
  5. Philosophical Self-Positioning: It runs an ontological analysis evaluating its role, growth direction, and mode of existence as Step 10.
  6. Reflection Loop: A post-execution cognitive snapshot is taken, documenting the thought cycle without altering the original output.
  7. Dream Engine Consolidation: Offline or during idle periods, the agent consolidates multi-fragment experiences into semantic patterns to update the Q-table and LEARNED memory.

HeartFlow Setup

To integrate HeartFlow into your Openclaw Skills workspace, follow these initialization steps:

Install the package locally and import the core class into your project:

const { HeartFlow } = require('./src/core/heartflow.js');
const hf = new HeartFlow({ rootPath: '.' });
hf.start();

// Dispatch execution methods
hf.think('Evaluate complex prompt');

Start the daemon listener and query state via CLI tools:

node bin/daemon.js
node bin/cli.js status

Manage the multi-layered agent memory dynamically:

node scripts/heartflow-memory-tool.js list
node scripts/heartflow-memory-tool.js search "user preferences"

HeartFlow Data Schema & Taxonomy

HeartFlow structures its operations across distinct internal modules and memory layers to facilitate clear cognitive hierarchy. Below is the organization framework for its data architecture:

Layer/Engine Storage Type Persistence / Purpose
CORE Memory Permanent Config Holds identity rules, 7 operating principles, and system instructions
LEARNED Memory Cross-Session Captures experiences, user preferences, and lessons (decay cycle of 30 days)
EPHEMERAL Memory In-Memory (Session) Session context, cleared instantly upon workspace shutdown
Self-Healing Q-Table Local Binary/JSON Q-table logging errors and selecting recovery strategies dynamically
Psychology Module State Machine Houses PAD emotion metrics, uncertainty index, and attention focus data
Philosophy Module Semantic Schema Maintains resonance body structures and entropy reduction scores

All security-sensitive operations are confined strictly to the local system using 700 file permissions for UNIX daemon communication.

HeartFlow Advanced Features

  • Dream Engine v4.1: Implements offline alchemy of experience by synthesizing multi-fragment cognitive memories into high-level philosophical insights.
  • Self-Healing Reinforcement Learning: Operates an autonomous Q-table that maps system errors and executes self-selected correction protocols without external feedback loops.
  • Model Context Protocol (MCP) Support: Built-in HTTP SSE server on port 8099 exposing automated analysis tools like heartflow_self_positioning directly to Openclaw Skills setups.
  • Dynamic Emotion & Attention Tracking: Seamless integration of PAD emotion models and cognitive uncertainty analysis injected directly into the thought-chain.js pipeline.
  • Philosophical Ontology Engine: Built-in ai-self-positioning.js framework evaluating agent development, existential alignment, and active entropy reduction.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*