# korroai/mue-x architecture

> Architecture diagram of the GitHub repository korroai/mue-x, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/korroai/mue-x
- Repository: https://github.com/korroai/mue-x

## Overview

MUE-X is a self-evolving agent: users start it through a CLI or MCP interface, then interact with the agent while its evolution loop generates signals, selects and applies code mutations, and checks outcomes. Its major capabilities also include GitHub code absorption, persistent memory and skill crystallization, domain specialization, self-reflection, and protection of self-modified code. Edges use the README and sampled source/index evidence; unsampled internals are represented without asserting unverified calls.

Main entry points: [`mue/evo/core.py`](https://github.com/korroai/mue-x/blob/main/mue/evo/core.py) (Agent Core), [`mue/evo/evolution/loop.py`](https://github.com/korroai/mue-x/blob/main/mue/evo/evolution/loop.py) (Evolution Loop), [`mue/evo/memory/lattice.py`](https://github.com/korroai/mue-x/blob/main/mue/evo/memory/lattice.py) (Memory Lattice), [`mue/evo/autonomy/autonomous_signals.py`](https://github.com/korroai/mue-x/blob/main/mue/evo/autonomy/autonomous_signals.py) (Autonomous Signals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_cli["Standalone CLI<br/>[cli.py]"]
  node_mcp["MCP Server<br/>[server.py]"]
  node_api["REST API<br/>[api.py]"]
end

subgraph group_agent["Agent Runtime"]
  node_agent_core["Agent Core<br/>[core.py]"]
  node_specializer["Domain Specializer<br/>[specialization.py]"]
  node_swarm["Swarm Orchestrator<br/>[orchestrator.py]"]
  node_task_runner["Task Execution<br/>[runner.py]"]
  node_emotions["PAD Emotions<br/>[emotions.py]"]
  node_reflector["Self Reflection<br/>[reflector.py]"]
end

subgraph group_evolution["Evolution System"]
  node_signals["Autonomous Signals"]
  node_signal_detector["Signal Detection<br/>[signals.py]"]
  node_evolution_loop["Evolution Loop<br/>[loop.py]"]
  node_genome["Gene Genome<br/>[genome.py]"]
  node_mutator["AST Mutator<br/>[mutator.py]"]
  node_rl["Strategy Optimizer<br/>[rl_optimizer.py]"]
end

subgraph group_learning["Learning and Memory"]
  node_github_miner["GitHub Absorption<br/>[github_miner.py]"]
  node_assessor["Code Assessor<br/>[code_assessor.py]"]
  node_memory[("Memory Lattice<br/>[lattice.py]")]
  node_crystallizer["Skill Crystallizer<br/>[crystallizer.py]"]
  node_scorer[("Feedback Scorer<br/>[scorer.py]")]
end

subgraph group_safety["Safety and Verification"]
  node_sandbox["Mutation Sandbox<br/>[sandbox.py]"]
  node_auto_correction["Regression Correction<br/>[auto_correction.py]"]
  node_security["Security Guard<br/>[guard.py]"]
end

node_user(("User"))

node_user -->|"issues commands"| node_cli
node_user -->|"connects through"| node_mcp
node_user -->|"calls endpoints"| node_api
node_cli -->|"creates and commands"| node_agent_core
node_mcp -->|"serves agent"| node_agent_core
node_api -->|"creates and invokes"| node_agent_core
node_agent_core -->|"configures loop"| node_evolution_loop
node_agent_core -->|"configures domain"| node_specializer
node_agent_core -->|"configures signals"| node_signals
node_agent_core -->|"initializes memory"| node_memory
node_agent_core -->|"provides agent state"| node_emotions
node_agent_core -->|"runs reflection"| node_reflector
node_agent_core -->|"configures swarm"| node_swarm
node_agent_core -->|"configures tasks"| node_task_runner
node_signals -->|"feeds signals"| node_signal_detector
node_evolution_loop -->|"collects signals"| node_signal_detector
node_evolution_loop -->|"selects gene mutations"| node_genome
node_evolution_loop -->|"selects strategies"| node_rl
node_evolution_loop -->|"applies mutations"| node_mutator
node_evolution_loop -->|"checks regressions"| node_auto_correction
node_mutator -->|"validates mutations"| node_sandbox
node_evolution_loop -->|"triggers absorption"| node_github_miner
node_github_miner -->|"assesses patterns"| node_assessor
node_github_miner -->|"stores absorbed knowledge"| node_memory
node_signals -->|"searches prior memories"| node_memory
node_crystallizer -->|"crystallizes skills"| node_memory
node_agent_core -->|"records task feedback"| node_scorer
node_evolution_loop -->|"uses mutation priority"| node_scorer
node_emotions -->|"modulates strategy"| node_mutator
node_agent_core -.->|"guards operations"| node_security
node_evolution_loop -->|"ticks orchestrator"| node_swarm

click node_cli "https://github.com/korroai/mue-x/blob/main/mue/cli.py"
click node_mcp "https://github.com/korroai/mue-x/blob/main/mue/evo/mcp/server.py"
click node_api "https://github.com/korroai/mue-x/blob/main/mue/api.py"
click node_agent_core "https://github.com/korroai/mue-x/blob/main/mue/evo/core.py"
click node_specializer "https://github.com/korroai/mue-x/blob/main/mue/evo/specialization.py"
click node_swarm "https://github.com/korroai/mue-x/blob/main/mue/evo/swarm/orchestrator.py"
click node_task_runner "https://github.com/korroai/mue-x/blob/main/mue/evo/tasks/runner.py"
click node_signals "https://github.com/korroai/mue-x/blob/main/mue/evo/autonomy/autonomous_signals.py"
click node_signal_detector "https://github.com/korroai/mue-x/blob/main/mue/evo/evolution/signals.py"
click node_evolution_loop "https://github.com/korroai/mue-x/blob/main/mue/evo/evolution/loop.py"
click node_genome "https://github.com/korroai/mue-x/blob/main/mue/evo/dna/genome.py"
click node_mutator "https://github.com/korroai/mue-x/blob/main/mue/evo/dna/mutator.py"
click node_rl "https://github.com/korroai/mue-x/blob/main/mue/evo/evolution/rl_optimizer.py"
click node_github_miner "https://github.com/korroai/mue-x/blob/main/mue/evo/absorption/github_miner.py"
click node_assessor "https://github.com/korroai/mue-x/blob/main/mue/evo/absorption/code_assessor.py"
click node_memory "https://github.com/korroai/mue-x/blob/main/mue/evo/memory/lattice.py"
click node_crystallizer "https://github.com/korroai/mue-x/blob/main/mue/evo/skills/crystallizer.py"
click node_scorer "https://github.com/korroai/mue-x/blob/main/mue/evo/feedback/scorer.py"
click node_emotions "https://github.com/korroai/mue-x/blob/main/mue/evo/personality/emotions.py"
click node_sandbox "https://github.com/korroai/mue-x/blob/main/mue/evo/dna/sandbox.py"
click node_auto_correction "https://github.com/korroai/mue-x/blob/main/mue/evo/autonomy/auto_correction.py"
click node_security "https://github.com/korroai/mue-x/blob/main/mue/evo/security/guard.py"
click node_reflector "https://github.com/korroai/mue-x/blob/main/mue/evo/self_reflection/reflector.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_mcp,node_api,node_user toneBlue
class node_agent_core,node_specializer,node_swarm,node_task_runner,node_emotions,node_reflector toneAmber
class node_signals,node_signal_detector,node_evolution_loop,node_genome,node_mutator,node_rl toneMint
class node_github_miner,node_assessor,node_memory,node_crystallizer,node_scorer toneRose
class node_sandbox,node_auto_correction,node_security toneIndigo
```

## Components

### User Interfaces

- [Standalone CLI](https://github.com/korroai/mue-x/blob/main/mue/cli.py): `mue/cli.py`
- [MCP Server](https://github.com/korroai/mue-x/blob/main/mue/evo/mcp/server.py): `mue/evo/mcp/server.py`
- [REST API](https://github.com/korroai/mue-x/blob/main/mue/api.py): `mue/api.py`

### Agent Runtime

- [Agent Core](https://github.com/korroai/mue-x/blob/main/mue/evo/core.py): `mue/evo/core.py`
- [Domain Specializer](https://github.com/korroai/mue-x/blob/main/mue/evo/specialization.py): `mue/evo/specialization.py`
- [Swarm Orchestrator](https://github.com/korroai/mue-x/blob/main/mue/evo/swarm/orchestrator.py): `mue/evo/swarm/orchestrator.py`
- [Task Execution](https://github.com/korroai/mue-x/blob/main/mue/evo/tasks/runner.py): `mue/evo/tasks/runner.py`
- [PAD Emotions](https://github.com/korroai/mue-x/blob/main/mue/evo/personality/emotions.py): `mue/evo/personality/emotions.py`
- [Self Reflection](https://github.com/korroai/mue-x/blob/main/mue/evo/self_reflection/reflector.py): `mue/evo/self_reflection/reflector.py`

### Evolution System

- [Autonomous Signals](https://github.com/korroai/mue-x/blob/main/mue/evo/autonomy/autonomous_signals.py): `mue/evo/autonomy/autonomous_signals.py`
- [Signal Detection](https://github.com/korroai/mue-x/blob/main/mue/evo/evolution/signals.py): `mue/evo/evolution/signals.py`
- [Evolution Loop](https://github.com/korroai/mue-x/blob/main/mue/evo/evolution/loop.py): `mue/evo/evolution/loop.py`
- [Gene Genome](https://github.com/korroai/mue-x/blob/main/mue/evo/dna/genome.py): `mue/evo/dna/genome.py`
- [AST Mutator](https://github.com/korroai/mue-x/blob/main/mue/evo/dna/mutator.py): `mue/evo/dna/mutator.py`
- [Strategy Optimizer](https://github.com/korroai/mue-x/blob/main/mue/evo/evolution/rl_optimizer.py): `mue/evo/evolution/rl_optimizer.py`

### Learning and Memory

- [GitHub Absorption](https://github.com/korroai/mue-x/blob/main/mue/evo/absorption/github_miner.py): `mue/evo/absorption/github_miner.py`
- [Code Assessor](https://github.com/korroai/mue-x/blob/main/mue/evo/absorption/code_assessor.py): `mue/evo/absorption/code_assessor.py`
- [Memory Lattice](https://github.com/korroai/mue-x/blob/main/mue/evo/memory/lattice.py): `mue/evo/memory/lattice.py`
- [Skill Crystallizer](https://github.com/korroai/mue-x/blob/main/mue/evo/skills/crystallizer.py): `mue/evo/skills/crystallizer.py`
- [Feedback Scorer](https://github.com/korroai/mue-x/blob/main/mue/evo/feedback/scorer.py): `mue/evo/feedback/scorer.py`

### Safety and Verification

- [Mutation Sandbox](https://github.com/korroai/mue-x/blob/main/mue/evo/dna/sandbox.py): `mue/evo/dna/sandbox.py`
- [Regression Correction](https://github.com/korroai/mue-x/blob/main/mue/evo/autonomy/auto_correction.py): `mue/evo/autonomy/auto_correction.py`
- [Security Guard](https://github.com/korroai/mue-x/blob/main/mue/evo/security/guard.py): `mue/evo/security/guard.py`

### Other components

- **User**

## Connections

- User → Standalone CLI: issues commands (evidence: `README.md`)
- User → MCP Server: connects through
- User → REST API: calls endpoints (evidence: `mue/api.py`)
- Standalone CLI → Agent Core: creates and commands (evidence: `mue/cli.py`)
- MCP Server → Agent Core: serves agent
- REST API → Agent Core: creates and invokes (evidence: `mue/api.py`)
- Agent Core → Evolution Loop: configures loop (evidence: `mue/evo/core.py`)
- Agent Core → Domain Specializer: configures domain (evidence: `mue/evo/core.py`)
- Agent Core → Autonomous Signals: configures signals (evidence: `mue/evo/core.py`)
- Agent Core → Memory Lattice: initializes memory (evidence: `mue/evo/core.py`)
- Agent Core → PAD Emotions: provides agent state (evidence: `mue/evo/core.py`)
- Agent Core → Self Reflection: runs reflection (evidence: `mue/evo/core.py`)
- Agent Core → Swarm Orchestrator: configures swarm (evidence: `mue/evo/core.py`)
- Agent Core → Task Execution: configures tasks (evidence: `mue/evo/core.py`)
- Autonomous Signals → Signal Detection: feeds signals (evidence: `mue/evo/autonomy/autonomous_signals.py`)
- Evolution Loop → Signal Detection: collects signals (evidence: `mue/evo/evolution/loop.py`)
- Evolution Loop → Gene Genome: selects gene mutations (evidence: `mue/evo/evolution/loop.py`)
- Evolution Loop → Strategy Optimizer: selects strategies (evidence: `mue/evo/evolution/loop.py`)
- Evolution Loop → AST Mutator: applies mutations (evidence: `mue/evo/evolution/loop.py`)
- Evolution Loop → Regression Correction: checks regressions (evidence: `mue/evo/evolution/loop.py`)
- AST Mutator → Mutation Sandbox: validates mutations (evidence: `README.md`)
- Evolution Loop → GitHub Absorption: triggers absorption (evidence: `mue/evo/evolution/loop.py`)
- GitHub Absorption → Code Assessor: assesses patterns (evidence: `mue/evo/absorption/github_miner.py`)
- GitHub Absorption → Memory Lattice: stores absorbed knowledge (evidence: `mue/evo/absorption/github_miner.py`)
- Autonomous Signals → Memory Lattice: searches prior memories (evidence: `mue/evo/autonomy/autonomous_signals.py`)
- Skill Crystallizer → Memory Lattice: crystallizes skills (evidence: `mue/evo/skills/crystallizer.py`)
- Agent Core → Feedback Scorer: records task feedback (evidence: `mue/evo/core.py`)
- Evolution Loop → Feedback Scorer: uses mutation priority (evidence: `mue/evo/evolution/loop.py`)
- PAD Emotions → AST Mutator: modulates strategy (evidence: `README.md`)
- Agent Core → Security Guard: guards operations (evidence: `README.md`)
- Evolution Loop → Swarm Orchestrator: ticks orchestrator (evidence: `mue/evo/evolution/loop.py`)
