# hkdidj38-pixel/paperclip architecture

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

- Interactive diagram: https://gitdiagram.com/hkdidj38-pixel/paperclip
- Repository: https://github.com/hkdidj38-pixel/paperclip

## Overview

Paperclip is an open-source application for orchestrating AI-agent organizations: people define goals, organize and configure agents, assign and approve work, then monitor execution and costs. The README describes these capabilities and identifies a Node.js server, React UI, multiple agent adapters, and persistent organization/work records. The graph preserves the major product branches; sampled evidence is limited, so edges use only README-documented relationships or visible schema references, and do not imply an unverified internal call sequence.

Main entry points: [`packages/db/src/schema/issues.ts`](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/issues.ts) (Tasks and issues), [`packages/paperclip-runner/src/control-plane/durable-prp-control-plane.ts`](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/paperclip-runner/src/control-plane/durable-prp-control-plane.ts) (Execution orchestration), [`packages/db/src/schema/agents.ts`](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/agents.ts) (Agent organization), [`packages/db/src/schema/projects.ts`](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/projects.ts) (Projects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_work["Goals and work"]
  node_goals["Goals<br/>[goals.ts]"]
  node_projects["Projects<br/>[projects.ts]"]
  node_issues["Tasks and issues<br/>[issues.ts]"]
  node_approvals["Approvals and review"]
  node_pipelines["Pipelines<br/>[pipelines.ts]"]
  node_routines["Routines<br/>[routines.ts]"]
end

subgraph group_governance["Organization and governance"]
  node_companies["Companies<br/>[companies.ts]"]
  node_agents["Agent organization<br/>[agents.ts]"]
  node_permissions["Permissions and connections<br/>[tool_access.ts]"]
  node_training["Skills and evaluations"]
end

subgraph group_runtime["Agent runtime"]
  node_runner["Execution orchestration"]
  node_adapters["Agent adapters"]
  node_sandbox["Sandbox and integrations"]
end

subgraph group_platform["Product platform"]
  node_server["Application server<br/>[app.ts]"]
  node_ui["Management dashboard<br/>[App.tsx]"]
  node_database[("Persistent records<br/>[client.ts]")]
  node_costs["Budgets and cost tracking<br/>[companies.ts]"]
  node_history["Run history and tracing<br/>[heartbeat_runs.ts]"]
end

node_people(("People"))

node_people -->|"define goals"| node_goals
node_people -->|"hire agents"| node_agents
node_people -->|"assign work"| node_issues
node_people -->|"review work"| node_approvals
node_goals -->|"align projects"| node_projects
node_projects -->|"organize tasks"| node_issues
node_agents -->|"work on tasks"| node_issues
node_issues -->|"orchestrate execution"| node_runner
node_runner -->|"dispatch runs"| node_adapters
node_runner -->|"use integrations"| node_sandbox
node_people -->|"manage organization"| node_ui
node_ui -->|"use application"| node_server
node_server -->|"persist records"| node_database
node_companies -->|"scope organization"| node_agents
node_projects -->|"reference goal"| node_goals
node_pipelines -->|"reference agents"| node_agents
node_people -->|"govern access"| node_permissions
node_people -->|"develop skills"| node_training
node_people -->|"manage workflows"| node_routines
node_people -->|"set budgets"| node_costs
node_people -->|"monitor runs"| node_history
node_runner -->|"record run history"| node_history
node_ui -->|"monitor costs"| node_costs
node_approvals -.->|"gate execution"| node_issues

click node_goals "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/goals.ts"
click node_projects "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/projects.ts"
click node_issues "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/issues.ts"
click node_approvals "https://github.com/hkdidj38-pixel/paperclip/tree/master/packages/db/src/schema"
click node_pipelines "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/pipelines.ts"
click node_routines "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/routines.ts"
click node_companies "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/companies.ts"
click node_agents "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/agents.ts"
click node_permissions "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/tool_access.ts"
click node_training "https://github.com/hkdidj38-pixel/paperclip/tree/master/packages"
click node_server "https://github.com/hkdidj38-pixel/paperclip/blob/master/server/src/app.ts"
click node_ui "https://github.com/hkdidj38-pixel/paperclip/blob/master/ui/src/App.tsx"
click node_database "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/client.ts"
click node_runner "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/paperclip-runner/src/control-plane/durable-prp-control-plane.ts"
click node_adapters "https://github.com/hkdidj38-pixel/paperclip/tree/master/packages/adapters"
click node_sandbox "https://github.com/hkdidj38-pixel/paperclip/tree/master/packages/plugins/sandbox-providers"
click node_costs "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/companies.ts"
click node_history "https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/heartbeat_runs.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_goals,node_projects,node_issues,node_approvals,node_pipelines,node_routines toneBlue
class node_companies,node_agents,node_permissions,node_training toneAmber
class node_runner,node_adapters,node_sandbox toneMint
class node_server,node_ui,node_database,node_costs,node_history toneRose
class node_people toneIndigo
```

## Components

### Goals and work

- [Goals](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/goals.ts): `packages/db/src/schema/goals.ts`
- [Projects](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/projects.ts): `packages/db/src/schema/projects.ts`
- [Tasks and issues](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/issues.ts): `packages/db/src/schema/issues.ts`
- [Approvals and review](https://github.com/hkdidj38-pixel/paperclip/tree/master/packages/db/src/schema): `packages/db/src/schema`
- [Pipelines](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/pipelines.ts): `packages/db/src/schema/pipelines.ts`
- [Routines](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/routines.ts): `packages/db/src/schema/routines.ts`

### Organization and governance

- [Companies](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/companies.ts): `packages/db/src/schema/companies.ts`
- [Agent organization](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/agents.ts): `packages/db/src/schema/agents.ts`
- [Permissions and connections](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/tool_access.ts): `packages/db/src/schema/tool_access.ts`
- [Skills and evaluations](https://github.com/hkdidj38-pixel/paperclip/tree/master/packages): `packages`

### Agent runtime

- [Execution orchestration](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/paperclip-runner/src/control-plane/durable-prp-control-plane.ts): `packages/paperclip-runner/src/control-plane/durable-prp-control-plane.ts`
- [Agent adapters](https://github.com/hkdidj38-pixel/paperclip/tree/master/packages/adapters): `packages/adapters`
- [Sandbox and integrations](https://github.com/hkdidj38-pixel/paperclip/tree/master/packages/plugins/sandbox-providers): `packages/plugins/sandbox-providers`

### Product platform

- [Application server](https://github.com/hkdidj38-pixel/paperclip/blob/master/server/src/app.ts): `server/src/app.ts`
- [Management dashboard](https://github.com/hkdidj38-pixel/paperclip/blob/master/ui/src/App.tsx): `ui/src/App.tsx`
- [Persistent records](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/client.ts): `packages/db/src/client.ts`
- [Budgets and cost tracking](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/companies.ts): `packages/db/src/schema/companies.ts`
- [Run history and tracing](https://github.com/hkdidj38-pixel/paperclip/blob/master/packages/db/src/schema/heartbeat_runs.ts): `packages/db/src/schema/heartbeat_runs.ts`

### Other components

- **People**

## Connections

- People → Goals: define goals
- People → Agent organization: hire agents
- People → Tasks and issues: assign work
- People → Approvals and review: review work
- Goals → Projects: align projects (evidence: `packages/db/src/schema/projects.ts`)
- Projects → Tasks and issues: organize tasks (evidence: `packages/db/src/schema/issues.ts`)
- Agent organization → Tasks and issues: work on tasks (evidence: `packages/db/src/schema/issues.ts`)
- Tasks and issues → Execution orchestration: orchestrate execution
- Execution orchestration → Agent adapters: dispatch runs
- Execution orchestration → Sandbox and integrations: use integrations
- People → Management dashboard: manage organization
- Management dashboard → Application server: use application
- Application server → Persistent records: persist records
- Companies → Agent organization: scope organization (evidence: `packages/db/src/schema/agents.ts`)
- Projects → Goals: reference goal (evidence: `packages/db/src/schema/projects.ts`)
- Pipelines → Agent organization: reference agents (evidence: `packages/db/src/schema/pipelines.ts`)
- People → Permissions and connections: govern access
- People → Skills and evaluations: develop skills
- People → Routines: manage workflows
- People → Budgets and cost tracking: set budgets
- People → Run history and tracing: monitor runs
- Execution orchestration → Run history and tracing: record run history
- Management dashboard → Budgets and cost tracking: monitor costs
- Approvals and review → Tasks and issues: gate execution (evidence: `packages/db/src/schema/pipeline_cases.ts`)
