# d-ribeiro-dev/mindforge-ai architecture

> Architecture diagram of the GitHub repository d-ribeiro-dev/mindforge-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/d-ribeiro-dev/mindforge-ai
- Repository: https://github.com/d-ribeiro-dev/mindforge-ai

## Overview

MindForge AI is an experimental, human-supervised software reliability system. Its main workflow reproduces a failure, retrieves approved engineering knowledge, investigates the evidence, validates a correction proposal, executes approved operations, assesses before/after and regression evidence, and records approved knowledge for reuse. Lexical and semantic retrieval are distinct modes; semantic search uses SIE and cached embeddings. The README documents this workflow and broader evaluation capabilities; unsampled implementation details are represented only where the tree or documentation supports them.

Main entry points: [`experiments/execute_mf001.py`](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/experiments/execute_mf001.py) (MF-001 runner), [`mindforge/core.py`](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/core.py) (Cycle orchestration), [`mindforge/semantic.py`](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/semantic.py) (Semantic search), [`mindforge/investigator.py`](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/investigator.py) (AI investigator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_investigation["Investigation"]
  node_core["Cycle orchestration<br/>[core.py]"]
  node_investigator["AI investigator<br/>[investigator.py]"]
end

subgraph group_knowledge["Knowledge"]
  node_retrieval["Knowledge retrieval<br/>[retrieval.py]"]
  node_semantic["Semantic search<br/>[semantic.py]"]
  node_memory[("Engineering memory<br/>[memory.py]")]
  node_cache[("Embedding cache<br/>[cache.py]")]
  node_registry["Knowledge registry<br/>[registry.py]"]
end

subgraph group_verification["Verification"]
  node_validator["Evidence validator<br/>[validator.py]"]
  node_executor["Controlled executor<br/>[executor.py]"]
end

subgraph group_integration["Integrated workflow"]
  node_runner["MF-001 runner<br/>[execute_mf001.py]"]
end

node_engineer(("Engineer"))
node_sie["Superlinked SIE"]
node_candidate["Candidate repository"]
node_humanapproval(("Human approval"))

node_engineer -->|"starts cycle"| node_runner
node_runner -->|"runs cycle"| node_core
node_core -->|"loads knowledge"| node_memory
node_core -->|"retrieves knowledge"| node_retrieval
node_core -->|"requests investigation"| node_investigator
node_core -->|"validates evidence"| node_validator
node_retrieval -->|"runs semantic search"| node_semantic
node_investigator -.->|"uses model access"| node_sie
node_semantic -->|"requests embeddings"| node_sie
node_semantic -->|"reads and writes"| node_cache
node_runner -->|"executes operations"| node_executor
node_runner -->|"tests and patches"| node_candidate
node_runner -->|"requests approval"| node_humanapproval
node_runner -.->|"records approved knowledge"| node_registry
node_registry -->|"updates records"| node_memory

click node_runner "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/experiments/execute_mf001.py"
click node_core "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/core.py"
click node_investigator "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/investigator.py"
click node_retrieval "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/retrieval.py"
click node_semantic "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/semantic.py"
click node_memory "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/memory.py"
click node_cache "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/cache.py"
click node_registry "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/registry.py"
click node_validator "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/validator.py"
click node_executor "https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/executor.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_core,node_investigator toneBlue
class node_retrieval,node_semantic,node_memory,node_cache,node_registry toneAmber
class node_validator,node_executor toneMint
class node_runner toneRose
class node_engineer,node_sie,node_candidate,node_humanapproval toneIndigo
```

## Components

### Investigation

- [Cycle orchestration](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/core.py): `mindforge/core.py`
- [AI investigator](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/investigator.py): `mindforge/investigator.py`

### Knowledge

- [Knowledge retrieval](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/retrieval.py): `mindforge/retrieval.py`
- [Semantic search](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/semantic.py): `mindforge/semantic.py`
- [Engineering memory](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/memory.py): `mindforge/memory.py`
- [Embedding cache](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/cache.py): `mindforge/cache.py`
- [Knowledge registry](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/registry.py): `mindforge/registry.py`

### Verification

- [Evidence validator](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/validator.py): `mindforge/validator.py`
- [Controlled executor](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/mindforge/executor.py): `mindforge/executor.py`

### Integrated workflow

- [MF-001 runner](https://github.com/d-ribeiro-dev/mindforge-ai/blob/main/experiments/execute_mf001.py): `experiments/execute_mf001.py`

### Other components

- **Engineer**
- **Superlinked SIE**
- **Candidate repository**
- **Human approval**

## Connections

- Engineer → MF-001 runner: starts cycle (evidence: `README.md`)
- MF-001 runner → Cycle orchestration: runs cycle (evidence: `experiments/execute_mf001.py`)
- Cycle orchestration → Engineering memory: loads knowledge (evidence: `mindforge/core.py`)
- Cycle orchestration → Knowledge retrieval: retrieves knowledge (evidence: `mindforge/core.py`)
- Cycle orchestration → AI investigator: requests investigation (evidence: `mindforge/core.py`)
- Cycle orchestration → Evidence validator: validates evidence (evidence: `mindforge/core.py`)
- Knowledge retrieval → Semantic search: runs semantic search (evidence: `mindforge/retrieval.py`)
- AI investigator → Superlinked SIE: uses model access (evidence: `README.md`)
- Semantic search → Superlinked SIE: requests embeddings (evidence: `mindforge/semantic.py`)
- Semantic search → Embedding cache: reads and writes (evidence: `mindforge/semantic.py`)
- MF-001 runner → Controlled executor: executes operations (evidence: `experiments/execute_mf001.py`)
- MF-001 runner → Candidate repository: tests and patches (evidence: `README.md`)
- MF-001 runner → Human approval: requests approval (evidence: `README.md`)
- MF-001 runner → Knowledge registry: records approved knowledge (evidence: `README.md`)
- Knowledge registry → Engineering memory: updates records (evidence: `mindforge/registry.py`)
