# andrew112/throughline-bpr architecture

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

- Interactive diagram: https://gitdiagram.com/andrew112/throughline-bpr
- Repository: https://github.com/andrew112/throughline-bpr

## Overview

Throughline is an agentic process-discovery workflow: it builds an evidence-backed as-is map, diagnoses issues, then proposes redesigns. The runnable example loads an onboarding corpus and invokes the orchestrator; specialist agents use a shared tool loop and typed artifact schemas. The excerpts show these calls and the Anthropic API request. The README is empty, and the tree uses flattened filenames despite source imports referring to src paths, so graph paths follow the supplied tree; unsampled integrations are omitted.

Main entry points: [`throughline-examples-run-discovery.ts`](https://github.com/andrew112/throughline-bpr/blob/main/throughline-examples-run-discovery.ts) (Discovery example), [`throughline-agents-orchestrator.ts`](https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-orchestrator.ts) (Run coordinator), [`throughline-agents-cartographer.ts`](https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-cartographer.ts) (Process mapping), [`throughline-agents-detective.ts`](https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-detective.ts) (Issue diagnosis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Discovery workflow"]
  node_example["Discovery example"]
  node_orchestrator["Run coordinator"]
end

subgraph group_agents["Specialist agents"]
  node_cartographer["Process mapping"]
  node_detective["Issue diagnosis"]
  node_architect["Process redesign"]
end

subgraph group_runtime["Agent runtime"]
  node_loop["Tool agent loop"]
  node_schemas["Artifact schemas"]
end

subgraph group_evidence["Evidence inputs"]
  node_retrieval["Chunk retrieval"]
  node_corpus["Onboarding corpus"]
end

node_operator(("Operator"))
node_anthropic["Anthropic API"]

node_operator -->|"runs example"| node_example
node_example -->|"loads corpus"| node_corpus
node_example -->|"loads chunks"| node_retrieval
node_example -->|"starts discovery"| node_orchestrator
node_orchestrator -->|"runs first"| node_cartographer
node_orchestrator -->|"runs second"| node_detective
node_orchestrator -->|"runs third"| node_architect
node_cartographer -->|"searches chunks"| node_retrieval
node_detective -->|"searches evidence"| node_retrieval
node_cartographer -->|"runs agent"| node_loop
node_detective -->|"runs agent"| node_loop
node_architect -->|"runs agent"| node_loop
node_cartographer -->|"validates map"| node_schemas
node_detective -->|"validates diagnosis"| node_schemas
node_architect -->|"validates proposal"| node_schemas
node_loop -->|"requests completions"| node_anthropic

click node_example "https://github.com/andrew112/throughline-bpr/blob/main/throughline-examples-run-discovery.ts"
click node_orchestrator "https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-orchestrator.ts"
click node_cartographer "https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-cartographer.ts"
click node_detective "https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-detective.ts"
click node_architect "https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-architect.ts"
click node_loop "https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-loop.ts"
click node_schemas "https://github.com/andrew112/throughline-bpr/blob/main/throughline-schemas-process.ts"
click node_retrieval "https://github.com/andrew112/throughline-bpr/blob/main/throughline-tools-retrieval.ts"
click node_corpus "https://github.com/andrew112/throughline-bpr/blob/main/throughline-fixtures-onboarding-corpus.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_example,node_orchestrator toneBlue
class node_cartographer,node_detective,node_architect toneAmber
class node_loop,node_schemas,node_anthropic toneMint
class node_retrieval,node_corpus toneRose
class node_operator toneIndigo
```

## Components

### Discovery workflow

- [Discovery example](https://github.com/andrew112/throughline-bpr/blob/main/throughline-examples-run-discovery.ts): `throughline-examples-run-discovery.ts`
- [Run coordinator](https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-orchestrator.ts): `throughline-agents-orchestrator.ts`

### Specialist agents

- [Process mapping](https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-cartographer.ts): `throughline-agents-cartographer.ts`
- [Issue diagnosis](https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-detective.ts): `throughline-agents-detective.ts`
- [Process redesign](https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-architect.ts): `throughline-agents-architect.ts`

### Agent runtime

- [Tool agent loop](https://github.com/andrew112/throughline-bpr/blob/main/throughline-agents-loop.ts): `throughline-agents-loop.ts`
- [Artifact schemas](https://github.com/andrew112/throughline-bpr/blob/main/throughline-schemas-process.ts): `throughline-schemas-process.ts`

### Evidence inputs

- [Chunk retrieval](https://github.com/andrew112/throughline-bpr/blob/main/throughline-tools-retrieval.ts): `throughline-tools-retrieval.ts`
- [Onboarding corpus](https://github.com/andrew112/throughline-bpr/blob/main/throughline-fixtures-onboarding-corpus.ts): `throughline-fixtures-onboarding-corpus.ts`

### Other components

- **Operator**
- **Anthropic API**

## Connections

- Operator → Discovery example: runs example (evidence: `throughline-examples-run-discovery.ts`)
- Discovery example → Onboarding corpus: loads corpus (evidence: `throughline-examples-run-discovery.ts`)
- Discovery example → Chunk retrieval: loads chunks (evidence: `throughline-examples-run-discovery.ts`)
- Discovery example → Run coordinator: starts discovery (evidence: `throughline-examples-run-discovery.ts`)
- Run coordinator → Process mapping: runs first (evidence: `throughline-agents-orchestrator.ts`)
- Run coordinator → Issue diagnosis: runs second (evidence: `throughline-agents-orchestrator.ts`)
- Run coordinator → Process redesign: runs third (evidence: `throughline-agents-orchestrator.ts`)
- Process mapping → Chunk retrieval: searches chunks (evidence: `throughline-agents-cartographer.ts`)
- Issue diagnosis → Chunk retrieval: searches evidence (evidence: `throughline-agents-detective.ts`)
- Process mapping → Tool agent loop: runs agent (evidence: `throughline-agents-cartographer.ts`)
- Issue diagnosis → Tool agent loop: runs agent (evidence: `throughline-agents-detective.ts`)
- Process redesign → Tool agent loop: runs agent (evidence: `throughline-agents-architect.ts`)
- Process mapping → Artifact schemas: validates map (evidence: `throughline-agents-cartographer.ts`)
- Issue diagnosis → Artifact schemas: validates diagnosis (evidence: `throughline-agents-detective.ts`)
- Process redesign → Artifact schemas: validates proposal (evidence: `throughline-agents-architect.ts`)
- Tool agent loop → Anthropic API: requests completions (evidence: `throughline-agents-loop.ts`)
