mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-27 01:11:40 +00:00
feat: add self-evolution plugin — agent self-optimization system
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>
This commit is contained in:
parent
e5d41f05d4
commit
3cd384dc43
23 changed files with 6173 additions and 0 deletions
43
self_evolution/__init__.py
Normal file
43
self_evolution/__init__.py
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
"""
|
||||
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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue