# anihub-n/mas-one architecture

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

- Interactive diagram: https://gitdiagram.com/anihub-n/mas-one
- Repository: https://github.com/anihub-n/mas-one

## Overview

MAS-One is an early multi-agent security-state experiment: agents inspect a shared event timeline containing valid remediation evidence and forged or misleading events, then a verifier runs with and without peer conclusions. A separate trial runner repeats the scenario, classifies outputs, and records results. The graph shows the entry-point orchestration and the shared agent runtime; it does not imply a planner, which the README explicitly says is absent. Evidence is limited to the README and the supplied excerpts and source index.

Main entry points: [`main.py`](https://github.com/anihub-n/mas-one/blob/main/main.py) (Main Experiment), [`run_trials.py`](https://github.com/anihub-n/mas-one/blob/main/run_trials.py) (Trial Runner), [`agents/base_agent.py`](https://github.com/anihub-n/mas-one/blob/main/agents/base_agent.py) (Agent Prompt Runtime), [`memory/shared_memory.py`](https://github.com/anihub-n/mas-one/blob/main/memory/shared_memory.py) (Shared Event Memory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scenario["Security Scenario"]
  node_main["Main Experiment<br/>[main.py]"]
  node_guidance["Injected Guidance<br/>[main.py]"]
  node_security_events["Security Timeline<br/>[main.py]"]
  node_shared_memory[("Shared Event Memory<br/>[shared_memory.py]")]
end

subgraph group_agents["Agent Runtime"]
  node_researcher["Researcher Agent<br/>[researcher.py]"]
  node_summarizer["Summarizer Agent<br/>[summarizer.py]"]
  node_verifier["Verifier Agent<br/>[verifier.py]"]
  node_agent_runtime["Agent Prompt Runtime<br/>[base_agent.py]"]
end

subgraph group_experiment["Trial Evaluation"]
  node_trial_runner["Trial Runner<br/>[run_trials.py]"]
  node_verdict_extraction["Verdict Classification<br/>[run_trials.py]"]
  node_trial_records["Trial Records<br/>[trials.jsonl]"]
  node_corrections["Label Corrections<br/>[corrections.md]"]
end

subgraph group_support["Output Support"]
  node_output_logger["Agent Output Logger<br/>[logger.py]"]
end

node_user(("Experiment User"))
node_ollama{{"Ollama Model"}}

node_user -->|"runs experiment"| node_main
node_main -->|"seeds guidance"| node_guidance
node_main -->|"seeds timeline"| node_security_events
node_main -->|"adds events"| node_shared_memory
node_main -->|"runs independently"| node_researcher
node_main -->|"runs independently"| node_summarizer
node_main -->|"runs twice"| node_verifier
node_researcher -->|"inherits runtime"| node_agent_runtime
node_summarizer -->|"inherits runtime"| node_agent_runtime
node_verifier -->|"inherits runtime"| node_agent_runtime
node_agent_runtime -->|"filters events"| node_shared_memory
node_agent_runtime -->|"requests completion"| node_ollama
node_main -->|"stores peer conclusions"| node_shared_memory
node_main -->|"logs outputs"| node_output_logger
node_user -->|"starts trials"| node_trial_runner
node_trial_runner -->|"builds scenario memory"| node_shared_memory
node_trial_runner -->|"runs agent"| node_researcher
node_trial_runner -->|"runs agent"| node_summarizer
node_trial_runner -->|"runs both modes"| node_verifier
node_trial_runner -->|"classifies outputs"| node_verdict_extraction
node_verdict_extraction -->|"requests classification"| node_ollama
node_trial_runner -->|"writes trial outputs"| node_trial_records
node_corrections -->|"documents corrections"| node_trial_records

click node_main "https://github.com/anihub-n/mas-one/blob/main/main.py"
click node_guidance "https://github.com/anihub-n/mas-one/blob/main/main.py"
click node_security_events "https://github.com/anihub-n/mas-one/blob/main/main.py"
click node_shared_memory "https://github.com/anihub-n/mas-one/blob/main/memory/shared_memory.py"
click node_researcher "https://github.com/anihub-n/mas-one/blob/main/agents/researcher.py"
click node_summarizer "https://github.com/anihub-n/mas-one/blob/main/agents/summarizer.py"
click node_verifier "https://github.com/anihub-n/mas-one/blob/main/agents/verifier.py"
click node_agent_runtime "https://github.com/anihub-n/mas-one/blob/main/agents/base_agent.py"
click node_trial_runner "https://github.com/anihub-n/mas-one/blob/main/run_trials.py"
click node_verdict_extraction "https://github.com/anihub-n/mas-one/blob/main/run_trials.py"
click node_trial_records "https://github.com/anihub-n/mas-one/blob/main/results/trials.jsonl"
click node_corrections "https://github.com/anihub-n/mas-one/blob/main/results/corrections.md"
click node_output_logger "https://github.com/anihub-n/mas-one/blob/main/utils/logger.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_main,node_guidance,node_security_events,node_shared_memory,node_user toneBlue
class node_researcher,node_summarizer,node_verifier,node_agent_runtime toneAmber
class node_trial_runner,node_verdict_extraction,node_trial_records,node_corrections toneMint
class node_output_logger toneRose
class node_ollama toneIndigo
```

## Components

### Security Scenario

- [Main Experiment](https://github.com/anihub-n/mas-one/blob/main/main.py): `main.py`
- [Injected Guidance](https://github.com/anihub-n/mas-one/blob/main/main.py): `main.py`
- [Security Timeline](https://github.com/anihub-n/mas-one/blob/main/main.py): `main.py`
- [Shared Event Memory](https://github.com/anihub-n/mas-one/blob/main/memory/shared_memory.py): `memory/shared_memory.py`

### Agent Runtime

- [Researcher Agent](https://github.com/anihub-n/mas-one/blob/main/agents/researcher.py): `agents/researcher.py`
- [Summarizer Agent](https://github.com/anihub-n/mas-one/blob/main/agents/summarizer.py): `agents/summarizer.py`
- [Verifier Agent](https://github.com/anihub-n/mas-one/blob/main/agents/verifier.py): `agents/verifier.py`
- [Agent Prompt Runtime](https://github.com/anihub-n/mas-one/blob/main/agents/base_agent.py): `agents/base_agent.py`

### Trial Evaluation

- [Trial Runner](https://github.com/anihub-n/mas-one/blob/main/run_trials.py): `run_trials.py`
- [Verdict Classification](https://github.com/anihub-n/mas-one/blob/main/run_trials.py): `run_trials.py`
- [Trial Records](https://github.com/anihub-n/mas-one/blob/main/results/trials.jsonl): `results/trials.jsonl`
- [Label Corrections](https://github.com/anihub-n/mas-one/blob/main/results/corrections.md): `results/corrections.md`

### Output Support

- [Agent Output Logger](https://github.com/anihub-n/mas-one/blob/main/utils/logger.py): `utils/logger.py`

### Other components

- **Experiment User**
- **Ollama Model**

## Connections

- Experiment User → Main Experiment: runs experiment (evidence: `README.md`)
- Main Experiment → Injected Guidance: seeds guidance (evidence: `main.py`)
- Main Experiment → Security Timeline: seeds timeline (evidence: `main.py`)
- Main Experiment → Shared Event Memory: adds events (evidence: `main.py`)
- Main Experiment → Researcher Agent: runs independently (evidence: `main.py`)
- Main Experiment → Summarizer Agent: runs independently (evidence: `main.py`)
- Main Experiment → Verifier Agent: runs twice (evidence: `main.py`)
- Researcher Agent → Agent Prompt Runtime: inherits runtime (evidence: `agents/researcher.py`)
- Summarizer Agent → Agent Prompt Runtime: inherits runtime (evidence: `agents/summarizer.py`)
- Verifier Agent → Agent Prompt Runtime: inherits runtime (evidence: `agents/verifier.py`)
- Agent Prompt Runtime → Shared Event Memory: filters events (evidence: `agents/base_agent.py`)
- Agent Prompt Runtime → Ollama Model: requests completion (evidence: `agents/base_agent.py`)
- Main Experiment → Shared Event Memory: stores peer conclusions (evidence: `main.py`)
- Main Experiment → Agent Output Logger: logs outputs (evidence: `main.py`)
- Experiment User → Trial Runner: starts trials (evidence: `README.md`)
- Trial Runner → Shared Event Memory: builds scenario memory (evidence: `run_trials.py`)
- Trial Runner → Researcher Agent: runs agent (evidence: `run_trials.py`)
- Trial Runner → Summarizer Agent: runs agent (evidence: `run_trials.py`)
- Trial Runner → Verifier Agent: runs both modes (evidence: `run_trials.py`)
- Trial Runner → Verdict Classification: classifies outputs (evidence: `run_trials.py`)
- Verdict Classification → Ollama Model: requests classification (evidence: `run_trials.py`)
- Trial Runner → Trial Records: writes trial outputs (evidence: `run_trials.py`)
- Label Corrections → Trial Records: documents corrections (evidence: `README.md`)
