mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
Add a comprehensive self-evolution system that enables Hermes Agent to continuously improve through automated analysis and optimization: Core components: - reflection_engine: Nightly session analysis (1:00 AM) - evolution_proposer: Generate improvement proposals from insights - quality_scorer: Multi-dimensional session quality evaluation - strategy_injector: Inject learned strategies into new sessions - strategy_compressor: Strategy optimization and deduplication - git_analyzer: Code change pattern analysis - rule_engine: Pattern-based rule generation - feishu_notifier: Feishu card notifications for evolution events Storage: - db.py: SQLite telemetry storage - strategy_store: Persistent strategy storage - models.py: Data models Plugin integration: - plugin.yaml, hooks.py, __init__.py for plugin system - cron_jobs.py for scheduled tasks Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""
|
|
Self Evolution Plugin
|
|
=====================
|
|
|
|
Agent self-optimization and continuous evolution system.
|
|
|
|
Architecture:
|
|
- Telemetry: collects tool/session data via hooks
|
|
- Quality Scorer: evaluates session outcomes
|
|
- Dream Engine: nightly reflection at 1:00
|
|
- Evolution Proposer: generates improvement proposals
|
|
- Feishu Notifier: pushes proposals at 19:00 for user approval
|
|
- Evolution Executor: applies approved changes with rollback support
|
|
- Strategy Injector: injects learned hints into sessions
|
|
|
|
Design references from Claude Code:
|
|
- conversation-analyzer (hookify): dream analysis pattern
|
|
- Ralph Wiggum: iterative evolution with rollback
|
|
- learning-output-style: session-start strategy injection
|
|
- rule_engine (hookify): conditional strategy matching
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def register(ctx) -> None:
|
|
"""Plugin entry point — called by Hermes PluginManager.
|
|
|
|
Registers:
|
|
- 3 hooks: post_tool_call, on_session_end, pre_llm_call
|
|
- 3 slash commands: /evolve, /reflect, /evolution_status
|
|
"""
|
|
from self_evolution.db import init_db
|
|
init_db()
|
|
|
|
from self_evolution.hooks import register_all as register_hooks
|
|
register_hooks(ctx)
|
|
|
|
logger.info("self_evolution plugin loaded: 3 hooks, telemetry active")
|