# ajenhq/ajen architecture

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

- Interactive diagram: https://gitdiagram.com/ajenhq/ajen
- Repository: https://github.com/ajenhq/ajen

## Overview

Ajen is a local Rust engine for turning a startup idea into an AI-built product. The documented workflow runs from dashboard input through CEO planning and human board approval to Director-orchestrated employee execution, with live progress streamed back to the dashboard. The README also describes employee manifests, multiple LLM providers, tools, budget tracking, and tunnel/API infrastructure. The supplied tree has no runtime source files, so implementation paths and internal call details are unavailable; links below reflect documented relationships only.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Planning &amp; Execution"]
  node_director["Director"]
  node_ceo["AI CEO"]
  node_plan["Company Plan"]
  node_approval["Plan Approval"]
end

subgraph group_runtime["Employee Runtime"]
  node_employees["AI Employees"]
  node_manifests["Employee Manifests"]
  node_engine["Employee Runtime"]
  node_budget["Budget Tracking"]
end

subgraph group_connectivity["CLI &amp; Live Updates"]
  node_events["Real-Time Events"]
  node_server["HTTP &amp; WebSocket API"]
  node_tunnel["Cloudflare Tunnel"]
  node_cli["Local CLI"]
end

subgraph group_capabilities["Models &amp; Tools"]
  node_tools["Tool Registry"]
  node_filesystem["Filesystem Tools"]
  node_providers["LLM Providers"]
end

node_board(("Board Member"))
node_dashboard["Ajen Dashboard"]

node_dashboard -->|"connects through"| node_tunnel
node_tunnel -->|"forwards access"| node_cli
node_cli -->|"runs locally"| node_server
node_server -.->|"accepts commands"| node_director
node_director -->|"orchestrates planning"| node_ceo
node_ceo -->|"creates"| node_plan
node_board -->|"reviews plan"| node_approval
node_approval -->|"authorizes execution"| node_director
node_director -->|"spawns team"| node_employees
node_employees -.->|"run in"| node_engine
node_manifests -->|"define roles"| node_employees
node_engine -->|"uses models"| node_providers
node_engine -->|"uses tools"| node_tools
node_tools -->|"registers"| node_filesystem
node_engine -->|"tracks usage"| node_budget
node_engine -->|"streams updates"| node_events
node_events -->|"broadcasts over WebSocket"| node_server
node_server -->|"exposes local service"| node_tunnel
node_server -->|"streams live updates"| node_dashboard

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_director,node_ceo,node_plan,node_approval toneBlue
class node_employees,node_manifests,node_engine,node_budget toneAmber
class node_events,node_server,node_tunnel,node_cli toneMint
class node_tools,node_filesystem,node_providers toneRose
class node_board,node_dashboard toneIndigo
```

## Components

### Planning & Execution

- **Director**
- **AI CEO**
- **Company Plan**
- **Plan Approval**

### Employee Runtime

- **AI Employees**
- **Employee Manifests**
- **Employee Runtime**
- **Budget Tracking**

### CLI & Live Updates

- **Real-Time Events**
- **HTTP & WebSocket API**
- **Cloudflare Tunnel**
- **Local CLI**

### Models & Tools

- **Tool Registry**
- **Filesystem Tools**
- **LLM Providers**

### Other components

- **Board Member**
- **Ajen Dashboard**

## Connections

- Ajen Dashboard → Cloudflare Tunnel: connects through (evidence: `README.md`)
- Cloudflare Tunnel → Local CLI: forwards access (evidence: `README.md`)
- Local CLI → HTTP & WebSocket API: runs locally (evidence: `README.md`)
- HTTP & WebSocket API → Director: accepts commands
- Director → AI CEO: orchestrates planning (evidence: `README.md`)
- AI CEO → Company Plan: creates (evidence: `README.md`)
- Board Member → Plan Approval: reviews plan (evidence: `README.md`)
- Plan Approval → Director: authorizes execution (evidence: `README.md`)
- Director → AI Employees: spawns team (evidence: `README.md`)
- AI Employees → Employee Runtime: run in
- Employee Manifests → AI Employees: define roles (evidence: `README.md`)
- Employee Runtime → LLM Providers: uses models (evidence: `README.md`)
- Employee Runtime → Tool Registry: uses tools (evidence: `README.md`)
- Tool Registry → Filesystem Tools: registers (evidence: `README.md`)
- Employee Runtime → Budget Tracking: tracks usage (evidence: `README.md`)
- Employee Runtime → Real-Time Events: streams updates (evidence: `README.md`)
- Real-Time Events → HTTP & WebSocket API: broadcasts over WebSocket (evidence: `README.md`)
- HTTP & WebSocket API → Cloudflare Tunnel: exposes local service (evidence: `README.md`)
- HTTP & WebSocket API → Ajen Dashboard: streams live updates (evidence: `README.md`)
