Skip to main content

Virtual Company Architecture β€” Overview & Board Evaluation

Overview

ALAI operates a multi-company virtual organization where 16 specialized AI agent teams handle different domains. Each company has its own CLAUDE.md instructions, agent configurations, and domain expertise. Companies communicate through tasks (Mission Control) and knowledge entries (HiveMind) β€” never directly.

Last evaluated: 2026-03-31 by architecture board (Petter Graff, Martin Kleppmann, Kelsey Hightower, Chip Huyen + Devil's Advocate).

Company Registry

CompanyTypeDomainStatus
CodeCraftDev ShopBackend, APIs, databases, full-stack, fintech🟒 Active
VizuAgencyFrontend, UI/UX, design, branding, components🟒 Active
DataveraProduct CoData engineering, analytics, ML pipelines, SQL🟒 Active
SkyboundProduct CoSaaS product development, multi-tenant systems🟒 Active
ProveoAudit FirmQA, testing, code review, validation (READ-ONLY)🟒 Active
SecurionConsultancySecurity audit, pentest, vulnerability scanning🟒 Active
FlowForgeConsultancyDevOps, CI/CD, IaC, monitoring, deployment🟒 Active
HelixSupportConsultancyProduction support, SLA, incidents, hotfixes🟑 Merge candidate β†’ FlowForge
LexiconConsultancyLegal docs, compliance (GDPR/PSD2), ADRs🟒 Active
FinvergeConsultancyFintech, payments, accounting, open banking🟒 Active
SkillforgeConsultancyRunbooks, training, knowledge management🟑 Merge candidate β†’ Lexicon
ProximaAgencyMarketing, growth, SEO, content🟑 Merge candidate β†’ Lexicon
AgentForgeAI LabAI/ML ops, RAG, embeddings, model ops, HiveMind🟒 Active
AxiomConsultancySoftware architecture, system design, blueprints🟒 Active
EntraOrchestration HubUndefined β€” needs definition or removalπŸ”΄ Review
ResolverMeta-OpsCross-company diagnostics, systemic fixes🟒 Active

Communication Architecture

Layer 1: Task Routing (Synchronous)

PI Orchestrator classifies tasks by keywords and routes to the appropriate company via ~/system/config/domain-to-company.json.

Task created β†’ PI Orchestrator classifies (Tier 1-5) β†’ keyword match β†’ company assignment β†’ agent execution

Layer 2: Pipeline Chain (Automatic Handoff)

Sequential quality gates managed by pipeline-engine.js:

BUILD (CodeCraft/Vizu) β†’ REVIEW (Proveo) β†’ SECURITY (Securion) β†’ OPS (FlowForge) β†’ DOCS (Lexicon)
  ↑                          |
  └── BUILD-FIX (max 2 cycles) β†β”˜  If REVIEW fails

Layer 3: Cross-Company Event Bus (Asynchronous)

Managed by cross-company-bus.js. Scans HiveMind entries, applies routing rules from cross-company-routes.json (9 rules), creates inter-company tasks.

Board finding (2026-03-31): Bus was effectively dead β€” 1 task/day despite running every 6h. Root causes: agentPatterns didn't match actual HiveMind agent names, keyword matching too narrow. Fixed same day.

Layer 4: Resolver Meta-Daemon

Runs every 6h via resolver-daemon.js. Detects systemic patterns (3+ same failure = pattern), creates H-priority fix tasks.

Layer 5: Decision Log (NEW β€” 2026-03-31)

Structured, queryable decision log in mission-control.db. CLI: node ~/system/tools/decision.js. Supports log, query, list, history, supersede. Append-only audit trail with supersession chains.

Where Communication Lives

StorePurposeLocation
Mission Control DBTasks, pipeline stages, task history, decisions~/system/databases/mission-control.db
HiveMind DBKnowledge entries, intel, memos (23K+ entries)~/system/databases/hivemind.db
Events DBSystem event log, event bus~/system/databases/events.db
SlackNotifications (ops, exec, alerts channels)alai-talk.slack.com
Session LogsPer-session summaries~/system/memory/sessions/

Internal Company Structure

Each company follows a standard layout:

~/companies/<Name>/
β”œβ”€β”€ CLAUDE.md       # Mission, expertise, rules, way of working
β”œβ”€β”€ config.json     # Model selection, tier overrides, blueprints
β”œβ”€β”€ agents/         # Agent configurations (lead, builder, reviewer)
β”œβ”€β”€ state/          # Persistent state
└── skills/         # Company-specific skills

Every company has 3 standard agents:

  1. Lead β€” Orchestrator: reads task specs, decomposes work, assigns phases
  2. Builder β€” Implements work per blueprint (model: Sonnet)
  3. Reviewer β€” Validates output, READ-ONLY (model: Sonnet or local Ollama)

Key Orchestration Files

FilePurpose
~/system/kernel/pi-orchestrator.jsMain daemon β€” task intake, classification, routing, execution, quality gates (3,953 lines)
~/system/kernel/pipeline-engine.jsBUILD→REVIEW→SECURITY automatic chain
~/system/kernel/cross-company-bus.jsBatch HiveMind scanner + event routing
~/system/kernel/resolver-daemon.jsSystemic issue detection (6h cron)
~/system/config/domain-to-company.jsonKeyword β†’ company routing map
~/system/config/cross-company-routes.json9 inter-company event routing rules
~/system/tools/decision.jsDecision log CLI (log, query, history, supersede)

Board Evaluation β€” 2026-03-31

Panel

Petter Graff (System Architect) Β· Martin Kleppmann (Distributed Systems) Β· Kelsey Hightower (Orchestration) Β· Chip Huyen (AI Quality) Β· Devil's Advocate

Verdict

Structure is sound but underutilized at ~20% capacity. Fix existing infrastructure before adding new layers.

Key Findings

  1. Cross-company bus was dead β€” agentPatterns didn't match real agent names. Fixed.
  2. getCompanyOverride bug β€” returned string instead of object, tier overrides silently failed. Fixed.
  3. Skill-improver never fired β€” dead task.skill condition. Fixed.
  4. QA-19 skipped ALL checks for automated tasks β€” zero quality gating on pipeline. Fixed (retained checks 5, 6, 11, 12).
  5. No decision log β€” session decisions evaporated. Fixed (decision.js).
  6. No quality scoring β€” only pass/fail, no continuous signal. Planned (Phase 2).
  7. No observability per company β€” throughput, first-pass rate, cycle time not tracked. Planned (Phase 3).
  8. 82 LaunchAgent plists β€” daemon sprawl, should consolidate to ~20. Planned.

Recommendations (Priority Order)

#ActionEffortStatus
1Fix 5 existing bugs1.5hβœ… Done
2Decision log (decisions table + CLI)2hβœ… Done
3Quality score column + basic scoring2h⬜ Planned
4Observability DB + agent_spans2h⬜ Planned
5MC Dashboard Company Health tab2h⬜ Planned
6Daemon consolidation (82β†’~20)4h⬜ Planned
7Company merge (16β†’10-12)3h⬜ CEO decision needed

Design Principles (Confirmed by Board)

  • No direct company-to-company calls β€” all through MC tasks or HiveMind
  • No real-time event bus needed β€” priority-triggered scan sufficient
  • SQLite is the right choice for this scale β€” no Prometheus/Grafana/OTel locally
  • INSERT is the telemetry pipeline, SQL is the query language
  • Fewer companies, better utilized > more companies with overhead