# pizza-bot-app/pizza-bot architecture

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

- Interactive diagram: https://gitdiagram.com/pizza-bot-app/pizza-bot
- Repository: https://github.com/pizza-bot-app/pizza-bot

## Overview

Pizza Bot is an inbox for asynchronous AI work: users start or schedule durable agent runs, then return to review completed work and approval requests. Desktop, browser, and CLI clients communicate with the API server over HTTP/SSE. The server coordinates the LangGraph runtime, model providers, plugins and MCP tools, and local persistence. The graph includes documented product areas whose implementations were not sampled; those links are cited to the README rather than presented as inspected source behavior.

Main entry points: [`apps/api-server/src/index.ts`](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/index.ts) (API server), [`apps/api-server/src/agent-host.ts`](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/agent-host.ts) (Agent host), [`apps/web/src/App.tsx`](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/web/src/App.tsx) (Web inbox), [`apps/desktop-shell/src/main.ts`](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/desktop-shell/src/main.ts) (Desktop shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User experiences"]
  node_web["Web inbox<br/>[App.tsx]"]
  node_desktop["Desktop shell<br/>[main.ts]"]
  node_cli["Terminal CLI<br/>[index.ts]"]
end

subgraph group_server["API orchestration"]
  node_api["API server<br/>[index.ts]"]
  node_threads["Thread routes<br/>[routes-threads.ts]"]
  node_runmgr["Run manager"]
  node_host["Agent host<br/>[agent-host.ts]"]
  node_graph["Graph manager<br/>[graph-manager.ts]"]
  node_triggers["Scheduled triggers<br/>[trigger-service.ts]"]
  node_attachments["File attachments"]
  node_folders["Folders<br/>[routes-folders.ts]"]
  node_settings["Settings and providers"]
end

subgraph group_runtime["Agent capabilities"]
  node_runtime["LangGraph agent<br/>[backend.ts]"]
  node_memories["Long-term memory<br/>[routes-memories.ts]"]
  node_approvals["Human approvals<br/>[backend.ts]"]
end

subgraph group_state["Local state"]
  node_storage[("Local persistence<br/>[app-db.ts]")]
end

subgraph group_extensions["Extensions and models"]
  node_providers["Model providers<br/>[openai.ts]"]
  node_skills["Skills<br/>[routes-skills.ts]"]
  node_plugins["Plugin and MCP host<br/>[plugin-host.ts]"]
end

node_user(("User"))

node_user -->|"uses"| node_web
node_user -->|"uses"| node_desktop
node_user -->|"uses"| node_cli
node_web -->|"HTTP/SSE"| node_api
node_desktop -->|"HTTP/SSE"| node_api
node_cli -->|"HTTP/SSE"| node_api
node_api -.->|"routes requests"| node_threads
node_threads -->|"starts or manages"| node_host
node_host -->|"manages runs"| node_runmgr
node_runmgr -.->|"streams agent"| node_graph
node_graph -->|"builds agent"| node_runtime
node_host -->|"resolves models"| node_providers
node_api -->|"persists state"| node_storage
node_api -->|"starts scheduled work"| node_triggers
node_api -->|"serves memory"| node_memories
node_api -->|"serves files"| node_attachments
node_api -->|"organizes threads"| node_folders
node_api -->|"configures providers"| node_settings
node_host -->|"loads skills"| node_skills
node_host -->|"connects extensions"| node_plugins
node_runtime -->|"requests decisions"| node_approvals

click node_web "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/web/src/App.tsx"
click node_desktop "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/desktop-shell/src/main.ts"
click node_cli "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/cli/src/index.ts"
click node_api "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/index.ts"
click node_threads "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-threads.ts"
click node_runmgr "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/protocol-run-manager.ts"
click node_host "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/agent-host.ts"
click node_graph "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/graph-manager.ts"
click node_runtime "https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/runtime-langgraph/src/backend.ts"
click node_providers "https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/inference-providers/src/providers/openai.ts"
click node_storage "https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/storage/src/app-db.ts"
click node_triggers "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/trigger-service.ts"
click node_memories "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-memories.ts"
click node_attachments "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-attachments.ts"
click node_skills "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-skills.ts"
click node_plugins "https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/plugin-sdk/src/plugin-host.ts"
click node_approvals "https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/runtime-langgraph/src/backend.ts"
click node_folders "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-folders.ts"
click node_settings "https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-providers.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_web,node_desktop,node_cli,node_user toneBlue
class node_api,node_threads,node_runmgr,node_host,node_graph,node_triggers,node_attachments,node_folders,node_settings toneAmber
class node_runtime,node_memories,node_approvals toneMint
class node_storage toneRose
class node_providers,node_skills,node_plugins toneIndigo
```

## Components

### User experiences

- [Web inbox](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Desktop shell](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/desktop-shell/src/main.ts): `apps/desktop-shell/src/main.ts`
- [Terminal CLI](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/cli/src/index.ts): `apps/cli/src/index.ts`

### API orchestration

- [API server](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/index.ts): `apps/api-server/src/index.ts`
- [Thread routes](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-threads.ts): `apps/api-server/src/routes-threads.ts`
- [Run manager](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/protocol-run-manager.ts): `apps/api-server/src/protocol-run-manager.ts`
- [Agent host](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/agent-host.ts): `apps/api-server/src/agent-host.ts`
- [Graph manager](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/graph-manager.ts): `apps/api-server/src/graph-manager.ts`
- [Scheduled triggers](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/trigger-service.ts): `apps/api-server/src/trigger-service.ts`
- [File attachments](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-attachments.ts): `apps/api-server/src/routes-attachments.ts`
- [Folders](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-folders.ts): `apps/api-server/src/routes-folders.ts`
- [Settings and providers](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-providers.ts): `apps/api-server/src/routes-providers.ts`

### Agent capabilities

- [LangGraph agent](https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/runtime-langgraph/src/backend.ts): `packages/runtime-langgraph/src/backend.ts`
- [Long-term memory](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-memories.ts): `apps/api-server/src/routes-memories.ts`
- [Human approvals](https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/runtime-langgraph/src/backend.ts): `packages/runtime-langgraph/src/backend.ts`

### Local state

- [Local persistence](https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/storage/src/app-db.ts): `packages/storage/src/app-db.ts`

### Extensions and models

- [Model providers](https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/inference-providers/src/providers/openai.ts): `packages/inference-providers/src/providers/openai.ts`
- [Skills](https://github.com/pizza-bot-app/pizza-bot/blob/main/apps/api-server/src/routes-skills.ts): `apps/api-server/src/routes-skills.ts`
- [Plugin and MCP host](https://github.com/pizza-bot-app/pizza-bot/blob/main/packages/plugin-sdk/src/plugin-host.ts): `packages/plugin-sdk/src/plugin-host.ts`

### Other components

- **User**

## Connections

- User → Web inbox: uses (evidence: `README.md`)
- User → Desktop shell: uses (evidence: `README.md`)
- User → Terminal CLI: uses (evidence: `README.md`)
- Web inbox → API server: HTTP/SSE (evidence: `README.md`)
- Desktop shell → API server: HTTP/SSE (evidence: `README.md`)
- Terminal CLI → API server: HTTP/SSE (evidence: `README.md`)
- API server → Thread routes: routes requests
- Thread routes → Agent host: starts or manages (evidence: `apps/api-server/src/routes-threads.ts`)
- Agent host → Run manager: manages runs (evidence: `apps/api-server/src/agent-host.ts`)
- Run manager → Graph manager: streams agent
- Graph manager → LangGraph agent: builds agent (evidence: `apps/api-server/src/graph-manager.ts`)
- Agent host → Model providers: resolves models (evidence: `apps/api-server/src/agent-host.ts`)
- API server → Local persistence: persists state (evidence: `README.md`)
- API server → Scheduled triggers: starts scheduled work (evidence: `README.md`)
- API server → Long-term memory: serves memory (evidence: `README.md`)
- API server → File attachments: serves files (evidence: `README.md`)
- API server → Folders: organizes threads (evidence: `README.md`)
- API server → Settings and providers: configures providers (evidence: `README.md`)
- Agent host → Skills: loads skills (evidence: `apps/api-server/src/agent-host.ts`)
- Agent host → Plugin and MCP host: connects extensions (evidence: `apps/api-server/src/agent-host.ts`)
- LangGraph agent → Human approvals: requests decisions (evidence: `README.md`)
