# harishkotra/agent-office architecture

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

- Interactive diagram: https://gitdiagram.com/harishkotra/agent-office
- Repository: https://github.com/harishkotra/agent-office

## Overview

This tree contains two distinct runtime products: AgentOffice, a local-LLM multi-agent simulation, and the nested Pixel Agents VS Code extension, which visualizes and tracks coding-agent sessions. AgentOffice’s documented flow runs from the office UI through the server room to agent inference, action/tool execution, and persistent memory; its UI also exposes task and layout controls. Pixel Agents’ flow tracks terminal/transcript and hook activity into extension state and a webview office. Pixel edges follow SOURCE INDEX references and excerpts; unsampled subsystems are represented without speculative internal links.

Main entry points: [`packages/server/src/rooms/OfficeRoom.ts`](https://github.com/harishkotra/agent-office/blob/main/packages/server/src/rooms/OfficeRoom.ts) (Office room), [`packages/ui/src/App.tsx`](https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/App.tsx) (Browser controls), [`pixel-agents-repo/src/extension.ts`](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/extension.ts) (Extension entry), [`pixel-agents-repo/src/agentManager.ts`](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/agentManager.ts) (Agent manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ao_runtime["AgentOffice Runtime"]
  node_agent_core["Agent lifecycle<br/>[Agent.ts]"]
  node_inference["Inference adapters<br/>[OllamaAdapter.ts]"]
  node_office_room["Office room<br/>[OfficeRoom.ts]"]
  node_tools["Tool execution<br/>[ToolExecutor.ts]"]
  node_memory_store[("Persistent memory<br/>[MemoryStore.ts]")]
  node_memory_manager["Memory manager<br/>[MemoryManager.ts]"]
  node_task_manager["Task management<br/>[TaskManager.ts]"]
  node_office_grid["Office grid<br/>[Grid.ts]"]
end

subgraph group_ao_ui["AgentOffice Interface"]
  node_ao_ui["Browser controls<br/>[App.tsx]"]
  node_ao_game["Office renderer<br/>[Game.ts]"]
  node_ao_layout["Layout editor<br/>[LayoutEditor.tsx]"]
  node_ao_task_ui["Task board<br/>[TaskBoard.tsx]"]
end

subgraph group_pa_host["Pixel Agents Host"]
  node_extension["Extension entry<br/>[extension.ts]"]
  node_agent_manager["Agent manager<br/>[agentManager.ts]"]
  node_watcher["Transcript watcher<br/>[fileWatcher.ts]"]
  node_parser["Transcript parser"]
  node_timers["Activity timers<br/>[timerManager.ts]"]
end

subgraph group_pa_events["Pixel Agents Events"]
  node_pixel_server["Session server<br/>[server.ts]"]
  node_provider["Provider registry<br/>[provider.ts]"]
  node_team_provider["Team provider<br/>[teamProvider.ts]"]
  node_hook_handler["Hook event handler"]
end

subgraph group_pa_view["Pixel Agents Webview"]
  node_pixel_webview["Office webview<br/>[App.tsx]"]
  node_extension_messages["Extension messages"]
  node_office_state["Office simulation<br/>[officeState.ts]"]
  node_editor_actions["Layout editing"]
  node_editor_state["Editor state<br/>[editorState.ts]"]
  node_furniture["Furniture catalog"]
end

node_user(("User"))
node_ollama{{"Ollama / API"}}
node_pixel_user(("VS Code user"))

node_user -->|"uses"| node_ao_ui
node_ao_ui -->|"displays"| node_ao_game
node_ao_ui -->|"offers tasks"| node_ao_task_ui
node_ao_ui -->|"offers layout"| node_ao_layout
node_ao_ui -.->|"syncs state"| node_office_room
node_ao_game -.->|"receives state"| node_office_room
node_office_room -->|"runs agents"| node_agent_core
node_office_room -->|"requests inference"| node_inference
node_inference -->|"sends prompts"| node_ollama
node_office_room -->|"dispatches actions"| node_tools
node_office_room -->|"reads and writes"| node_memory_store
node_memory_manager -.->|"persists recall"| node_memory_store
node_office_room -.->|"manages tasks"| node_task_manager
node_office_room -.->|"updates office"| node_office_grid
node_pixel_user -.->|"opens extension"| node_extension
node_extension -.->|"manages sessions"| node_agent_manager
node_agent_manager -->|"starts watching"| node_watcher
node_watcher -->|"parses transcripts"| node_parser
node_agent_manager -->|"manages timers"| node_timers
node_pixel_server -->|"loads providers"| node_provider
node_provider -->|"uses team provider"| node_team_provider
node_pixel_server -.->|"routes hooks"| node_hook_handler
node_hook_handler -->|"controls timers"| node_timers
node_extension -.->|"hosts view"| node_pixel_webview
node_pixel_webview -->|"handles messages"| node_extension_messages
node_extension_messages -->|"updates agents"| node_office_state
node_pixel_webview -->|"offers editing"| node_editor_actions
node_editor_actions -->|"updates state"| node_editor_state
node_editor_actions -->|"queries catalog"| node_furniture
node_office_state -->|"builds office"| node_furniture

click node_agent_core "https://github.com/harishkotra/agent-office/blob/main/packages/core/src/agent/Agent.ts"
click node_inference "https://github.com/harishkotra/agent-office/blob/main/packages/adapters/src/OllamaAdapter.ts"
click node_office_room "https://github.com/harishkotra/agent-office/blob/main/packages/server/src/rooms/OfficeRoom.ts"
click node_tools "https://github.com/harishkotra/agent-office/blob/main/packages/server/src/tools/ToolExecutor.ts"
click node_memory_store "https://github.com/harishkotra/agent-office/blob/main/packages/server/src/memory/MemoryStore.ts"
click node_memory_manager "https://github.com/harishkotra/agent-office/blob/main/packages/core/src/memory/MemoryManager.ts"
click node_task_manager "https://github.com/harishkotra/agent-office/blob/main/packages/core/src/task/TaskManager.ts"
click node_office_grid "https://github.com/harishkotra/agent-office/blob/main/packages/core/src/office/Grid.ts"
click node_ao_ui "https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/App.tsx"
click node_ao_game "https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/game/Game.ts"
click node_ao_layout "https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/components/LayoutEditor.tsx"
click node_ao_task_ui "https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/components/TaskBoard.tsx"
click node_extension "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/extension.ts"
click node_agent_manager "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/agentManager.ts"
click node_watcher "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/fileWatcher.ts"
click node_parser "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/transcriptParser.ts"
click node_timers "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/timerManager.ts"
click node_pixel_server "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/server/src/server.ts"
click node_provider "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/server/src/provider.ts"
click node_team_provider "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/server/src/teamProvider.ts"
click node_hook_handler "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/server/src/hookEventHandler.ts"
click node_pixel_webview "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/App.tsx"
click node_extension_messages "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/hooks/useExtensionMessages.ts"
click node_office_state "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/office/engine/officeState.ts"
click node_editor_actions "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/hooks/useEditorActions.ts"
click node_editor_state "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/office/editor/editorState.ts"
click node_furniture "https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/office/layout/furnitureCatalog.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_agent_core,node_inference,node_office_room,node_tools,node_memory_store,node_memory_manager,node_task_manager,node_office_grid,node_user,node_pixel_user toneBlue
class node_ao_ui,node_ao_game,node_ao_layout,node_ao_task_ui toneAmber
class node_extension,node_agent_manager,node_watcher,node_parser,node_timers,node_ollama toneMint
class node_pixel_server,node_provider,node_team_provider,node_hook_handler toneRose
class node_pixel_webview,node_extension_messages,node_office_state,node_editor_actions,node_editor_state,node_furniture toneIndigo
```

## Components

### AgentOffice Runtime

- [Agent lifecycle](https://github.com/harishkotra/agent-office/blob/main/packages/core/src/agent/Agent.ts): `packages/core/src/agent/Agent.ts`
- [Inference adapters](https://github.com/harishkotra/agent-office/blob/main/packages/adapters/src/OllamaAdapter.ts): `packages/adapters/src/OllamaAdapter.ts`
- [Office room](https://github.com/harishkotra/agent-office/blob/main/packages/server/src/rooms/OfficeRoom.ts): `packages/server/src/rooms/OfficeRoom.ts`
- [Tool execution](https://github.com/harishkotra/agent-office/blob/main/packages/server/src/tools/ToolExecutor.ts): `packages/server/src/tools/ToolExecutor.ts`
- [Persistent memory](https://github.com/harishkotra/agent-office/blob/main/packages/server/src/memory/MemoryStore.ts): `packages/server/src/memory/MemoryStore.ts`
- [Memory manager](https://github.com/harishkotra/agent-office/blob/main/packages/core/src/memory/MemoryManager.ts): `packages/core/src/memory/MemoryManager.ts`
- [Task management](https://github.com/harishkotra/agent-office/blob/main/packages/core/src/task/TaskManager.ts): `packages/core/src/task/TaskManager.ts`
- [Office grid](https://github.com/harishkotra/agent-office/blob/main/packages/core/src/office/Grid.ts): `packages/core/src/office/Grid.ts`

### AgentOffice Interface

- [Browser controls](https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/App.tsx): `packages/ui/src/App.tsx`
- [Office renderer](https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/game/Game.ts): `packages/ui/src/game/Game.ts`
- [Layout editor](https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/components/LayoutEditor.tsx): `packages/ui/src/components/LayoutEditor.tsx`
- [Task board](https://github.com/harishkotra/agent-office/blob/main/packages/ui/src/components/TaskBoard.tsx): `packages/ui/src/components/TaskBoard.tsx`

### Pixel Agents Host

- [Extension entry](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/extension.ts): `pixel-agents-repo/src/extension.ts`
- [Agent manager](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/agentManager.ts): `pixel-agents-repo/src/agentManager.ts`
- [Transcript watcher](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/fileWatcher.ts): `pixel-agents-repo/src/fileWatcher.ts`
- [Transcript parser](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/transcriptParser.ts): `pixel-agents-repo/src/transcriptParser.ts`
- [Activity timers](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/src/timerManager.ts): `pixel-agents-repo/src/timerManager.ts`

### Pixel Agents Events

- [Session server](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/server/src/server.ts): `pixel-agents-repo/server/src/server.ts`
- [Provider registry](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/server/src/provider.ts): `pixel-agents-repo/server/src/provider.ts`
- [Team provider](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/server/src/teamProvider.ts): `pixel-agents-repo/server/src/teamProvider.ts`
- [Hook event handler](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/server/src/hookEventHandler.ts): `pixel-agents-repo/server/src/hookEventHandler.ts`

### Pixel Agents Webview

- [Office webview](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/App.tsx): `pixel-agents-repo/webview-ui/src/App.tsx`
- [Extension messages](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/hooks/useExtensionMessages.ts): `pixel-agents-repo/webview-ui/src/hooks/useExtensionMessages.ts`
- [Office simulation](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/office/engine/officeState.ts): `pixel-agents-repo/webview-ui/src/office/engine/officeState.ts`
- [Layout editing](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/hooks/useEditorActions.ts): `pixel-agents-repo/webview-ui/src/hooks/useEditorActions.ts`
- [Editor state](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/office/editor/editorState.ts): `pixel-agents-repo/webview-ui/src/office/editor/editorState.ts`
- [Furniture catalog](https://github.com/harishkotra/agent-office/blob/main/pixel-agents-repo/webview-ui/src/office/layout/furnitureCatalog.ts): `pixel-agents-repo/webview-ui/src/office/layout/furnitureCatalog.ts`

### Other components

- **User**
- **Ollama / API**
- **VS Code user**

## Connections

- User → Browser controls: uses (evidence: `README.md`)
- Browser controls → Office renderer: displays (evidence: `packages/ui/src/main.tsx`)
- Browser controls → Task board: offers tasks (evidence: `packages/ui/src/App.tsx`)
- Browser controls → Layout editor: offers layout (evidence: `packages/ui/src/App.tsx`)
- Browser controls → Office room: syncs state (evidence: `README.md`)
- Office renderer → Office room: receives state (evidence: `README.md`)
- Office room → Agent lifecycle: runs agents (evidence: `packages/server/src/rooms/OfficeRoom.ts`)
- Office room → Inference adapters: requests inference (evidence: `packages/server/src/rooms/OfficeRoom.ts`)
- Inference adapters → Ollama / API: sends prompts (evidence: `README.md`)
- Office room → Tool execution: dispatches actions (evidence: `packages/server/src/rooms/OfficeRoom.ts`)
- Office room → Persistent memory: reads and writes (evidence: `packages/server/src/rooms/OfficeRoom.ts`)
- Memory manager → Persistent memory: persists recall
- Office room → Task management: manages tasks
- Office room → Office grid: updates office
- VS Code user → Extension entry: opens extension
- Extension entry → Agent manager: manages sessions
- Agent manager → Transcript watcher: starts watching (evidence: `pixel-agents-repo/src/agentManager.ts`)
- Transcript watcher → Transcript parser: parses transcripts (evidence: `pixel-agents-repo/src/fileWatcher.ts`)
- Agent manager → Activity timers: manages timers (evidence: `pixel-agents-repo/src/agentManager.ts`)
- Session server → Provider registry: loads providers (evidence: `pixel-agents-repo/server/src/server.ts`)
- Provider registry → Team provider: uses team provider (evidence: `pixel-agents-repo/server/src/provider.ts`)
- Session server → Hook event handler: routes hooks
- Hook event handler → Activity timers: controls timers (evidence: `pixel-agents-repo/server/src/hookEventHandler.ts`)
- Extension entry → Office webview: hosts view
- Office webview → Extension messages: handles messages (evidence: `pixel-agents-repo/webview-ui/src/App.tsx`)
- Extension messages → Office simulation: updates agents (evidence: `pixel-agents-repo/webview-ui/src/hooks/useExtensionMessages.ts`)
- Office webview → Layout editing: offers editing (evidence: `pixel-agents-repo/webview-ui/src/App.tsx`)
- Layout editing → Editor state: updates state (evidence: `pixel-agents-repo/webview-ui/src/hooks/useEditorActions.ts`)
- Layout editing → Furniture catalog: queries catalog (evidence: `pixel-agents-repo/webview-ui/src/hooks/useEditorActions.ts`)
- Office simulation → Furniture catalog: builds office (evidence: `pixel-agents-repo/webview-ui/src/office/engine/officeState.ts`)
