HAI Agent Framework for Openclaw

An enterprise-grade AI agent framework featuring a robust hook system, automated memory extraction, and specialized core agents.

dragons777-cpu
v1.0.0
Apr 3, 2026
0
782
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install hai-agent-framework

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 hai-agent-framework 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 HAI Agent Framework?

The HAI Agent Framework is a sophisticated infrastructure designed to build and manage enterprise-level AI agents. By integrating this framework into your library of Openclaw Skills, you gain access to a powerful Hook Event System that triggers scripts at critical lifecycle moments, such as session starts or tool calls. This system ensures that your AI agents are not just reactive but are governed by structured protocols and persistent memory across different operational layers.

At its core, the framework focuses on automating the learning process. It extracts user preferences and decision-making patterns directly from conversations, storing them in a hierarchical memory structure. This allows developers to deploy highly specialized agents—ranging from security scanners to documentation writers—that possess deep, contextual knowledge of the projects they are assisting with, making it a standout choice among available Openclaw Skills.

HAI Agent Framework Use Cases

  • Automating multi-stage workflows such as code reviews and security scanning via specialized agents.
  • Implementing persistent user preference tracking across multiple development sessions.
  • Creating custom audit trails for file operations and tool usage through the Hook Event System.
  • Building self-improving AI assistants that detect frustration signals and adjust their response patterns accordingly.
  • Managing complex project contexts using the four-layer memory architecture provided by these Openclaw Skills.

How HAI Agent Framework Works

  1. The framework begins by initializing a SessionStart hook to load project-specific and global user memory.
  2. When a task is assigned, the system selects the appropriate specialized agent definition (e.g., code-reviewer or test-generator).
  3. During the interaction, the PreToolUse hook validates any requested tool calls against safety and logic parameters.
  4. The conversation analyzer runs in the background to identify new preferences, corrections, or success patterns.
  5. Upon SessionEnd, the framework summarizes the interaction and updates the L1 through L3 memory layers to improve future performance of your Openclaw Skills.

HAI Agent Framework Setup

To install the HAI Agent Framework and integrate it with your existing Openclaw Skills, use the following command:

clawhub install hai-agent-framework

Configuration is managed via the .hai/ directory. To enable a hook, create a JSON configuration in .hai/hooks/:

{
  "name": "load-memory",
  "event": "SessionStart",
  "priority": 100,
  "enabled": true,
  "action": {
    "type": "script",
    "script": ".hai/scripts/load-memory.py"
  }
}

HAI Agent Framework Data Schema & Taxonomy

The HAI Agent Framework uses a structured directory schema to manage the lifecycle of Openclaw Skills data:

Directory Purpose
.hai/agents/ Contains Markdown definitions for specialized system prompts.
.hai/hooks/ Stores JSON configurations for event-based triggers (e.g., PreToolUse).
.hai/memory/ Hierarchical storage including transcript, project, and global context.
.hai/scripts/ Executable Python scripts for hook actions and conversation analysis.
.hai/rules/ User-defined local rules and constraints for agent behavior.

HAI Agent Framework Advanced Features

  • Four-Layer Memory Architecture: Seamlessly transitions context between Session (L1), Project (L2), Global (L3), and Market (L4) knowledge bases.
  • Event-Driven Hooks: Support for SessionStart, SessionEnd, PreToolUse, PostToolUse, UserMessage, and AgentResponse for total workflow control.
  • Automated Preference Extraction: Machine-learned detection of user habits and project-specific requirements without manual input.
  • Parallel Agent Execution: Standardized system prompts allow for the concurrent operation of multiple specialized agents within the same environment.
  • Extensible Hook Scripts: Python-based executors enable developers to write complex validation and automation logic for their Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*