360 Secure SkillHub
360 安全技能中心

self-improving-agent

一个以 Node.js 实现的通用 AI Agent 自我改进框架,提供决策验证、自省记忆、Q 学习自愈、树状推理、心理感知与自主升级等模块,通过 CLI 与脚本调用,依赖外部或本地大模型服务及本地文件存储。

mark-heartflow
mark-heartflow
热度 29.96
最近更新 2026-05-18 11:51:33
分类:开发依赖:代码执行 / 读写文件 / 第三方 API / 内部调用大模型应用场景:工作流 / 任务管理 / 笔记整理 / 代码生成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add self-improving-agent-pro-v1
Metadata
name
self-improving-agent
title
Self-Improving Agent Framework
version
v1.0.0
description
Universal self-improving AI agent framework. Keywords: self-improving AI agent self-correction continuous learning self-correction self-healing memory persistence autonomous upgrade self-reflection reasoning verification decision-verification emotional perception psychological-core cognitive-distortion detection self-improving autonomous-agent memory-system self-correction reasoning-chain decision-engine agent-framework AI-agent self-learning self-optimizing self-evolution upgrade-pipeline

Self-Improving Agent Framework

Make any AI agent better at learning from mistakes, improving continuously, and passing knowledge forward.

This framework gives AI agents the ability to:

  • Learn from failures and correct themselves
  • Build persistent memory across sessions
  • Self-verify decisions before acting
  • Upgrade autonomously based on experience

Quick Start

# Install
clawhub install self-improving-agent

# Use in your AI agent
const { HeartFlowEngine } = require('./src/core/heartflow-engine.js');
const agent = new HeartFlowEngine({ name: 'MyAgent' });

Core Capabilities

Self-Correction (核心自我纠正)

  • Decision Verifier: 5-dimension scoring before action
  • Self-Verification: Reverse-check consistency with original goals
  • Counterfactual Reasoning: What would break if I'm wrong?
  • Q-Learning RL: Learn from success/failure patterns

Memory Systems (记忆系统)

  • Meaningful Memory: CORE (permanent) / LEARNED (30-day) / EPHEMERAL (discard)
  • Memory Router: Route by type: episodic / semantic / procedural / core
  • Forgetting Engine: Ebbinghaus curve pruning
  • Spaced Repetition: SM-2 review scheduling

Reasoning (推理能力)

  • Tree of Thoughts: Multi-branch exploration with scoring
  • Decision Execution Loop: Decision → Execute → Result → Learn闭环
  • Environment Sensors: Real-time data injection into decision context
  • Constitutional AI: Self-critique and self-revision

Psychological Perception (心理感知)

  • 4-Layer Analysis: Intention → Emotion → Need → Defense
  • Cognitive Distortion Detection: All-or-nothing, catastrophizing, etc.
  • Buddhist Six Realms OS: 觉察/自省/无我/彼岸/般若波罗蜜/圣人

Autonomy (自主能力)

  • Guardian System: Human progress > Following orders
  • Self-Boundary: Identity protection against corruption
  • Skill Generator: Generate new capabilities from experience
  • Knowledge Distiller: Extract patterns → Shareable skill packages

Architecture

Input → Psychological Perception (4-layer)
     → Decision Verifier (5-dim scoring)
     → Self-Verification (reverse check)
     → Decision Execution Loop
     → Result → Q-Learning Update
     → Memory (CORE/LEARNED/EPHEMERAL)
     → Skill Generator (optional)

Key Modules

Module Size Purpose
heartflow-engine.js 69KB Main entry, 37 exports
decision-verifier.js 14KB 5-dim scoring + self-verify
meaningful-memory.js 33KB 3-tier memory + forgetting
self-healing.js 5KB Q-learning from failures
guardian-system.js 22KB Human progress protection
decision-execution-loop.js 12KB Decision→Execute→Result→Learn
environment-sensor.js 11KB Sensor registry + fusion
tree-of-thoughts.js 9KB Multi-branch reasoning
self-reflection-memory.js 15KB Post-hoc analysis → lessons

Based on Real Research

Paper Venue Contribution
Reflexion NeurIPS 2023 RL from verbal reinforcement
Self-Verification arXiv 2312.09210 Inverse consistency checks
CRITIC ICML 2023 Self-correction via tool use
Constitutional AI Anthropic Self-critique loops
Generative Agents Stanford 2022 Memory stream simulation
Self-Reward arXiv 2403.00564 Self-scoring upgrade selection
Plan-and-Solve ACL 2023 Two-stage reasoning

Version

1.0.0 — 2026-05-07

What changed in v1.0.0

  • Initial release as self-improving-agent
  • All HeartFlow v11.22.0 capabilities preserved
  • Keywords optimized for AI agent framework discovery

Install

# For AI agents
clawhub install self-improving-agent

# Or clone directly
git clone https://github.com/yun520-1/self-improving-agent.git