# infermatrixlab/inferrsi architecture

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

- Interactive diagram: https://gitdiagram.com/infermatrixlab/inferrsi
- Repository: https://github.com/infermatrixlab/inferrsi

## Overview

InferRSI is an agent-facing inference experimentation app: users bring an engine checkout, workload, and quality checks, then profile a baseline, evaluate candidate changes under a controlled campaign, and review evidence before adoption. The README also documents packaged benchmarks, source-grounded optimization knowledge, client integrations, and dashboards. The graph preserves these branches; implementation links are limited to the supplied excerpts and SOURCE INDEX, so undocumented runtime wiring is omitted.

Main entry points: [`src/inferrsi/harness/manager`](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/harness/manager) (Campaign manager), [`src/inferrsi/apps/workflows`](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/workflows) (App workflows), [`src/inferrsi/apps/views/dashboard_data.py`](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/dashboard_data.py) (Dashboard model), [`src/inferrsi/harness/executor/_execution.py`](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/executor/_execution.py) (Execution and serving)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entrypoints"]
  node_cli["CLI intake"]
  node_client_plugins["Agent plugins"]
  node_app_workflows["App workflows"]
end

subgraph group_campaign["Experiment harness"]
  node_campaign_manager["Campaign manager"]
  node_search_engine["Search engine<br/>[engine.py]"]
  node_candidate_selection["Candidate selection<br/>[candidates.py]"]
  node_execution["Execution and serving<br/>[_execution.py]"]
  node_evaluation["Quality evaluation"]
  node_host_setup["Host preparation"]
  node_run_records[("Run and evidence records")]
  node_service_stages["Service stages<br/>[_service_stages.py]"]
end

subgraph group_knowledge["Knowledge and benchmarks"]
  node_knowledge_library["Tuning knowledge"]
  node_benchmark_tasks["Benchmarks"]
end

subgraph group_review["Evidence and results"]
  node_dashboard_data["Dashboard model<br/>[dashboard_data.py]"]
  node_dashboard_views["Dashboard views"]
  node_optimization_story["Optimization story"]
  node_retrieval_projection["Knowledge retrieval view"]
  node_delivery["Result delivery"]
end

node_engineer(("Engineer or agent"))
node_target_engine["Engine checkout"]
node_model_service["Model service"]

node_engineer -->|"starts experiment"| node_cli
node_engineer -->|"uses agent"| node_client_plugins
node_cli -.->|"routes tasks"| node_app_workflows
node_client_plugins -.->|"submits tasks"| node_app_workflows
node_app_workflows -.->|"runs campaigns"| node_campaign_manager
node_app_workflows -.->|"consults knowledge"| node_knowledge_library
node_app_workflows -.->|"uses tasks"| node_benchmark_tasks
node_campaign_manager -.->|"prepares host"| node_host_setup
node_campaign_manager -.->|"dispatches attempts"| node_execution
node_campaign_manager -.->|"requests evaluation"| node_evaluation
node_campaign_manager -.->|"records rounds"| node_run_records
node_search_engine -->|"selects candidates"| node_candidate_selection
node_search_engine -->|"stores campaign"| node_run_records
node_execution -.->|"runs workload"| node_target_engine
node_execution -.->|"sends requests"| node_model_service
node_service_stages -->|"executes stages"| node_execution
node_service_stages -->|"evaluates stages"| node_evaluation
node_service_stages -->|"records service IO"| node_run_records
node_run_records -->|"supplies evidence"| node_dashboard_data
node_dashboard_data -->|"projects experiments"| node_dashboard_views
node_dashboard_data -->|"builds narrative"| node_optimization_story
node_dashboard_data -->|"projects retrieval"| node_retrieval_projection
node_dashboard_views -.->|"renders results"| node_delivery
node_engineer -->|"reviews dashboard"| node_delivery

click node_cli "https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/cli"
click node_client_plugins "https://github.com/infermatrixlab/inferrsi/tree/main/plugins"
click node_app_workflows "https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/workflows"
click node_campaign_manager "https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/harness/manager"
click node_search_engine "https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/manager/search/engine.py"
click node_candidate_selection "https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/executor/candidates.py"
click node_execution "https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/executor/_execution.py"
click node_evaluation "https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/harness/evaluator"
click node_host_setup "https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/host"
click node_knowledge_library "https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/knowledge"
click node_run_records "https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/harness/records"
click node_service_stages "https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/manager/_service_stages.py"
click node_dashboard_data "https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/dashboard_data.py"
click node_dashboard_views "https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/dashboard_experiments.py"
click node_optimization_story "https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/optimization_story.py"
click node_retrieval_projection "https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/retrieval_projection.py"
click node_delivery "https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/delivery"

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_client_plugins,node_app_workflows toneBlue
class node_campaign_manager,node_search_engine,node_candidate_selection,node_execution,node_evaluation,node_host_setup,node_run_records,node_service_stages toneAmber
class node_knowledge_library,node_benchmark_tasks toneMint
class node_dashboard_data,node_dashboard_views,node_optimization_story,node_retrieval_projection,node_delivery toneRose
class node_engineer,node_target_engine,node_model_service toneIndigo
```

## Components

### User entrypoints

- [CLI intake](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/cli): `src/inferrsi/apps/cli`
- [Agent plugins](https://github.com/infermatrixlab/inferrsi/tree/main/plugins): `plugins`
- [App workflows](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/workflows): `src/inferrsi/apps/workflows`

### Experiment harness

- [Campaign manager](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/harness/manager): `src/inferrsi/harness/manager`
- [Search engine](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/manager/search/engine.py): `src/inferrsi/harness/manager/search/engine.py`
- [Candidate selection](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/executor/candidates.py): `src/inferrsi/harness/executor/candidates.py`
- [Execution and serving](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/executor/_execution.py): `src/inferrsi/harness/executor/_execution.py`
- [Quality evaluation](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/harness/evaluator): `src/inferrsi/harness/evaluator`
- [Host preparation](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/host): `src/inferrsi/apps/host`
- [Run and evidence records](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/harness/records): `src/inferrsi/harness/records`
- [Service stages](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/harness/manager/_service_stages.py): `src/inferrsi/harness/manager/_service_stages.py`

### Knowledge and benchmarks

- [Tuning knowledge](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/knowledge): `src/inferrsi/knowledge`
- **Benchmarks**

### Evidence and results

- [Dashboard model](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/dashboard_data.py): `src/inferrsi/apps/views/dashboard_data.py`
- [Dashboard views](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/dashboard_experiments.py): `src/inferrsi/apps/views/dashboard_experiments.py`
- [Optimization story](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/optimization_story.py): `src/inferrsi/apps/views/optimization_story.py`
- [Knowledge retrieval view](https://github.com/infermatrixlab/inferrsi/blob/main/src/inferrsi/apps/views/retrieval_projection.py): `src/inferrsi/apps/views/retrieval_projection.py`
- [Result delivery](https://github.com/infermatrixlab/inferrsi/tree/main/src/inferrsi/apps/delivery): `src/inferrsi/apps/delivery`

### Other components

- **Engineer or agent**
- **Engine checkout**
- **Model service**

## Connections

- Engineer or agent → CLI intake: starts experiment (evidence: `README.md`)
- Engineer or agent → Agent plugins: uses agent (evidence: `README.md`)
- CLI intake → App workflows: routes tasks
- Agent plugins → App workflows: submits tasks
- App workflows → Campaign manager: runs campaigns (evidence: `README.md`)
- App workflows → Tuning knowledge: consults knowledge (evidence: `README.md`)
- App workflows → Benchmarks: uses tasks (evidence: `README.md`)
- Campaign manager → Host preparation: prepares host
- Campaign manager → Execution and serving: dispatches attempts (evidence: `src/inferrsi/harness/manager/_service_stages.py`)
- Campaign manager → Quality evaluation: requests evaluation (evidence: `src/inferrsi/harness/manager/_service_stages.py`)
- Campaign manager → Run and evidence records: records rounds (evidence: `src/inferrsi/harness/manager/_service_stages.py`)
- Search engine → Candidate selection: selects candidates (evidence: `src/inferrsi/harness/manager/search/engine.py`)
- Search engine → Run and evidence records: stores campaign (evidence: `src/inferrsi/harness/manager/search/engine.py`)
- Execution and serving → Engine checkout: runs workload
- Execution and serving → Model service: sends requests
- Service stages → Execution and serving: executes stages (evidence: `src/inferrsi/harness/manager/_service_stages.py`)
- Service stages → Quality evaluation: evaluates stages (evidence: `src/inferrsi/harness/manager/_service_stages.py`)
- Service stages → Run and evidence records: records service IO (evidence: `src/inferrsi/harness/manager/_service_stages.py`)
- Run and evidence records → Dashboard model: supplies evidence (evidence: `src/inferrsi/apps/views/dashboard_data.py`)
- Dashboard model → Dashboard views: projects experiments (evidence: `src/inferrsi/apps/views/dashboard_data.py`)
- Dashboard model → Optimization story: builds narrative (evidence: `src/inferrsi/apps/views/dashboard_data.py`)
- Dashboard model → Knowledge retrieval view: projects retrieval (evidence: `src/inferrsi/apps/views/dashboard_data.py`)
- Dashboard views → Result delivery: renders results (evidence: `README.md`)
- Engineer or agent → Result delivery: reviews dashboard (evidence: `README.md`)
