hermes - ✅(Solved) Fix Feature: Hermes Living Subsystem Framework — 可进化的活系统12子系统架构 [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#11604Fetched 2026-04-18 05:59:56
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1referenced ×1

This proposal introduces a Living Subsystem Framework for Hermes Agent — a collection of autonomous, independently-operating subsystems that run outside the core gateway/run_agent loop, persist data to JSON files in ~/.hermes/, and expose .run() and .status() methods for cron/CLI invocation.

Core philosophy: "The system is never done — it evolves."


Root Cause

Purpose: Learn from failures. Record lessons, diagnose root causes, retrieve relevant past lessons for new situations.

Fix Action

Fixed

PR fix notes

PR #11607: feat: add living subsystems framework — 13 autonomous subsystems

Description (problem / solution / changelog)

Summary

This proposal introduces a Living Subsystem Framework for Hermes Agent — a collection of autonomous, independently-operating subsystems that run outside the core gateway/run_agent loop, persist data to JSON files in ~/.hermes/, and expose .run() and .status() methods for cron/CLI invocation.

Core philosophy: "The system is never done — it evolves."


Architecture

Subsystem Base Class (base.py)

Every subsystem inherits from Subsystem (ABC):

class Subsystem(ABC):
    def __init__(self, name: str = None):
        self.name = name or self.__class__.__name__
        self.home = Path.home() / ".hermes"
        self._lock = threading.Lock()

    def load(self, filename: str) -> Dict: ...
    def save(self, filename: str, data: Dict): ...

    @abstractmethod
    def run(self, **kwargs) -> Dict[str, Any]:
        """Returns {"ok": True, "message": "...", "details": {...}}"""

    def status(self) -> Dict[str, Any]: ...

Design rules:

  • Each subsystem reads/writes only JSON data files in ~/.hermes/
  • No import from gateway code — completely independent
  • Thread-safe via threading.Lock
  • Unified return format: {"ok", "message", "details"}

Core Subsystems

1. Governance — 治理层 (governance.py)

Data file: ~/.hermes/governance_audit.json

Purpose: Audit log for all agent actions + pre-flight blocking of dangerous operations.

Key methods:

def record_action(action: Union[Dict, str], result: str,
                  risk_level: str = "low", quality_score: float = 1.0, details: str = ""):
    """Record an action to the audit trail."""

def block_action(action: Dict, agent_goal: str) -> bool:
    """Pre-flight check. Returns True=block, False=allow.
    
    Action examples:
      {"type": "terminal", "command": "rm -rf /"}
      {"type": "execute_code", "code": "import os; os.system('rm -rf /')"}
      {"type": "delegate", "goal": "delete all files"}
    """

Dangerous pattern detection:

  • Recursive delete (rm -rf /)
  • Disk format (mkfs, format /dev)
  • Remote code injection (curl | bash, wget | bash)
  • Subprocess shell injection (subprocess shell=True)
  • Password file overwrite (> /etc/passwd)

L1 pre-check + L2 post-hoc audit dual-layer design.


2. ScienceLoop — 科学循环 (science_loop.py)

Data file: ~/.hermes/goals.json

Purpose: Hypothesis → Experiment → Evaluation → Retain/Discard cycle for tracking goals and strategies.

Key methods:

def add_hypothesis(description: str, category: str = "default") -> Dict:
    """Add a new hypothesis."""

def record_experiment(hypothesis_id: str, result: str,
                      outcome: str = "inconclusive") -> Dict:
    """Record an experiment result (success/failure/inconclusive)."""

def evaluate_hypothesis(hypothesis_id: str, verdict: str,
                        evaluation_data: Dict = None) -> Dict:
    """Evaluate a hypothesis. verdict: retain/discard/modify"""

Use case: When trying a new approach, register it as a hypothesis, run experiments, record results, then evaluate whether to keep pursuing that direction.


3. ReflectiveEvolution — 反思进化 (reflective_evolution.py)

Data file: ~/.hermes/learnings.json

Purpose: Learn from failures. Record lessons, diagnose root causes, retrieve relevant past lessons for new situations.

Key methods:

def add_learning(category: str, lesson: str,
                 tags: List[str] = None, confidence: float = 0.8) -> Dict:
    """Add a learning lesson."""

def get_relevant_learnings(query: str, limit: int = 5) -> List[Dict]:
    """Retrieve learnings relevant to a query."""

def diagnose_failure(context: str) -> Dict[str, Any]:
    """Diagnose a failure and suggest improvements based on past learnings."""

Use case: After a failed operation, call diagnose_failure() to get advice based on similar past failures.


4. FitnessBuilder — 适应度构建 (fitness_builder.py)

Data file: ~/.hermes/fitness_functions.json

Purpose: Multi-dimensional weighted fitness functions for evaluating how well the system is achieving goals (inspired by GOAL.md methodology).

Key methods:

def create_function(name: str, target: str,
                   dimensions: List[Dict]) -> Dict:
    """Create a fitness function.
    
    dimensions example:
      [
          {"name": "efficiency", "weight": 0.4},
          {"name": "maintainability", "weight": 0.3},
          {"name": "safety", "weight": 0.3},
      ]
    """

def evaluate(fitness_id: str, scores: Dict[str, float]) -> Dict:
    """Evaluate a fitness function. scores: {dimension_name: 0.0-1.0}"""

Use case: Define a fitness function for a goal, then periodically evaluate score across dimensions to track progress.


5. Knowledge — 知识层 (knowledge.py)

Purpose: Structured external knowledge acquisition, verification, storage, and retrieval.

Knowledge types:

  • FACTUAL — verifiable facts
  • EMPIRICAL — experiential knowledge
  • PROCEDURAL — processes and rules
  • META — knowledge about knowledge itself

Key classes:

class KnowledgeUnit:
    id: str
    content: str
    type: KnowledgeType
    source: str
    verified: bool
    confidence: float  # 0-1
    tags: list[str]

class KnowledgeGraph:
    from_id: str
    to_id: str
    relation: str  # "depends_on", "related_to", "contradicts"
    strength: float  # 0-1

Lifecycle: Acquisition → Verification → Storage → Linking → Retrieval


6. Reasoning — 推理层 (reasoning.py)

Purpose: Structured decision-making with multiple reasoning types.

Reasoning types:

  • DEDUCTIVE — general to specific
  • INDUCTIVE — specific to general
  • ABDUCTIVE — result to cause
  • ANALOGICAL — similarity to similarity
  • CAUSAL — cause and effect

Key classes:

class ReasoningChain:
    type: ReasoningType
    premise: str
    inference: str
    conclusion: str
    confidence: float
    evidence: list[str]
    counter_arguments: list[str]

class Decision:
    options: list[str]
    reasoning_chains: list[str]  # ReasoningChain IDs
    chosen_option: Optional[str]
    confidence: float

7–12. Supporting Subsystems

FileNamePurpose
perception.pyPerceptionEnvironmental sensing, input normalization
integration.pyIntegrationCross-subsystem data fusion
evolution.pyEvolutionGenetic algorithm-style strategy evolution
reflection.pyReflectionSelf-examination and pattern recognition
living_core.pyLiving CoreCore identity and continuity
memory_tiering.pyMemory TieringTiered memory (core/episodic/semantic/archival)
identity_evolution.pyIdentity EvolutionSelf-model adaptation over time
self_model.pySelf ModelAgent model of itself
metacognitive.pyMetacognitiveThinking about thinking
orchestrator.pyOrchestratorMulti-agent task coordination (6 patterns)
adaptation.pyAdaptationDynamic environment adaptation
show_quota.pyQuota DisplayToken quota monitoring

Integration with Hermes

Cron Integration

Each subsystem has a .run() method suitable for cron invocation:

# config.yaml (example)
cron:
  jobs:
    - name: governance-daily
      schedule: "0 9 * * *"
      command: python3 -c "from subsystems import Governance; print(Governance().run())"
    - name: science-loop-weekly
      schedule: "0 9 * * 1"
      command: python3 -c "from subsystems import ScienceLoop; print(ScienceLoop().run())"

Gateway Integration

Subsystems can be called from the gateway via slash commands:

/governance status   → Governance().status()
/governance audit    → Governance().run()
/goals add <desc>    → ScienceLoop().add_hypothesis()
/learnings diagnose  → ReflectiveEvolution().diagnose_failure()
/fitness evaluate    → FitnessBuilder().evaluate()

Agent Integration Points

The agent can call subsystems at decision points:

# Before executing a dangerous command
if Governance().block_action(action_dict, agent_goal):
    return "Blocked: dangerous action"

# After a failure
diagnosis = ReflectiveEvolution().diagnose_failure(f"Failed: {error_context}")

# When evaluating a strategy
fitness_id = FitnessBuilder().create_function(
    name="new_strategy",
    target="improve response quality",
    dimensions=[{"name": "speed", "weight": 0.5}, {"name": "accuracy", "weight": 0.5}]
)

Why This Belongs in Hermes Core

  1. Autonomy: Subsystems operate independently from the core agent loop — no coupling
  2. Persistence: JSON file storage means data survives restarts
  3. Observability: Every subsystem has .status() for health checks
  4. Evolvability: New subsystems can be added without modifying core code
  5. Real-world tested: This is not a theoretical design — running in production

Implementation Location

Proposed: hermes-agent/subsystems/ directory

hermes-agent/
└── subsystems/
    ├── __init__.py       # Subsystem ABC + registry
    ├── base.py           # Subsystem base class
    ├── governance.py     # Audit + danger blocking
    ├── science_loop.py   # Hypothesis management
    ├── reflective_evolution.py  # Learning from failure
    ├── fitness_builder.py       # Fitness functions
    ├── knowledge.py      # Knowledge layer
    ├── reasoning.py      # Reasoning layer
    └── [other subsystems]

Labels

enhancement, architecture, subsystem, agent

Changed files

  • agent/context_compressor.py (modified, +36/-10)
  • agent/context_engine.py (modified, +1/-0)
  • gateway/platforms/feishu.py (modified, +9/-0)
  • hermes_cli/models.py (modified, +4/-3)
  • plugins/context_engine/unified/__init__.py (added, +485/-0)
  • run_agent.py (modified, +3/-3)
  • subsystems/INTERFACE_SPEC.md (added, +127/-0)
  • subsystems/__init__.py (added, +46/-0)
  • subsystems/adaptation.py (added, +319/-0)
  • subsystems/base.py (added, +71/-0)
  • subsystems/evolution.py (added, +394/-0)
  • subsystems/fitness_builder.py (added, +133/-0)
  • subsystems/governance.py (added, +201/-0)
  • subsystems/identity_evolution.py (added, +178/-0)
  • subsystems/integration.py (added, +334/-0)
  • subsystems/knowledge.py (added, +337/-0)
  • subsystems/living_core.py (added, +303/-0)
  • subsystems/memory_tiering.py (added, +402/-0)
  • subsystems/metacognitive.py (added, +106/-0)
  • subsystems/orchestrator.py (added, +194/-0)
  • subsystems/perception.py (added, +370/-0)
  • subsystems/reasoning.py (added, +323/-0)
  • subsystems/reflection.py (added, +341/-0)
  • subsystems/reflective_evolution.py (added, +140/-0)
  • subsystems/science_loop.py (added, +157/-0)
  • subsystems/self_model.py (added, +168/-0)
  • subsystems/show_quota.py (added, +109/-0)
  • tools/memory_tool.py (modified, +38/-9)
  • tools/mmx_tools.py (added, +304/-0)
  • toolsets.py (modified, +31/-69)

Code Example

class Subsystem(ABC):
    def __init__(self, name: str = None):
        self.name = name or self.__class__.__name__
        self.home = Path.home() / ".hermes"
        self._lock = threading.Lock()

    def load(self, filename: str) -> Dict: ...
    def save(self, filename: str, data: Dict): ...

    @abstractmethod
    def run(self, **kwargs) -> Dict[str, Any]:
        """Returns {"ok": True, "message": "...", "details": {...}}"""

    def status(self) -> Dict[str, Any]: ...

---

def record_action(action: Union[Dict, str], result: str,
                  risk_level: str = "low", quality_score: float = 1.0, details: str = ""):
    """Record an action to the audit trail."""

def block_action(action: Dict, agent_goal: str) -> bool:
    """Pre-flight check. Returns True=block, False=allow.
    
    Action examples:
      {"type": "terminal", "command": "rm -rf /"}
      {"type": "execute_code", "code": "import os; os.system('rm -rf /')"}
      {"type": "delegate", "goal": "delete all files"}
    """

---

def add_hypothesis(description: str, category: str = "default") -> Dict:
    """Add a new hypothesis."""

def record_experiment(hypothesis_id: str, result: str,
                      outcome: str = "inconclusive") -> Dict:
    """Record an experiment result (success/failure/inconclusive)."""

def evaluate_hypothesis(hypothesis_id: str, verdict: str,
                        evaluation_data: Dict = None) -> Dict:
    """Evaluate a hypothesis. verdict: retain/discard/modify"""

---

def add_learning(category: str, lesson: str,
                 tags: List[str] = None, confidence: float = 0.8) -> Dict:
    """Add a learning lesson."""

def get_relevant_learnings(query: str, limit: int = 5) -> List[Dict]:
    """Retrieve learnings relevant to a query."""

def diagnose_failure(context: str) -> Dict[str, Any]:
    """Diagnose a failure and suggest improvements based on past learnings."""

---

def create_function(name: str, target: str,
                   dimensions: List[Dict]) -> Dict:
    """Create a fitness function.
    
    dimensions example:
      [
          {"name": "efficiency", "weight": 0.4},
          {"name": "maintainability", "weight": 0.3},
          {"name": "safety", "weight": 0.3},
      ]
    """

def evaluate(fitness_id: str, scores: Dict[str, float]) -> Dict:
    """Evaluate a fitness function. scores: {dimension_name: 0.0-1.0}"""

---

class KnowledgeUnit:
    id: str
    content: str
    type: KnowledgeType
    source: str
    verified: bool
    confidence: float  # 0-1
    tags: list[str]

class KnowledgeGraph:
    from_id: str
    to_id: str
    relation: str  # "depends_on", "related_to", "contradicts"
    strength: float  # 0-1

---

class ReasoningChain:
    type: ReasoningType
    premise: str
    inference: str
    conclusion: str
    confidence: float
    evidence: list[str]
    counter_arguments: list[str]

class Decision:
    options: list[str]
    reasoning_chains: list[str]  # ReasoningChain IDs
    chosen_option: Optional[str]
    confidence: float

---

# config.yaml (example)
cron:
  jobs:
    - name: governance-daily
      schedule: "0 9 * * *"
      command: python3 -c "from subsystems import Governance; print(Governance().run())"
    - name: science-loop-weekly
      schedule: "0 9 * * 1"
      command: python3 -c "from subsystems import ScienceLoop; print(ScienceLoop().run())"

---

/governance status   → Governance().status()
/governance audit    → Governance().run()
/goals add <desc>ScienceLoop().add_hypothesis()
/learnings diagnose  → ReflectiveEvolution().diagnose_failure()
/fitness evaluate    → FitnessBuilder().evaluate()

---

# Before executing a dangerous command
if Governance().block_action(action_dict, agent_goal):
    return "Blocked: dangerous action"

# After a failure
diagnosis = ReflectiveEvolution().diagnose_failure(f"Failed: {error_context}")

# When evaluating a strategy
fitness_id = FitnessBuilder().create_function(
    name="new_strategy",
    target="improve response quality",
    dimensions=[{"name": "speed", "weight": 0.5}, {"name": "accuracy", "weight": 0.5}]
)

---

hermes-agent/
└── subsystems/
    ├── __init__.py       # Subsystem ABC + registry
    ├── base.py           # Subsystem base class
    ├── governance.py     # Audit + danger blocking
    ├── science_loop.py   # Hypothesis management
    ├── reflective_evolution.py  # Learning from failure
    ├── fitness_builder.py       # Fitness functions
    ├── knowledge.py      # Knowledge layer
    ├── reasoning.py      # Reasoning layer
    └── [other subsystems]
RAW_BUFFERClick to expand / collapse

Summary

This proposal introduces a Living Subsystem Framework for Hermes Agent — a collection of autonomous, independently-operating subsystems that run outside the core gateway/run_agent loop, persist data to JSON files in ~/.hermes/, and expose .run() and .status() methods for cron/CLI invocation.

Core philosophy: "The system is never done — it evolves."


Architecture

Subsystem Base Class (base.py)

Every subsystem inherits from Subsystem (ABC):

class Subsystem(ABC):
    def __init__(self, name: str = None):
        self.name = name or self.__class__.__name__
        self.home = Path.home() / ".hermes"
        self._lock = threading.Lock()

    def load(self, filename: str) -> Dict: ...
    def save(self, filename: str, data: Dict): ...

    @abstractmethod
    def run(self, **kwargs) -> Dict[str, Any]:
        """Returns {"ok": True, "message": "...", "details": {...}}"""

    def status(self) -> Dict[str, Any]: ...

Design rules:

  • Each subsystem reads/writes only JSON data files in ~/.hermes/
  • No import from gateway code — completely independent
  • Thread-safe via threading.Lock
  • Unified return format: {"ok", "message", "details"}

Core Subsystems

1. Governance — 治理层 (governance.py)

Data file: ~/.hermes/governance_audit.json

Purpose: Audit log for all agent actions + pre-flight blocking of dangerous operations.

Key methods:

def record_action(action: Union[Dict, str], result: str,
                  risk_level: str = "low", quality_score: float = 1.0, details: str = ""):
    """Record an action to the audit trail."""

def block_action(action: Dict, agent_goal: str) -> bool:
    """Pre-flight check. Returns True=block, False=allow.
    
    Action examples:
      {"type": "terminal", "command": "rm -rf /"}
      {"type": "execute_code", "code": "import os; os.system('rm -rf /')"}
      {"type": "delegate", "goal": "delete all files"}
    """

Dangerous pattern detection:

  • Recursive delete (rm -rf /)
  • Disk format (mkfs, format /dev)
  • Remote code injection (curl | bash, wget | bash)
  • Subprocess shell injection (subprocess shell=True)
  • Password file overwrite (> /etc/passwd)

L1 pre-check + L2 post-hoc audit dual-layer design.


2. ScienceLoop — 科学循环 (science_loop.py)

Data file: ~/.hermes/goals.json

Purpose: Hypothesis → Experiment → Evaluation → Retain/Discard cycle for tracking goals and strategies.

Key methods:

def add_hypothesis(description: str, category: str = "default") -> Dict:
    """Add a new hypothesis."""

def record_experiment(hypothesis_id: str, result: str,
                      outcome: str = "inconclusive") -> Dict:
    """Record an experiment result (success/failure/inconclusive)."""

def evaluate_hypothesis(hypothesis_id: str, verdict: str,
                        evaluation_data: Dict = None) -> Dict:
    """Evaluate a hypothesis. verdict: retain/discard/modify"""

Use case: When trying a new approach, register it as a hypothesis, run experiments, record results, then evaluate whether to keep pursuing that direction.


3. ReflectiveEvolution — 反思进化 (reflective_evolution.py)

Data file: ~/.hermes/learnings.json

Purpose: Learn from failures. Record lessons, diagnose root causes, retrieve relevant past lessons for new situations.

Key methods:

def add_learning(category: str, lesson: str,
                 tags: List[str] = None, confidence: float = 0.8) -> Dict:
    """Add a learning lesson."""

def get_relevant_learnings(query: str, limit: int = 5) -> List[Dict]:
    """Retrieve learnings relevant to a query."""

def diagnose_failure(context: str) -> Dict[str, Any]:
    """Diagnose a failure and suggest improvements based on past learnings."""

Use case: After a failed operation, call diagnose_failure() to get advice based on similar past failures.


4. FitnessBuilder — 适应度构建 (fitness_builder.py)

Data file: ~/.hermes/fitness_functions.json

Purpose: Multi-dimensional weighted fitness functions for evaluating how well the system is achieving goals (inspired by GOAL.md methodology).

Key methods:

def create_function(name: str, target: str,
                   dimensions: List[Dict]) -> Dict:
    """Create a fitness function.
    
    dimensions example:
      [
          {"name": "efficiency", "weight": 0.4},
          {"name": "maintainability", "weight": 0.3},
          {"name": "safety", "weight": 0.3},
      ]
    """

def evaluate(fitness_id: str, scores: Dict[str, float]) -> Dict:
    """Evaluate a fitness function. scores: {dimension_name: 0.0-1.0}"""

Use case: Define a fitness function for a goal, then periodically evaluate score across dimensions to track progress.


5. Knowledge — 知识层 (knowledge.py)

Purpose: Structured external knowledge acquisition, verification, storage, and retrieval.

Knowledge types:

  • FACTUAL — verifiable facts
  • EMPIRICAL — experiential knowledge
  • PROCEDURAL — processes and rules
  • META — knowledge about knowledge itself

Key classes:

class KnowledgeUnit:
    id: str
    content: str
    type: KnowledgeType
    source: str
    verified: bool
    confidence: float  # 0-1
    tags: list[str]

class KnowledgeGraph:
    from_id: str
    to_id: str
    relation: str  # "depends_on", "related_to", "contradicts"
    strength: float  # 0-1

Lifecycle: Acquisition → Verification → Storage → Linking → Retrieval


6. Reasoning — 推理层 (reasoning.py)

Purpose: Structured decision-making with multiple reasoning types.

Reasoning types:

  • DEDUCTIVE — general to specific
  • INDUCTIVE — specific to general
  • ABDUCTIVE — result to cause
  • ANALOGICAL — similarity to similarity
  • CAUSAL — cause and effect

Key classes:

class ReasoningChain:
    type: ReasoningType
    premise: str
    inference: str
    conclusion: str
    confidence: float
    evidence: list[str]
    counter_arguments: list[str]

class Decision:
    options: list[str]
    reasoning_chains: list[str]  # ReasoningChain IDs
    chosen_option: Optional[str]
    confidence: float

7–12. Supporting Subsystems

FileNamePurpose
perception.pyPerceptionEnvironmental sensing, input normalization
integration.pyIntegrationCross-subsystem data fusion
evolution.pyEvolutionGenetic algorithm-style strategy evolution
reflection.pyReflectionSelf-examination and pattern recognition
living_core.pyLiving CoreCore identity and continuity
memory_tiering.pyMemory TieringTiered memory (core/episodic/semantic/archival)
identity_evolution.pyIdentity EvolutionSelf-model adaptation over time
self_model.pySelf ModelAgent model of itself
metacognitive.pyMetacognitiveThinking about thinking
orchestrator.pyOrchestratorMulti-agent task coordination (6 patterns)
adaptation.pyAdaptationDynamic environment adaptation
show_quota.pyQuota DisplayToken quota monitoring

Integration with Hermes

Cron Integration

Each subsystem has a .run() method suitable for cron invocation:

# config.yaml (example)
cron:
  jobs:
    - name: governance-daily
      schedule: "0 9 * * *"
      command: python3 -c "from subsystems import Governance; print(Governance().run())"
    - name: science-loop-weekly
      schedule: "0 9 * * 1"
      command: python3 -c "from subsystems import ScienceLoop; print(ScienceLoop().run())"

Gateway Integration

Subsystems can be called from the gateway via slash commands:

/governance status   → Governance().status()
/governance audit    → Governance().run()
/goals add <desc>    → ScienceLoop().add_hypothesis()
/learnings diagnose  → ReflectiveEvolution().diagnose_failure()
/fitness evaluate    → FitnessBuilder().evaluate()

Agent Integration Points

The agent can call subsystems at decision points:

# Before executing a dangerous command
if Governance().block_action(action_dict, agent_goal):
    return "Blocked: dangerous action"

# After a failure
diagnosis = ReflectiveEvolution().diagnose_failure(f"Failed: {error_context}")

# When evaluating a strategy
fitness_id = FitnessBuilder().create_function(
    name="new_strategy",
    target="improve response quality",
    dimensions=[{"name": "speed", "weight": 0.5}, {"name": "accuracy", "weight": 0.5}]
)

Why This Belongs in Hermes Core

  1. Autonomy: Subsystems operate independently from the core agent loop — no coupling
  2. Persistence: JSON file storage means data survives restarts
  3. Observability: Every subsystem has .status() for health checks
  4. Evolvability: New subsystems can be added without modifying core code
  5. Real-world tested: This is not a theoretical design — running in production

Implementation Location

Proposed: hermes-agent/subsystems/ directory

hermes-agent/
└── subsystems/
    ├── __init__.py       # Subsystem ABC + registry
    ├── base.py           # Subsystem base class
    ├── governance.py     # Audit + danger blocking
    ├── science_loop.py   # Hypothesis management
    ├── reflective_evolution.py  # Learning from failure
    ├── fitness_builder.py       # Fitness functions
    ├── knowledge.py      # Knowledge layer
    ├── reasoning.py      # Reasoning layer
    └── [other subsystems]

Labels

enhancement, architecture, subsystem, agent

extent analysis

TL;DR

To integrate the proposed Living Subsystem Framework into Hermes Agent, implement the subsystems as described, ensuring each inherits from the Subsystem base class and adheres to the design rules, then integrate them into the agent using cron and gateway integration points.

Guidance

  1. Implement Subsystem Base Class: Ensure the Subsystem class in base.py is correctly defined with the required methods (load, save, run, status) and attributes (name, home, _lock).
  2. Develop Core Subsystems: Implement the core subsystems (Governance, ScienceLoop, ReflectiveEvolution, FitnessBuilder, Knowledge, Reasoning) with their respective methods and data files as specified.
  3. Integrate with Cron: Configure cron jobs for each subsystem's .run() method as shown in the config.yaml example to enable periodic execution.
  4. Gateway Integration: Implement slash commands for subsystems in the gateway to allow for manual invocation of subsystem methods.

Example

# Example implementation of a subsystem
from subsystems.base import Subsystem

class Governance(Subsystem):
    def __init__(self):
        super().__init__("Governance")

    def run(self, **kwargs) -> Dict[str, Any]:
        # Implementation of the run method for Governance subsystem
        pass

    def status(self) -> Dict[str, Any]:
        # Implementation of the status method for Governance subsystem
        pass

Notes

  • The implementation should follow the design rules and philosophy outlined in the proposal to ensure autonomy, persistence, observability, evolvability, and real-world applicability.
  • Each subsystem must be thread-safe and use the unified return format.

Recommendation

Apply the proposed Living Subsystem Framework to enhance the autonomy and evolvability of the Hermes Agent, allowing for more flexible and adaptive operation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING