# matraix-ai/matraix-persona-8b architecture

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

- Interactive diagram: https://gitdiagram.com/matraix-ai/matraix-persona-8b
- Repository: https://github.com/matraix-ai/matraix-persona-8b

## Overview

MatrAIx is a persona-driven evaluation platform. Users configure a task and cohort in the Playground, launch simulated users against Survey, Chatbot, Web, or App environments, then inspect traces and aggregate results. The repository also includes persona generation and curation, a reusable Harbor execution runtime, and a separate job viewer. The README documents the end-to-end capabilities; sampled backend wiring confirms the Playground API delegates to service modules, but does not expose every launch-time call, so some cross-subsystem links are documented rather than source-verified.

Main entry points: [`environment/runtime/harbor/cli/main.py`](https://github.com/matraix-ai/matraix-persona-8b/blob/main/environment/runtime/harbor/cli/main.py) (Harbor runtime), [`application/playground/backend/service/harbor_job_service.py`](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/harbor_job_service.py) (Job orchestration), [`application/playground/backend/api/app.py`](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/api/app.py) (Playground API), [`application/playground/backend/service/persona_pool_service.py`](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/persona_pool_service.py) (Persona pool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_playground["Playground"]
  node_cockpit["Run cockpit"]
  node_frontend["Playground UI<br/>[App.tsx]"]
  node_api["Playground API<br/>[app.py]"]
  node_task_catalog[("Task catalogs")]
  node_task_detail["Task detail"]
end

subgraph group_persona["Persona data"]
  node_persona_pool[("Persona pool")]
  node_persona_context["Agent context"]
  node_persona_generation["Persona generation"]
  node_persona_curation["Persona curation<br/>[sampler.py]"]
end

subgraph group_execution["Evaluation runtime"]
  node_job_service["Job orchestration"]
  node_execution_plane["Execution plane<br/>[execution_plane.py]"]
  node_harbor_runtime["Harbor runtime<br/>[main.py]"]
  node_survey_tasks["Survey tasks"]
  node_chatbot_tasks["Chatbot tasks<br/>[chatbot_tasks.py]"]
  node_web_tasks["Web tasks<br/>[web_tasks.py]"]
  node_app_tasks["App tasks<br/>[os_app_tasks.py]"]
  node_chatbot_sidecar["Chatbot sidecars"]
end

subgraph group_results["Results and inspection"]
  node_job_aggregation["Job aggregation<br/>[job_aggregation.py]"]
  node_trial_debrief["Trial debrief"]
  node_pdf_report["PDF reports<br/>[report_pdf.py]"]
  node_run_store[("Run store<br/>[run_store.py]")]
  node_job_viewer["Harbor viewer<br/>[server.py]"]
  node_viewer_frontend["Viewer routes<br/>[routes.ts]"]
end

node_operator(("Researcher"))
node_model_provider{{"Model provider"}}
node_task_environment{{"Task environment"}}

node_operator -->|"configures runs"| node_frontend
node_frontend -.->|"opens cockpit"| node_cockpit
node_cockpit -.->|"submits setup"| node_api
node_api -->|"serves task catalog"| node_task_catalog
node_api -->|"delegates details"| node_task_detail
node_api -->|"resolves cohorts"| node_persona_pool
node_api -->|"launches jobs"| node_job_service
node_operator -.->|"creates personas"| node_persona_generation
node_persona_generation -.->|"curates records"| node_persona_curation
node_persona_curation -.->|"supplies cohorts"| node_persona_pool
node_persona_pool -->|"selects personas"| node_job_service
node_job_service -.->|"configures agent context"| node_persona_context
node_job_service -.->|"dispatches jobs"| node_execution_plane
node_execution_plane -.->|"runs trials"| node_harbor_runtime
node_harbor_runtime -.->|"executes tasks"| node_survey_tasks
node_harbor_runtime -.->|"executes tasks"| node_chatbot_tasks
node_harbor_runtime -.->|"executes tasks"| node_web_tasks
node_harbor_runtime -.->|"executes tasks"| node_app_tasks
node_chatbot_tasks -.->|"uses sidecars"| node_chatbot_sidecar
node_harbor_runtime -.->|"invokes model"| node_model_provider
node_harbor_runtime -.->|"runs against"| node_task_environment
node_job_service -.->|"summarizes jobs"| node_job_aggregation
node_job_service -.->|"builds debriefs"| node_trial_debrief
node_job_service -.->|"persists runs"| node_run_store
node_job_aggregation -.->|"feeds reports"| node_pdf_report
node_operator -->|"inspects results"| node_job_viewer
node_job_viewer -.->|"serves viewer API"| node_viewer_frontend

click node_cockpit "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/frontend/src/components/cockpit/PlaygroundCockpit.tsx"
click node_frontend "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/frontend/src/App.tsx"
click node_api "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/api/app.py"
click node_task_catalog "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/playground_task_registry.py"
click node_task_detail "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/task_detail_service.py"
click node_persona_pool "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/persona_pool_service.py"
click node_persona_context "https://github.com/matraix-ai/matraix-persona-8b/blob/main/src/matraix/persona_agent_context.py"
click node_persona_generation "https://github.com/matraix-ai/matraix-persona-8b/blob/main/src/matraix/persona_generator.py"
click node_persona_curation "https://github.com/matraix-ai/matraix-persona-8b/blob/main/persona/synthesis/sampler/sampler.py"
click node_job_service "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/harbor_job_service.py"
click node_execution_plane "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/execution_plane.py"
click node_harbor_runtime "https://github.com/matraix-ai/matraix-persona-8b/blob/main/environment/runtime/harbor/cli/main.py"
click node_survey_tasks "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/survey_harbor_tasks.py"
click node_chatbot_tasks "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/chatbot_tasks.py"
click node_web_tasks "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/web_tasks.py"
click node_app_tasks "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/os_app_tasks.py"
click node_chatbot_sidecar "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/chatbot_sidecar_service.py"
click node_job_aggregation "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/job_aggregation.py"
click node_trial_debrief "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/harbor_trial_debrief.py"
click node_pdf_report "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/report_pdf.py"
click node_run_store "https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/run_store.py"
click node_job_viewer "https://github.com/matraix-ai/matraix-persona-8b/blob/main/environment/runtime/harbor/viewer/server.py"
click node_viewer_frontend "https://github.com/matraix-ai/matraix-persona-8b/blob/main/apps/viewer/app/routes.ts"

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_cockpit,node_frontend,node_api,node_task_catalog,node_task_detail toneBlue
class node_persona_pool,node_persona_context,node_persona_generation,node_persona_curation toneAmber
class node_job_service,node_execution_plane,node_harbor_runtime,node_survey_tasks,node_chatbot_tasks,node_web_tasks,node_app_tasks,node_chatbot_sidecar toneMint
class node_job_aggregation,node_trial_debrief,node_pdf_report,node_run_store,node_job_viewer,node_viewer_frontend,node_task_environment toneRose
class node_operator,node_model_provider toneIndigo
```

## Components

### Playground

- [Run cockpit](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/frontend/src/components/cockpit/PlaygroundCockpit.tsx): `application/playground/frontend/src/components/cockpit/PlaygroundCockpit.tsx`
- [Playground UI](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/frontend/src/App.tsx): `application/playground/frontend/src/App.tsx`
- [Playground API](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/api/app.py): `application/playground/backend/api/app.py`
- [Task catalogs](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/playground_task_registry.py): `application/playground/backend/service/playground_task_registry.py`
- [Task detail](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/task_detail_service.py): `application/playground/backend/service/task_detail_service.py`

### Persona data

- [Persona pool](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/persona_pool_service.py): `application/playground/backend/service/persona_pool_service.py`
- [Agent context](https://github.com/matraix-ai/matraix-persona-8b/blob/main/src/matraix/persona_agent_context.py): `src/matraix/persona_agent_context.py`
- [Persona generation](https://github.com/matraix-ai/matraix-persona-8b/blob/main/src/matraix/persona_generator.py): `src/matraix/persona_generator.py`
- [Persona curation](https://github.com/matraix-ai/matraix-persona-8b/blob/main/persona/synthesis/sampler/sampler.py): `persona/synthesis/sampler/sampler.py`

### Evaluation runtime

- [Job orchestration](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/harbor_job_service.py): `application/playground/backend/service/harbor_job_service.py`
- [Execution plane](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/execution_plane.py): `application/playground/backend/service/execution_plane.py`
- [Harbor runtime](https://github.com/matraix-ai/matraix-persona-8b/blob/main/environment/runtime/harbor/cli/main.py): `environment/runtime/harbor/cli/main.py`
- [Survey tasks](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/survey_harbor_tasks.py): `application/playground/backend/service/survey_harbor_tasks.py`
- [Chatbot tasks](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/chatbot_tasks.py): `application/playground/backend/service/chatbot_tasks.py`
- [Web tasks](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/web_tasks.py): `application/playground/backend/service/web_tasks.py`
- [App tasks](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/os_app_tasks.py): `application/playground/backend/service/os_app_tasks.py`
- [Chatbot sidecars](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/chatbot_sidecar_service.py): `application/playground/backend/service/chatbot_sidecar_service.py`

### Results and inspection

- [Job aggregation](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/job_aggregation.py): `application/playground/backend/service/job_aggregation.py`
- [Trial debrief](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/harbor_trial_debrief.py): `application/playground/backend/service/harbor_trial_debrief.py`
- [PDF reports](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/report_pdf.py): `application/playground/backend/service/report_pdf.py`
- [Run store](https://github.com/matraix-ai/matraix-persona-8b/blob/main/application/playground/backend/service/run_store.py): `application/playground/backend/service/run_store.py`
- [Harbor viewer](https://github.com/matraix-ai/matraix-persona-8b/blob/main/environment/runtime/harbor/viewer/server.py): `environment/runtime/harbor/viewer/server.py`
- [Viewer routes](https://github.com/matraix-ai/matraix-persona-8b/blob/main/apps/viewer/app/routes.ts): `apps/viewer/app/routes.ts`

### Other components

- **Researcher**
- **Model provider**
- **Task environment**

## Connections

- Researcher → Playground UI: configures runs (evidence: `README.md`)
- Playground UI → Run cockpit: opens cockpit
- Run cockpit → Playground API: submits setup
- Playground API → Task catalogs: serves task catalog (evidence: `application/playground/backend/api/app.py`)
- Playground API → Task detail: delegates details (evidence: `application/playground/backend/api/app.py`)
- Playground API → Persona pool: resolves cohorts (evidence: `application/playground/backend/api/app.py`)
- Playground API → Job orchestration: launches jobs (evidence: `application/playground/backend/api/app.py`)
- Researcher → Persona generation: creates personas
- Persona generation → Persona curation: curates records
- Persona curation → Persona pool: supplies cohorts
- Persona pool → Job orchestration: selects personas (evidence: `application/playground/backend/service/harbor_job_service.py`)
- Job orchestration → Agent context: configures agent context (evidence: `application/playground/backend/service/harbor_job_service.py`)
- Job orchestration → Execution plane: dispatches jobs (evidence: `application/playground/backend/service/harbor_job_service.py`)
- Execution plane → Harbor runtime: runs trials
- Harbor runtime → Survey tasks: executes tasks
- Harbor runtime → Chatbot tasks: executes tasks
- Harbor runtime → Web tasks: executes tasks
- Harbor runtime → App tasks: executes tasks
- Chatbot tasks → Chatbot sidecars: uses sidecars (evidence: `application/playground/backend/service/chatbot_tasks.py`)
- Harbor runtime → Model provider: invokes model
- Harbor runtime → Task environment: runs against (evidence: `README.md`)
- Job orchestration → Job aggregation: summarizes jobs (evidence: `application/playground/backend/service/harbor_job_service.py`)
- Job orchestration → Trial debrief: builds debriefs (evidence: `application/playground/backend/service/harbor_job_service.py`)
- Job orchestration → Run store: persists runs
- Job aggregation → PDF reports: feeds reports
- Researcher → Harbor viewer: inspects results (evidence: `README.md`)
- Harbor viewer → Viewer routes: serves viewer API
