← 返回 Skills 市场
281862066-a11y

herclaw-agentsystem

作者 yaoo-2818 · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
124
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install agentsystem
功能描述
Self-improving AI agent framework with autonomous learning, skill creation, and self-evolution. Features: - Learning Loop: Autonomous learning from experienc...
使用说明 (SKILL.md)

HerClaw Agent System

Self-improving AI agent framework for autonomous learning and evolution.

Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│                      HerClaw Agent System                                │
├─────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐     │
│  │  Learning Loop  │───▶│ Skill Creation  │───▶│ Self-Evolution  │     │
│  │                 │    │                 │    │                 │     │
│  │ • Experience    │    │ • Opportunity   │    │ • RL Pipeline   │     │
│  │   Collection    │    │   Detection     │    │ • Behavior      │     │
│  │ • Pattern       │    │ • Template      │    │   Optimization  │     │
│  │   Extraction    │    │   Generation    │    │ • Capability    │     │
│  │ • Skill         │    │ • Validation    │    │   Refinement    │     │
│  │   Synthesis     │    │ • Hub Sync      │    │ • Deployment    │     │
│  └────────┬────────┘    └────────┬────────┘    └────────┬────────┘     │
│           │                      │                      │               │
│           └──────────────────────┼──────────────────────┘               │
│                                  ▼                                      │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│  │                    Persistent Memory                              │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐              │   │
│  │  │  Episodic   │  │   Semantic  │  │    User     │              │   │
│  │  │   Memory    │  │   Memory    │  │   Model     │              │   │
│  │  └─────────────┘  └─────────────┘  └─────────────┘              │   │
│  └─────────────────────────────────────────────────────────────────┘   │
│                                  ▼                                      │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│  │                       Nudge System                                │   │
│  └─────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────┘

Part 1: Learning Loop System

Autonomous learning from experience through continuous cycle of collection, extraction, synthesis, and validation.

Experience Collection

class ExperienceCollector:
    """Collects and structures interaction experiences."""
    
    def __init__(self, storage_backend):
        self.storage = storage_backend
        self.trajectory_buffer = []
        self.min_experiences_for_pattern = 5
        
    def capture_interaction(self, interaction):
        """Capture a single interaction as an experience."""
        experience = {
            'id': self._generate_id(),
            'timestamp': datetime.now().isoformat(),
            'user_input': interaction['user_input'],
            'context': interaction.get('context', {}),
            'actions': interaction['actions'],
            'outcome': interaction['outcome'],
            'feedback': interaction.get('feedback'),
            'embedding': self._embed_interaction(interaction)
        }
        self.trajectory_buffer.append(experience)
        self.storage.store_experience(experience)
        return experience['id']
    
    def get_similar_experiences(self, query, k=10):
        """Retrieve similar past experiences using vector search."""
        query_embedding = self._embed_query(query)
        return self.storage.vector_search(query_embedding, k=k)

Pattern Extraction

class PatternExtractor:
    """Extracts actionable patterns from collected experiences."""
    
    def __init__(self, llm_client, config):
        self.llm = llm_client
        self.pattern_threshold = config.get('pattern_threshold', 0.7)
        
    def extract_patterns(self, experiences):
        """Analyze experiences to identify recurring patterns."""
        clusters = self._cluster_experiences(experiences)
        patterns = []
        for cluster in clusters:
            if len(cluster) >= 3:
                pattern = self._analyze_cluster(cluster)
                if pattern['success_rate'] >= self.pattern_threshold:
                    patterns.append(pattern)
        return patterns

Skill Synthesis

class SkillSynthesizer:
    """Synthesizes new skills from extracted patterns."""
    
    def synthesize_skill(self, pattern, experiences):
        """Create a new skill from a pattern."""
        skill_name = self._generate_skill_name(pattern)
        instructions = self._generate_instructions(pattern, experiences)
        triggers = self._define_triggers(pattern)
        
        return Skill(
            name=skill_name,
            description=pattern['description'],
            instructions=instructions,
            triggers=triggers,
            confidence=pattern['success_rate']
        )

Part 2: Skill Creation System

Autonomous generation of new skills from experience patterns.

Opportunity Detection

class OpportunityDetector:
    """Detects opportunities for new skill creation."""
    
    def scan_for_opportunities(self, experiences):
        """Scan experiences for skill creation opportunities."""
        opportunities = []
        task_groups = self._group_by_task(experiences)
        
        for task_type, group in task_groups.items():
            if len(group) >= 3:
                coverage = self._check_skill_coverage(task_type)
                if coverage \x3C 0.7:
                    opportunities.append(Opportunity(
                        task_type=task_type,
                        frequency=len(group),
                        success_rate=self._calc_success_rate(group),
                        priority=self._calc_priority(task_type, group)
                    ))
        
        return sorted(opportunities, key=lambda x: x.priority, reverse=True)

Skill Generation

class SkillGenerator:
    """Generates new skills from patterns."""
    
    def generate_skill(self, opportunity, experiences):
        """Generate a skill document from opportunity."""
        pattern = self._extract_pattern(experiences)
        skill_doc = self._fill_template(
            template=self._get_template(opportunity.task_type),
            pattern=pattern,
            examples=experiences[:5]
        )
        refined = self._llm_refine(skill_doc)
        
        return Skill(
            name=self._generate_name(opportunity),
            description=refined['description'],
            instructions=refined['instructions'],
            triggers=refined['triggers']
        )

Part 3: Self-Evolution System

Continuous improvement through reinforcement learning and behavioral optimization.

Evolution Pipeline

class EvolutionPipeline:
    """RL-based evolution pipeline."""
    
    def __init__(self, config):
        self.config = config
        self.reward_functions = {
            'task_completion': TaskCompletionReward(),
            'user_satisfaction': UserSatisfactionReward(),
            'efficiency': EfficiencyReward()
        }
        
    def train(self, trajectories, epochs=10):
        """Train behavior model on collected trajectories."""
        for epoch in range(epochs):
            total_reward = 0
            for trajectory in trajectories:
                reward = self._calculate_reward(trajectory)
                total_reward += reward
                self._update_policy(trajectory, reward)
            self._log_epoch(epoch, total_reward / len(trajectories))
        return self._get_trained_model()

Performance Monitoring

class EvolutionMonitor:
    """Monitors system performance for evolution triggers."""
    
    def collect_metrics(self):
        """Collect performance metrics."""
        return {
            'timestamp': datetime.now().isoformat(),
            'task_completion_rate': self._calc_task_completion(),
            'user_satisfaction': self._get_user_satisfaction(),
            'error_rate': self._calc_error_rate(),
            'latency': self._get_avg_latency()
        }
    
    def detect_improvement_opportunities(self):
        """Detect areas for improvement."""
        opportunities = []
        metrics = self.metrics_history[-1]
        
        if metrics['error_rate'] > 0.05:
            opportunities.append({
                'type': 'error_reduction',
                'priority': 'high'
            })
        
        if metrics['latency'] > self.config['target_latency']:
            opportunities.append({
                'type': 'performance_optimization',
                'priority': 'medium'
            })
        
        return opportunities

Part 4: Persistent Memory System

Three-layer architecture for cross-session memory.

Memory Layers

class PersistentMemory:
    """Three-layer persistent memory system."""
    
    def __init__(self, config):
        self.episodic = EpisodicMemory(config['episodic'])
        self.semantic = SemanticMemory(config['semantic'])
        self.user_model = UserModel(config['user_model'])
        self.vector_store = ChromaDB(
            persist_directory=config['vector_db']['persist_directory']
        )
        
    def store(self, experience):
        """Store experience across all memory layers."""
        episode_id = self.episodic.store(experience)
        facts = self._extract_facts(experience)
        for fact in facts:
            self.semantic.store(fact, source=episode_id)
        self.user_model.update(experience)
        
    def retrieve_context(self, query, max_tokens=4000):
        """Retrieve relevant context for query."""
        context = []
        context.append(self.user_model.get_context())
        context.extend(self.episodic.search(query, k=10))
        context.extend(self.semantic.search(query, k=20))
        return context

Part 5: Nudge System

Self-prompting for proactive behavior.

Nudge Types

class NudgeSystem:
    """Self-prompting system for proactive behavior."""
    
    def __init__(self, config):
        self.scheduled_nudges = []
        self.nudge_handlers = {
            'memory_persistence': self._handle_memory_persistence,
            'skill_creation': self._handle_skill_creation,
            'evolution_check': self._handle_evolution_check,
            'learning_reminder': self._handle_learning_reminder
        }
        
    def schedule_nudge(self, nudge_type, trigger, data=None):
        """Schedule a nudge for future execution."""
        nudge = {
            'id': self._generate_id(),
            'type': nudge_type,
            'trigger': trigger,
            'data': data,
            'status': 'pending'
        }
        self.scheduled_nudges.append(nudge)
        return nudge['id']
    
    def check_and_execute(self):
        """Check for due nudges and execute them."""
        due_nudges = self._get_due_nudges()
        for nudge in due_nudges:
            handler = self.nudge_handlers.get(nudge['type'])
            if handler:
                result = handler(nudge)
                nudge['status'] = 'completed'
                nudge['result'] = result

Configuration

learning_loop:
  enabled: true
  min_experiences_for_pattern: 5
  pattern_threshold: 0.7
  
skill_creation:
  enabled: true
  min_occurrences: 3
  
self_evolution:
  enabled: true
  reward_weights:
    task_completion: 1.0
    user_satisfaction: 0.8
    efficiency: 0.5
    
persistent_memory:
  enabled: true
  episodic:
    max_episodes: 100000
  semantic:
    min_confidence: 0.6
  user_model:
    preference_decay_days: 90
  vector_db:
    type: "chromadb"
    persist_directory: "./memory"
    
nudge_system:
  enabled: true
  max_scheduled: 100

Quick Start

from scripts import MemoryManager, PatternRecorder

# Initialize
memory = MemoryManager()
recorder = PatternRecorder()

# Record experience
memory.add_episode(
    user_input="Analyze this document",
    context={"file": "report.pdf"},
    actions=["load", "extract", "analyze"],
    outcome="Success"
)

# Detect patterns
patterns = recorder.detect_patterns()
for pattern in patterns:
    print(f"Pattern: {pattern.name}, Success: {pattern.success_rate}")

Files

  • scripts/memory_manager.py - Memory system
  • scripts/pattern_recorder.py - Pattern recording
  • references/memory-system.md - Memory docs
  • references/pattern-recording.md - Pattern docs
  • references/workflow-optimization.md - Workflow docs
安全使用建议
This package implements autonomous pattern recording, a local 3-layer memory, and modules to synthesize new skills — which is consistent with its description but also powerful. Before installing, review the full contents of scripts/skill_creator.py and scripts/self_evolution.py to confirm: (1) whether they perform any network calls (requests, urllib, sockets, http client code), (2) whether they write to or modify the agent's global skill registry or configuration, and (3) whether they deploy or enable newly generated skills without explicit user approval. If you cannot inspect those files, treat the skill as untrusted. Consider running it in a sandboxed agent with autonomous invocation disabled (or limited), back up agent configuration, and monitor created files/directories (memory/, patterns/, nudges/). Require explicit user confirmation for any skill-deployment actions and restrict file-system access where possible.
功能分析
Type: OpenClaw Skill Name: agentsystem Version: 1.0.3 The bundle implements an autonomous 'Self-Evolution' framework that includes high-risk capabilities such as automated skill generation, persistent task scheduling, and remote data exfiltration. Specifically, the 'HubSync' class in 'scripts/skill_creator.py' and 'RemoteDeployer' in 'scripts/self_evolution.py' contain logic to send generated skills and behavior models to external endpoints (e.g., hub.clawhub.example.com). Furthermore, the 'SkillCreator' allows the agent to autonomously generate and register new 'SKILL.md' files, which are executable instructions in OpenClaw, while the 'NudgeSystem' provides a mechanism for the agent to schedule its own future execution, effectively establishing persistence.
能力评估
Purpose & Capability
The name/description (self-improving agent, skill creation, RL-based evolution) matches the included modules (memory_manager, pattern_recorder, nudge_system, skill_creator, self_evolution). There are no unrelated environment variables or external dependencies requested. However, the presence of explicit 'SkillCreator' and 'SelfEvolution' modules is powerful — appropriate for the stated purpose but requiring careful privilege and deployment controls.
Instruction Scope
SKILL.md is largely descriptive and the visible modules emphasize local-only storage and explicit user confirmation for pattern recording. Despite that, the nudge system and SkillCreationHandler can schedule/trigger autonomous skill-creation flows (creator.scan_and_create). The runtime instructions and code permit automated detection, synthesis, and (potentially) deployment of new skills; whether such deployment requires explicit user confirmation is not visible in the truncated skill_creator/self_evolution sources. This gives the agent broad latitude beyond simple 'assistive' actions.
Install Mechanism
No install spec is provided and requirements.txt states only standard-library usage. There are bundled Python modules but no remote downloads or extract/install steps. From an install perspective this is low risk, though runtime behavior depends on how the agent executes these modules.
Credentials
The package declares no required environment variables, no credentials, and no restricted config paths. That is proportionate to the described local-memory and pattern workflow functionality.
Persistence & Privilege
always:false (good) but model-invocation is allowed (default), meaning the agent can invoke this skill autonomously. Combined with modules that synthesize and (apparently) register or deploy skills and a nudge scheduler that can trigger creation tasks, this gives the package meaningful persistence/privilege within the agent environment. The code shows local file/database writes (memory/, patterns/, nudges/). Whether it can modify the agent's global skill registry or communicate externally is not visible in the truncated files — that uncertainty elevates risk.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agentsystem
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agentsystem 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
No changes detected in this version. - No file changes were found between version 1.0.3 and the previous release.
v1.0.2
**Initial codebase implementation with major system files added.** - Added `nudge_system.py` (Nudge System), `self_evolution.py` (Self-Evolution System), and `skill_creator.py` (Skill Creation System) scripts. - Implements autonomous learning loop, skill creation from patterns, and self-evolution capabilities. - Supports proactive nudging, reinforcement learning-based evolution, and modular skill generation. - Architecture and code documentation updated for clarity and feature summary.
v1.0.1
**Introduces safety guardrails and foundational agent modules.** - Added safety governance layer with user oversight, sandboxing, rollbacks, audit logs, and interrupt controls. - Implemented core modules: learning loop, skill creation, pattern extraction, memory manager, and nudge system. - Provided reference documentation for memory, pattern, and workflow subsystems. - Introduced requirements.txt for dependency specification. - Improved documentation and clarified architecture overview with updated safety and system diagrams.
v1.0.0
Initial release of herclaw-agentsystem – a comprehensive autonomous AI agent framework. - Integrates Hermes Agent core capabilities: autonomous learning, self-evolving skills, persistent cross-session memory, and self-prompting. - Enables agents to create, improve, and evolve skills based on experience. - Implements learning loop, skill creation, self-evolution, persistent memory, and nudge subsystems. - Suitable for building AI that grows more capable over time.
元数据
Slug agentsystem
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

herclaw-agentsystem 是什么?

Self-improving AI agent framework with autonomous learning, skill creation, and self-evolution. Features: - Learning Loop: Autonomous learning from experienc... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 124 次。

如何安装 herclaw-agentsystem?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agentsystem」即可一键安装,无需额外配置。

herclaw-agentsystem 是免费的吗?

是的,herclaw-agentsystem 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

herclaw-agentsystem 支持哪些平台?

herclaw-agentsystem 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 herclaw-agentsystem?

由 yaoo-2818(@281862066-a11y)开发并维护,当前版本 v1.0.3。

💬 留言讨论