# evanbaker315/attentionos architecture

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

- Interactive diagram: https://gitdiagram.com/evanbaker315/attentionos
- Repository: https://github.com/evanbaker315/attentionos

## Overview

AttentionOS is a self-hosted, agent-driven short-form video content pipeline. The documented workflow runs from research and strategy through scripting, human filming, editing, publishing and community engagement, then feeds analytics and lessons into another cycle. Studio is the operator interface; the worker runs jobs, schedules and webhooks, while Postgres stores workspace-scoped facts and queues. The README documents the major stages and runtime layout; source excerpts confirm selected runner, MCP, editing, scripting and ingestion behavior, but not every module connection.

Main entry points: [`packages/db/src`](https://github.com/evanbaker315/attentionos/tree/main/packages/db/src) (Postgres state), [`modules/editing/src/service.ts`](https://github.com/evanbaker315/attentionos/blob/main/modules/editing/src/service.ts) (Editing), [`modules/research`](https://github.com/evanbaker315/attentionos/tree/main/modules/research) (Research), [`modules/publishing`](https://github.com/evanbaker315/attentionos/tree/main/modules/publishing) (Publishing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Content workflow"]
  node_research["Research"]
  node_strategy["Strategy"]
  node_scripting["Scripting<br/>[service.ts]"]
  node_filming(("Human filming"))
  node_editing["Editing<br/>[service.ts]"]
  node_publishing["Publishing"]
  node_community["Community"]
  node_learning["Analytics and learning"]
  node_onboarding["Onboarding"]
  node_trialreels["Trial reels<br/>[service.ts]"]
end

subgraph group_runtime["Application runtime"]
  node_studio["Studio dashboard"]
  node_worker["Job worker<br/>[worker.ts]"]
  node_runner["Agent runner<br/>[llm.ts]"]
  node_mcp["MCP server<br/>[server.ts]"]
end

subgraph group_safety["Policy and media"]
  node_guardrails["Deterministic guardrails"]
  node_media["Media processing"]
end

subgraph group_state["State and integrations"]
  node_database[("Postgres state")]
  node_workspace["Workspace and Brand Kit<br/>[workspace.ts]"]
  node_providers["Provider adapters"]
end

node_operator(("Operator"))

node_operator -->|"operates"| node_studio
node_operator -->|"sets up"| node_onboarding
node_onboarding -->|"drafts Brand Kit"| node_workspace
node_worker -->|"runs jobs"| node_research
node_research -->|"hands off"| node_strategy
node_strategy -->|"hands off"| node_scripting
node_scripting -->|"prepares scripts"| node_filming
node_filming -->|"supplies footage"| node_editing
node_editing -->|"hands off"| node_publishing
node_publishing -->|"hands off"| node_community
node_community -->|"feeds measurement"| node_learning
node_learning -->|"feeds next cycle"| node_research
node_studio -->|"reads and writes"| node_database
node_worker -->|"uses queues"| node_database
node_runner -->|"records runs"| node_database
node_runner -->|"uses tools"| node_mcp
node_mcp -->|"records tool events"| node_database
node_scripting -->|"checks copy"| node_guardrails
node_editing -->|"processes footage"| node_media
node_worker -.->|"dispatches integrations"| node_providers
node_publishing -.->|"publishes through"| node_providers
node_editing -->|"enables rendering"| node_trialreels
node_trialreels -.->|"schedules variants"| node_publishing
node_learning -->|"records metrics"| node_database
node_research -->|"stores transcripts"| node_database
node_workspace -.->|"provides agent context"| node_runner

click node_studio "https://github.com/evanbaker315/attentionos/tree/main/apps/studio"
click node_worker "https://github.com/evanbaker315/attentionos/blob/main/apps/worker/src/worker.ts"
click node_runner "https://github.com/evanbaker315/attentionos/blob/main/packages/runner/src/llm.ts"
click node_mcp "https://github.com/evanbaker315/attentionos/blob/main/packages/mcp/src/server.ts"
click node_research "https://github.com/evanbaker315/attentionos/tree/main/modules/research"
click node_strategy "https://github.com/evanbaker315/attentionos/tree/main/modules/strategy"
click node_scripting "https://github.com/evanbaker315/attentionos/blob/main/modules/scripting/src/service.ts"
click node_editing "https://github.com/evanbaker315/attentionos/blob/main/modules/editing/src/service.ts"
click node_publishing "https://github.com/evanbaker315/attentionos/tree/main/modules/publishing"
click node_community "https://github.com/evanbaker315/attentionos/tree/main/modules/community"
click node_learning "https://github.com/evanbaker315/attentionos/tree/main/modules/learn"
click node_onboarding "https://github.com/evanbaker315/attentionos/tree/main/modules/onboarding"
click node_guardrails "https://github.com/evanbaker315/attentionos/tree/main/packages/guardrails/src"
click node_media "https://github.com/evanbaker315/attentionos/tree/main/media-py/src/attentionos_media"
click node_database "https://github.com/evanbaker315/attentionos/tree/main/packages/db/src"
click node_workspace "https://github.com/evanbaker315/attentionos/blob/main/packages/core/src/workspace.ts"
click node_providers "https://github.com/evanbaker315/attentionos/tree/main/packages/providers"
click node_trialreels "https://github.com/evanbaker315/attentionos/blob/main/modules/trial-reels/src/service.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_research,node_strategy,node_scripting,node_filming,node_editing,node_publishing,node_community,node_learning,node_onboarding,node_trialreels toneBlue
class node_studio,node_worker,node_runner,node_mcp toneAmber
class node_guardrails,node_media toneMint
class node_database,node_workspace,node_providers toneRose
class node_operator toneIndigo
```

## Components

### Content workflow

- [Research](https://github.com/evanbaker315/attentionos/tree/main/modules/research): `modules/research`
- [Strategy](https://github.com/evanbaker315/attentionos/tree/main/modules/strategy): `modules/strategy`
- [Scripting](https://github.com/evanbaker315/attentionos/blob/main/modules/scripting/src/service.ts): `modules/scripting/src/service.ts`
- **Human filming**
- [Editing](https://github.com/evanbaker315/attentionos/blob/main/modules/editing/src/service.ts): `modules/editing/src/service.ts`
- [Publishing](https://github.com/evanbaker315/attentionos/tree/main/modules/publishing): `modules/publishing`
- [Community](https://github.com/evanbaker315/attentionos/tree/main/modules/community): `modules/community`
- [Analytics and learning](https://github.com/evanbaker315/attentionos/tree/main/modules/learn): `modules/learn`
- [Onboarding](https://github.com/evanbaker315/attentionos/tree/main/modules/onboarding): `modules/onboarding`
- [Trial reels](https://github.com/evanbaker315/attentionos/blob/main/modules/trial-reels/src/service.ts): `modules/trial-reels/src/service.ts`

### Application runtime

- [Studio dashboard](https://github.com/evanbaker315/attentionos/tree/main/apps/studio): `apps/studio`
- [Job worker](https://github.com/evanbaker315/attentionos/blob/main/apps/worker/src/worker.ts): `apps/worker/src/worker.ts`
- [Agent runner](https://github.com/evanbaker315/attentionos/blob/main/packages/runner/src/llm.ts): `packages/runner/src/llm.ts`
- [MCP server](https://github.com/evanbaker315/attentionos/blob/main/packages/mcp/src/server.ts): `packages/mcp/src/server.ts`

### Policy and media

- [Deterministic guardrails](https://github.com/evanbaker315/attentionos/tree/main/packages/guardrails/src): `packages/guardrails/src`
- [Media processing](https://github.com/evanbaker315/attentionos/tree/main/media-py/src/attentionos_media): `media-py/src/attentionos_media`

### State and integrations

- [Postgres state](https://github.com/evanbaker315/attentionos/tree/main/packages/db/src): `packages/db/src`
- [Workspace and Brand Kit](https://github.com/evanbaker315/attentionos/blob/main/packages/core/src/workspace.ts): `packages/core/src/workspace.ts`
- [Provider adapters](https://github.com/evanbaker315/attentionos/tree/main/packages/providers): `packages/providers`

### Other components

- **Operator**

## Connections

- Operator → Studio dashboard: operates
- Operator → Onboarding: sets up
- Onboarding → Workspace and Brand Kit: drafts Brand Kit
- Job worker → Research: runs jobs
- Research → Strategy: hands off
- Strategy → Scripting: hands off
- Scripting → Human filming: prepares scripts
- Human filming → Editing: supplies footage
- Editing → Publishing: hands off
- Publishing → Community: hands off
- Community → Analytics and learning: feeds measurement
- Analytics and learning → Research: feeds next cycle
- Studio dashboard → Postgres state: reads and writes
- Job worker → Postgres state: uses queues
- Agent runner → Postgres state: records runs (evidence: `packages/runner/src/llm.ts`)
- Agent runner → MCP server: uses tools (evidence: `packages/runner/src/llm.ts`)
- MCP server → Postgres state: records tool events (evidence: `packages/mcp/src/server.ts`)
- Scripting → Deterministic guardrails: checks copy (evidence: `modules/scripting/src/service.ts`)
- Editing → Media processing: processes footage (evidence: `modules/editing/src/service.ts`)
- Job worker → Provider adapters: dispatches integrations
- Publishing → Provider adapters: publishes through
- Editing → Trial reels: enables rendering (evidence: `modules/trial-reels/src/service.ts`)
- Trial reels → Publishing: schedules variants
- Analytics and learning → Postgres state: records metrics (evidence: `modules/learn/src/jobs/ingest.ts`)
- Research → Postgres state: stores transcripts (evidence: `modules/research/src/jobs/ingestTranscript.ts`)
- Workspace and Brand Kit → Agent runner: provides agent context
