YBA Empire — Architecture v3.4

YBA Empire — Architecture v3.4

What changed since v2: Captain defined Flow as an AI agent suite for SMEs (8 always-on agents per tenant, BYOK or concierge delivery). Five specialists re-thought the architecture. The shape got simpler, not more complex.

What changed in v3.4 (later same evening): Captain locked in two more decisions — (a) the per-tenant brain uses the exact Richards Brain pattern (markdown wiki, file-system-based, no DB middleware for knowledge), and (b) on top of the 8 universal agents, each vertical has its own specialist agent layer with its own skill list and SOP.

Companion document: the detailed step-by-step development plan to take this architecture from today’s state to first paying Med tenant lives at YBA Empire Development Plan v1 — 9 phases, engineering plan, allocation, week-by-week first-90-days playbook, living-document system.


The Big Shifts vs v2

  1. Flow is now a PRODUCT, not a holding-company badge. It’s the AI agent suite. Sold to real customers.
  2. Edge / Terra / Med / Realty collapse from “4 parallel products” to “4 vertical configurations of Flow.” Customers still see them as separate brands (a doctor never sees the word “Flow”), but underneath they all run the same engine with different config bundles.
  3. A third engine is added: the Agent Runtime. Not a new framework — just n8n (already running) + a small custom Node service (“Flow Core”) + an LLM router. The 8 agents live here.
  4. (v3.4) Tenant brain = markdown wiki, exactly like Richards Brain. Postgres + pgvector for transactional data only — NEVER for knowledge. The wiki IS the brain.
  5. (v3.4) Agents are three layers, not one. Foundation (8 universal) + Vertical Specialists (different per product) + Tenant Brain (markdown wiki).

The Picture (v3.4)

                          YBA SYSTEMS (the VPS)
              Coolify · Docker · Postgres · Redis · n8n
                                 |
   ┌─────────────────────────────┼─────────────────────────────┐
   │                             │                             │
┌─────────┐               ┌─────────────┐              ┌──────────────┐
│ ENGINE 1│               │  ENGINE 2   │              │   ENGINE 3   │
│BACK-OFC │               │  CONTENT    │              │   AGENTS     │
│ ERPNext │ ←—reads/writes│  Postiz +   │ ←—called by──│  Flow Core + │
│ books,  │               │  n8n + Hono │   agents     │  LLM router  │
│ CRM, HR │               │  landings   │              │  (NEW)       │
│ (txn)   │               │             │              │              │
└─────────┘               └─────────────┘              └──────────────┘
                                                              ▲
                                                              │
                                ┌─────────────────────────────┴────────────────────────────┐
                                │      PER-TENANT BRAIN (markdown wiki — Richards Brain)   │
                                │      /opt/flow/tenants/<id>/                             │
                                │      ├── CLAUDE.md  (tenant schema)                      │
                                │      ├── index.md   (catalog)                            │
                                │      ├── log.md     (chronological)                      │
                                │      ├── raw/       (source docs)                        │
                                │      └── wiki/      (sources/entities/concepts/analyses) │
                                │      Obsidian-compatible · file-system source of truth   │
                                └──────────────────────────────────────────────────────────┘
                                                              ▲
                                              ┌───────────────┴───────────────┐
                                              │  YBA FLOW (the product)       │
                                              │  8 universal foundation agents│
                                              │  + per-vertical specialists   │
                                              │  per tenant                   │
                                              └───────────────────────────────┘
                                                              ▲
                                              ┌───────────────┴───────────────┐
                                              │   Vertical configs / brands   │
                                              │   Edge · Terra · Med · Realty │
                                              │   + Flow direct (BYOK tier)   │
                                              └───────────────────────────────┘

The Three-Layer Agent Architecture (v3.4)

Captain confirmed every product needs different specialist agents on top of the universal foundation. So the agent architecture is now three layers:

┌─────────────────────────────────────────────────────────────────────┐
│  LAYER 3 — PER-TENANT BRAIN  (every tenant's own wiki)              │
│  Markdown vault, Obsidian-compatible, Richards Brain pattern.       │
│  Same structure as /opt/claude-workspace/projects/richards-brain.   │
│  Cheap, effective, owner can browse it themselves.                  │
└─────────────────────────────────────────────────────────────────────┘
                                  ▲
┌─────────────────────────────────┴───────────────────────────────────┐
│  LAYER 2 — VERTICAL SPECIALIST AGENTS  (different per product)      │
│                                                                      │
│  Edge:    brand-voice · content-clipper · per-platform social ·     │
│           engagement-monitor · analytics                            │
│                                                                      │
│  Terra:   agronomist · livestock · irrigation/water ·               │
│           commodity-prices · equipment-maintenance                  │
│                                                                      │
│  Med:     claims-processing · clinical-notes · NAPPI/ICD-10 ·       │
│           patient-triage · medical-aid liaison                      │
│                                                                      │
│  Realty:  listing-syndication · buyer-matching · deeds-tracker ·    │
│           valuation · FICA-compliance                               │
│                                                                      │
│  Each vertical's specialist list + skill set + SOP locks in when    │
│  Captain provides that product's vision document.                   │
└─────────────────────────────────────────────────────────────────────┘
                                  ▲
┌─────────────────────────────────┴───────────────────────────────────┐
│  LAYER 1 — FOUNDATION (8 universal agents — every tenant)           │
│                                                                      │
│  1. Infrastructure & Security    5. Front Desk                      │
│  2. Development                  6. Customer Care                   │
│  3. HR Executive Assistant       7. Call Transcription & Follow-up  │
│  4. Accounts                     8. Executive Assistant             │
└─────────────────────────────────────────────────────────────────────┘

Why this works: - Layer 1 is universal because every business has the same admin spine — HR, Accounts, Front Desk, Customer Care. Build once, ship to every tenant. - Layer 2 is what makes each product VALUABLE to its industry — the specialist knowledge a doctor or farmer or estate agent actually pays for. - Layer 3 is the customer’s competitive memory — their data, their voice, their processes. The thing they can’t move and won’t churn from.

Vertical specialist agents are defined when each vision lands. Edge specialists are roughly known from the Edge vision doc. Terra / Med / Realty get their full Layer 2 definition when Captain provides those visions — at which point the empire architecture goes to v4 / v5.


The Per-Tenant Brain (Layer 3) — exactly like Richards Brain

Every tenant gets a knowledge brain built using the exact same structure as Richards Brain:

/opt/flow/tenants/<tenant-id>/
├── CLAUDE.md           # the tenant's schema + house rules
├── index.md            # catalog of every page in the brain
├── log.md              # chronological record of operations
├── raw/                # source documents the business uploads
└── wiki/
    ├── sources/        # one summary per ingested source
    ├── entities/       # people, suppliers, customers, tools
    ├── concepts/       # ideas, processes, frameworks
    ├── analyses/       # synthesised answers
    └── meta/           # health/dashboards

Every page is markdown with YAML frontmatter and [[wikilinks]] for cross-references. Obsidian-compatible — the owner can open their own brain in Obsidian and read it like a second brain.

Why markdown-only: 1. Cheap. Files on disk. Near-zero per-tenant storage cost vs running a database per tenant. 2. Effective. Markdown is the format LLMs read best. Agents read/write directly to the vault — no ORM, no DB middleware, no schema migrations. 3. Same as ours. Captain has already proven this pattern works on his own second brain. Dogfood = product. 4. Auditable. The owner can browse their brain themselves at any time. No black box.

What Postgres is still for: transactional data only — bookings, customer rows that need fast lookup, billing events. NOT knowledge. The wiki IS the knowledge.

pgvector (semantic search) is OPTIONAL — built as a derived index over the markdown if a tenant needs it. The markdown is always the source of truth. Lose the index, rebuild it from the files.


The 8 Agents (the foundation — Layer 1)

Every business gets the same 8 agents. Each agent has its own role, its own knowledge base, and its own LLM model picked per-task:

# Agent What it does LLM (default)
1 Infrastructure & Security Watches servers, deployments, uptime, backups Haiku 4.5 (cheap, repetitive)
2 Development Site updates, integrations, custom features Sonnet 4.6 (code)
3 HR Executive Assistant Hiring, leave, contracts — SA labour law built in Sonnet 4.6 (legal nuance)
4 Accounts VAT, SARS paperwork, payroll, bookkeeping Opus 4.7 (max accuracy on tax)
5 Front Desk Inbound calls, appointment booking, reception Sonnet 4.6 + Whisper
6 Customer Care Calls 2 days before booked work + 1-2 days after for feedback Sonnet 4.6 + ElevenLabs
7 Call Transcription & Follow-up Listens, transcribes, emails customer the transcript Whisper + Haiku
8 Executive Assistant Keeps tabs on everything, daily owner briefing, dashboard Sonnet 4.6

The model is per-task, not per-agent. The same agent can run cheap tasks on Haiku and accuracy-critical tasks on Opus. Captain swaps models by editing one config file — never by touching agent code.

Cost per tenant (moderate use, ~5-15 staff): ~R2,700/month in LLM + voice spend. At 5 tenants total ~R13,500/month in API costs against R90k+ in concierge revenue.


The Five Decisions (re-picked for v3)

1. How is the engine built?

v3 pick: Three engines — back-office (ERPNext) + content (Postiz/n8n/Hono) + agent runtime (Flow Core).

v2 v3
Engines 2 (back-office + content) 3 (adds agent runtime)
Verticals One install per product One platform with 4 configurations
Edge Two front doors Edge stage 2 = Flow concierge for portfolio operators; stage 3 = Flow BYOK with portfolio templates

Reject: LangGraph, CrewAI, AutoGen — none solve the hard problem (multi-tenant + scheduling + integrations to ERPNext/Postiz/Twilio). They solve “structure one agent’s reasoning,” which n8n + a small Node service already covers.

Pick: n8n (scheduler + triggers, already running) + Flow Core (~2-3k lines of custom code, the only new thing we write) + LiteLLM for LLM provider abstraction + FastAPI thin layer for tenant lookup, BYOK, and cost logging.


2. What’s special about each product?

v3 pick: Edge / Terra / Med / Realty are CONFIGURATIONS of Flow, not parallel products.

Each vertical brand gets: - Industry-tuned agent prompts (HR knows HPCSA for Med; Front Desk knows FICA for Realty) - Industry-specific data feeds (medical-aid claim codes, agricultural commodity prices, Lightstone property data) - Vertical-specific integrations (Healthbridge for Med, Property24 syndication for Realty) - Branded front door (ybamed.co.za, ybarealty.co.za, etc.)

Customers buy the vertical brand, never see “Flow.” Flow is the engine; Med / Edge / Terra / Realty are the products. Same engine, four paint jobs.

The unlock: the 8 agents are universal. New verticals become weeks of work (knowledge pack + branded front door), not months of rebuilding.


3. How does YBA Flow present itself?

v3 pick: Flow becomes a customer brand at one specific spot — the BYOK direct tier. Everywhere else, customers buy a vertical brand.

Surface Who lands there
ybamed.co.za Doctors, dentists, physios
ybarealty.co.za Estate agents
ybaterra.co.za Farmers
socialdrip.ybaedge.com Side-hustlers (Edge stage 3)
edge.ybaedge.com Done-for-you portfolio agency clients (Edge stage 2)
flow.ybaedge.com (or ybaflow.com) Tech-comfortable SMEs who want the generic agent suite (BYOK direct)
The “YBA Group” parent Holding-company brand, one-pager, no signup

The v2 call (“Flow is internal-only”) was right for v2’s empire shape. v3 makes Flow a product — but only the BYOK direct buyer sees it.


4. Where do you start?

v3 pick: Concierge first. Sell, not build. The R6k Flow concierge client already signed = Flow concierge tier client #1.

Concrete sequence:

Months What ships Revenue target
1-3 3-5 concierge clients onboarded; basic 8-agent runtime live R55-90k MRR + R250-350k cash banked by month 3
4-6 Concierge stabilised; BYOK self-serve dashboard built in background Add 3-5 more concierge
7-9 BYOK soft-launched to existing Edge SaaS users (closed beta) 20-30 BYOK paying
10-12 BYOK opens publicly; Med vertical config begins (Healthbridge paperwork) 50+ BYOK; first Med pilot

Concierge funds BYOK. R20k/mo × 10 concierge = R2.4m/year — that pays for the engineering work to make BYOK self-serve. Don’t sell more concierge than Captain can deliver (~15 client ceiling before he must hire help).


5. What technology runs the engine?

v3 pick: Hybrid stack with Flow Core as the only new code.

Component What it does Status
ERPNext at erp.ybaedge.com Books, invoices, customers, HR records, billing Already deployed
Postiz at socialdrip.ybaedge.com Multi-tenant social posting Already deployed
n8n Scheduler + 400+ pre-built integrations Already running
Flow Core (Node + Hono, ~2-3k lines) Per-agent role prompts, memory, tool catalogue Build now
LiteLLM + FastAPI router LLM provider abstraction, BYOK, cost logging Build now (small)
Postgres + pgvector Per-tenant brain (schema isolation + semantic search) Already running
Twilio Voice (Front Desk + Customer Care) New (signup required)
Cartesia or ElevenLabs Agent’s voice (TTS) New (signup required)
Whisper API or Whisper-local Call transcription Already used in CashCircuit pipeline
Telegram Approval flows Already wired

Five of seven pieces already on the VPS. Adds: Flow Core code, Twilio account, voice provider account. That’s it.


Where the 5 Specialists Agreed (v3)

Every specialist independently arrived at the same shape:

  1. Three engines — back-office (ERPNext) + content (Postiz/n8n) + agent runtime (Flow Core). No frameworks like LangGraph or CrewAI.
  2. Flow IS a customer-facing product — but verticals (Med, Edge, Terra, Realty) wear their own brands as the front door.
  3. Per-task LLM routing — not per-agent, not per-tenant. Each task declares accuracy_critical / consistency_critical / cost_critical / balanced; the router picks.
  4. Concierge launches first. Sell to 5-10 SMEs at R20k/mo while BYOK is built quietly in the background. Ship BYOK at month 7-9.
  5. SA compliance is a 3-layer system — static prompt for hot rates (VAT, PAYE) + RAG over full law text (BCEA, LRA, SARS guides) + live data feed (SARS API). Annual February sprint with paid SAIPA + IR consultant review.

SA Compliance — the Plan

The hard rule: agents draft, humans submit. No agent ever auto-files a VAT return or POPIA-relevant document. SARS e-Filing credentials stay with the human owner. This collapses most legal liability.

Three layers:

Layer What lives there Updates how often
Static prompt (small) Current VAT rate, PAYE brackets, UIF cap, minimum wage, “always cite section” rule, escalation rule Once a year (February budget)
RAG knowledge base Full text of BCEA, LRA, EEA, OHSA, SARS guides, sectoral determinations, POPIA Act Monthly diff against gazette
Live data feed SARS e-Filing status, current rate tables, public holiday gazette On demand

Vertical add-on packs: - flow-compliance-core — every tenant (BCEA, LRA, SARS, POPIA) - flow-compliance-medical — YBA Med tenants (HPCSA, BHF, NHA) - flow-compliance-realty — YBA Realty tenants (PPRA, EAAB, FICA-enhanced) - flow-compliance-agri — YBA Terra tenants - flow-compliance-legal — legal practices

Compliance budget (rand/month):

Item Monthly
Sage VAT/Tax updates R450
Government Gazette / Sabinet alerts R350
LexisNexis SA HR module (optional) R650
Annual lawyer DPA+MSA review (R12k ÷ 12) R1,000
Annual SAIPA bookkeeper review (R8k ÷ 12) R650
Annual IR consultant review (R6k ÷ 12) R500
Core total ~R3,600/month

Add ~R800/month per active vertical pack. By full-empire (4 verticals): ~R7,000/month all-in. That’s a junior bookkeeper’s salary spread across every paying tenant.


Concierge vs BYOK — the Two Tiers

Concierge BYOK
Setup fee R45,000 once-off R8,000 (optional)
Monthly base R18,500/mo R3,500/mo
Per-call charge R3.50 inbound, R5 outbound R0 (client uses own Twilio)
LLM costs At-cost +15% (~R2-6k/mo) Client pays direct
All-in / SME R22-30k/mo R5-7.5k/mo
Target buyer Owner-operators (5-15 staff, R5-30m/year) Tech-comfortable founders (2-10 staff)
What they replace A junior receptionist + part-time bookkeeper DIY Notion + ChatGPT + Zapier glue
Onboarding 4-week, Captain-led Self-serve in an afternoon
Liability cap 3 months of fees R2,000
Acquisition channel Referrals + industry assoc + LinkedIn Content marketing + free trial + cross-sell from Edge SaaS

Critical: concierge needs ~R8k/month professional indemnity insurance from day one (R8m cover). Don’t sign concierge without it.


What This Looks Like in Practice (90 days)

Realistic capacity: ~18 hrs/week at night.

Weeks 1-2: Lawyer drafts MSA + DPA. Niki sets up Flow Core skeleton (multi-tenant Postgres schemas, n8n org-per-tenant, LiteLLM router stub). The R6k Flow concierge client = first concierge tenant in shadow mode (agents answer but don’t act).

Weeks 3-4: First 3 of the 8 agents go live for client #1 — Front Desk, Customer Care, Executive Assistant. Captain runs his own 2-3 brands through the same platform. Twilio + Cartesia voice provider live.

Weeks 5-8: Remaining 5 agents activate. 1-2 more concierge clients sign (R45k setup + R20k/mo each). Multi-tenant hardening — every cross-tenant boundary audited.

Weeks 9-13: 3-5 concierge clients live (R60-100k+ MRR). Captain has 5-7 of his own brands on the platform (Edge stage 1 progress). Healthbridge paperwork started in background. BYOK self-serve dashboard scoped.

What we DON’T do in 90 days: YBA Med vertical pack, Terra, Realty, BYOK launch, custom Frappe apps. All months 4+.


Watchpoints

  1. Concierge delivery quality. Captain’s hours are the bottleneck. ~15 concierge clients = hard ceiling before he hires. Don’t oversell.
  2. Multi-tenant correctness. A bug that lets one tenant see another’s data is catastrophic — POPIA breach + reputation destruction. Niki audits every cross-tenant boundary on every release.
  3. The compliance feeds going stale. February budget speech changes are mandatory updates within 24 hours. Set the calendar reminder now.
  4. Professional indemnity insurance signed before concierge client #1 onboards.
  5. LLM cost runaway. A buggy agent in a loop can burn R5,000 in a night. Per-tenant monthly cap + per-task cost guards must be hard-enforced from day 1.
  6. The “Flow concierge” name is now obsolete. Use “Flow concierge” internally; client never sees either name — they see “Edge” or “Med” or whichever vertical brand sold them.

What I’d Like You to Decide

Three things, when you’re ready:

  1. Confirm v3 shape: three engines, Flow as platform, vertical brands as front doors, concierge first / BYOK at month 7-9. Yes / no / push back on a specific bit.
  2. Pricing: R45k setup + R18.5k/mo base for concierge — comfortable, or do you want different numbers? BYOK at R3.5k/mo — same question.
  3. Professional indemnity insurance. R8m cover, ~R8k/month premium. Authorise Niki to get 3 quotes (Hollard / Santam / specialist broker) for review.


YBA Med — Layer 2 Specialist Agents (the first vertical fully designed)

Five research specialists designed the full vertical agent fleet for a SA medical practice on 2026-05-02. 42 specialist agents in 5 teams, sitting on top of the 8 Layer 1 universal agents — total 50 agents per Med tenant. Full per-agent design (skills, SOPs, hard NEVER rules, Layer 1 interactions) lives at [[yba-med-layer2-2026-05-02]].

The 5 Teams

# Team Agents Domain
1 Clinical Workflow 9 Doctor-room work — SOAP notes, diagnosis support, prescriptions, referrals, results
2 Billing & Medical-Aid Claims 7 The moat — submission, rejection auto-fix, gap-cover, reconciliation
3 Patient Lifecycle & WhatsApp 10 Acquire → visit → retain. WhatsApp-first. Red-flag triage
4 Compliance, Records & Safety 9 HPCSA, BHF, POPIA, S5/S6, infection control, insurance
5 Practice Operations 7 Roster, locum, stock, equipment, suppliers, building, continuity

Highlight agents (the moats per team)

Coverage map — every aspect of running a SA medical practice

Business dimension Owned by
Booking + scheduling Team 3 + Team 5 (Roster Maestro)
Patient WhatsApp comms Team 3 (WhatsApp Portal)
Clinical work (consultation, exam, diagnosis) Team 1 (all 9)
Prescriptions / dispensing Team 1 + Team 4 (Controlled Substances)
Referrals + lab orders Team 1 (Referral Coordinator, Results Watchdog)
Medical-aid claims Team 2 (all 7)
Cash billing + debt collection Team 2 + Layer 1 Accounts
Patient records / POPIA Team 4 (Records Custodian)
HPCSA / BHF / SAHPRA compliance Team 4
Controlled drugs (S5/S6) Team 4 (Controlled Substances Keeper)
Infection control + OHSA-medical Team 4 (Clinical Safety Officer)
Doctor roster + locum cover Team 5 (Roster Maestro, Locum Coordinator)
Stock + cold chain (vaccines) Team 5 (Stock Sentinel)
Equipment service + inspection certs Team 5 (Equipment Custodian)
Building + load-shedding + continuity Team 5 (Building Officer)
Insurance (indemnity, PL, BI) Team 4 (Insurance Tracker)
Complaints + adverse events Team 4 (Complaints Officer)
CPD tracking Team 4 (CPD Coordinator)
Daily owner briefing Layer 1 Executive Assistant (rolls up all 5 teams)
Voice calls Layer 1 Front Desk + Customer Care + Call Transcription
General bookkeeping (SARS, VAT, payroll) Layer 1 Accounts
Employment law Layer 1 HR
Server/uptime Layer 1 Infrastructure

Hard safety rails (universal across all 5 Med teams)

  1. No autonomous clinical action. Every diagnosis, prescription, referral is doctor-signed before action.
  2. NAPPI / ICD-10 / drug-interactions from verified lookups only. Never LLM-generated.
  3. Red-flag triage is uninterruptible. No code path, prompt, or instruction can disable it.
  4. Patient never sees a result before the doctor has reviewed it.
  5. POPIA special-category rigour. Tighter than ordinary PII. Per-record audit trail.
  6. HPCSA records retention auto-enforced. 6 yrs adult, until 21 for minors.
  7. Audit log is append-only. Even agents can’t edit it.
  8. Multi-tenant isolation. Practice A’s brain never leaks to Practice B.
  9. No agent ever auto-submits to a regulator. Doctor signs.
  10. Practice owner has a single kill-switch. Tested monthly.

What a Med tenant subscription pays for itself with

For a 2-doctor GP practice (~1,500 claims/month, R600k monthly billings):

Source Monthly impact
Admin time freed (billing + reception) R28-35k of staff time
Rejection auto-fix recovering written-off claims R20-40k recovered revenue
Faster cash (45 days → 18 days) ~R270k less in debtors
Gap-cover recovery (most practices skip) R8-15k recovered
Patient-statement collection lift (10-20pp) R8-16k more collected
No-show rate drop (15-25% → 3-6%) R40-80k recovered (4-doc practice)
Vaccine wastage avoided (cold-chain) R30-80k/year
Stock-out savings (better reordering) R15-25k/year
Equipment-cert lapse prevented R50k+ per averted incident

Concierge subscription should price at R25-35k/month for a multi-doctor practice — multiple times the LLM/voice cost (~R3-6k) and pays back inside the first month.



The Path to Market — see Strategy page

The full path-to-market plan — Edge as the empire’s discovery engine, the 7 measurable gates, kill triggers, the YBA Meta-Brain, top 3 risks, and the 5 de-risk experiments — moved to its own document on 2026-05-02 per the documentation audit. Read empire-strategy.html for the full picture.

The 30-second summary: Edge is built first as Captain’s own portfolio platform (stage 1) → sold as Concierge to clients (stage 2) → packaged as BYOK SaaS (stage 3). Customer interactions become signal that informs Med, Terra, Realty designs. Each new vertical needs its own real practitioner-client to dogfood with. 7 measurable gates govern progression — no calendar dates, only triggers.

Click to expand the original Path-to-Market section (now superseded by Strategy page)

The Plan in One Picture

┌──────────────────────────────────────────────────────────────────┐
│ STAGE 1 — Captain dogfoods Edge on his own 10 portfolio brands   │
│  Spec is written by living it. He IS the first customer.         │
└──────────────────────────────┬───────────────────────────────────┘
                               ▼
┌──────────────────────────────────────────────────────────────────┐
│ STAGE 2 — Same tools sold as Concierge to agency-sector clients  │
│  R45k setup + R18.5k/mo. 5-15 client ceiling. Cashflow + signal. │
│  Every client interaction = customer-discovery research.         │
└────────┬─────────────────────────────────────────────┬───────────┘
         │                                             │
         ▼ (Edge stage 3 unlock)                       ▼ (Empire signal)
┌─────────────────────────┐                 ┌─────────────────────────┐
│ STAGE 3 — Edge BYOK     │                 │ Patterns extracted into │
│ self-serve SaaS         │                 │ the YBA Meta-Brain      │
│ R3.5k/mo, public.       │                 │ (anonymised, POPIA-safe)│
└─────────────────────────┘                 └────────┬────────────────┘
                                                     │
                                                     ▼
                                  ┌──────────────────────────────────┐
                                  │ Med, Terra, Realty designs are   │
                                  │ grounded in real Edge customer   │
                                  │ patterns, not specialist guesses │
                                  └──────────────────────────────────┘

Why This Works — With One Critical Caveat

This is the most reliable platform-business pattern in software history. Basecamp, HubSpot, Shopify, Atlassian all followed it. Yoco is doing it locally right now (built for SA merchants who needed a card reader; expanding to lending + payroll using merchant data as the discovery engine).

But every one of them learned the same lesson: the dogfood-discovery engine works for adjacent verticals (close to the founder’s domain) and fails for distant verticals. Edge’s buyer is a side-hustler / portfolio operator. Med’s buyer is a doctor. They live on different planets — different psychology, different sales motion, different regulatory regime.

Concrete implication: Edge’s customer interactions will surface deep insight on agency-adjacent verticals (coaches, course creators, consultants, small agencies). They will surface shallow insight on Med, Terra, Realty unless Captain deliberately recruits a real practitioner-client in each vertical to dogfood with — one doctor, one farmer, one estate agent.

The 6 Listening Surfaces (where Edge generates signal)

Every Edge customer interaction is captured + tagged + propagated. Concrete sources:

# Surface What it captures
1 Onboarding interview (week 1, every concierge client) 90-min structured call. Captures current tools, staff structure, compliance pain, customer flow. 20 cross-vertical questions.
2 Support tickets + Telegram Every “the agent didn’t do X” — auto-logged with which agent, expected vs actual
3 The customer’s brain — questions they type Weekly anonymised scrape of question patterns (“what do clients ask their HR agent?”)
4 Agent failure logs Monthly rollup of every agent error — failures are richer than successes for cross-vertical design
5 Monthly review meeting 30-min call per concierge client. 3 questions: what worked / nearly broke / missing
6 Churn-exit interview Mandatory 45-min call when client cancels. Most expensive, most honest signal we get

The 7 Gates — Measurable Triggers (Not Timelines)

A gate is a measurable condition, not a date. Captain moves to the next stage only when the trigger fires. The realistic calendar (at 18 hrs/week) is guidance — the triggers are the contract.

# Gate Trigger condition (must ALL be true) Realistic range
1 Edge Stage 1 → Stage 2 5+ of Captain’s brands fully on platform 30d · 0 P1 bugs · synthetic Tenant B test passed · onboarding <30 min · indemnity bound 3-5 months (Aug-Oct 2026)
2 Edge Stage 2 → Stage 3 8+ paying clients × 3 months · churn <5% over 90d · Captain <6 hrs/wk per client · Layer 1 stable 14d · self-serve tested by 5 betas · LLM cost guard proven 9-15 months
3 Med PLANNING starts 15+ Edge clients OR 50+ BYOK · 3 unprompted “do you have something for doctors?” · Edge MRR R150k+ × 2 months · Healthbridge NDA signed · 1 SA GP design partner 6-9 months
4 Med LAUNCH Healthbridge contract signed · all 10 safety rails wired · Practice B isolation test passed · Rejection Auto-Fix shadow mode 30d at ≥85% accuracy · POPIA IO appointed · DPA + MSA signed · indemnity scaled 12-18 months
5 Terra planning 2+ Med tenants stable 60d · Captain provides Terra vision · agri design partner volunteered 18-24 months
6 Realty planning Same shape as Gate 5 — Med stable + Realty vision + design-partner estate agency 18-24 months (parallel with 5)
7 Per-vertical launches Vertical contracts signed · safety rails · shadow mode · synthetic Tenant B · insurance 24-30 months

Hard blocks: Gate 4 cannot fire without Healthbridge contract. Gate 7-Realty needs FICA + EAAB pack. Gate 7-Terra needs commodity-data feed contract. Gate 3 needs Edge MRR ≥R150k for 2 months — Med dev burns ~R300-420k.

The Kill Triggers (when to pause/abandon)

Stop and re-audit if:

The YBA Meta-Brain (the empire’s institutional memory)

A NEW top-level vault, peer to Richards Brain, that captures patterns across all Edge customers (and later Med/Terra/Realty) and propagates them into the platform’s design.

Where it lives: /opt/claude-workspace/projects/yba-meta-brain/ — same Richards Brain markdown wiki structure + two new folders:

yba-meta-brain/
├── CLAUDE.md          # POPIA-strict variant of Richards Brain schema
├── index.md
├── log.md
├── raw/               # anonymised intake (sanitised excerpts only)
└── wiki/
    ├── patterns/      # NEW — one page per cross-tenant pattern
    │   ├── universal/   # patterns that hold across ALL verticals (Layer 1 candidates)
    │   ├── edge/
    │   ├── med/
    │   ├── terra/
    │   └── realty/
    ├── decisions/     # NEW — every empire design call, links the patterns that drove it
    ├── verticals/     # one page per vertical — rolled-up state
    ├── concepts/      # cross-cutting concepts (e.g. "WhatsApp 24hr window")
    ├── analyses/      # "Layer 1 v2 readiness," etc.
    └── meta/

POPIA-safe extraction (the load-bearing rule): tenant data NEVER leaves the tenant brain. Only PATTERNS derived from tenant data move. The Pattern Extractor agent reads tenant brains weekly and produces anonymised observations (no names, no exact numbers, bucketed counts). Niki audits every draft before it lands.

Layer 1 promotion gate: when a pattern shows up in patterns/universal/ from 3+ tenants × 2+ verticals, Niki proposes a Layer 1 change. Captain signs off. Decision lands as a dated decisions/ page that supersedes the previous version.

Worked example: an Edge tenant hits the WhatsApp 24-hour reply-window stall (queue stalls Monday morning, costs R380/mo extra). Three Edge tenants show the same pattern → universal pattern landed → Layer 1 readiness proposes the Customer Care agent track reply-window expiry per channel. By the time Med Layer 2 is designed 90 days later, the Med WhatsApp Portal inherits this fix from day one — no doctor pays the R380 lesson Edge already paid for.

The Top 3 Risks (honest)

Specialists explicitly told to be brutal:

  1. Captain burnout / day-job collision (severity 5 × probability 4 = 20). Concierge is high-touch. Day job + 5 clients + dogfooding 10 brands = three full-time jobs. Mitigation: hard cap 5 concierge clients before quitting day job; document Niki vs Captain responder boundary; build “Captain offline 7 days” runbook before client #2.

  2. Concierge customer concentration collapse (5 × 4 = 20). Lose 2 of first 5 → MRR drops 40% overnight, BYOK build stalls. Mitigation: don’t take 5 in 90 days — take 3, stabilise, then 4. First client (the R6k Flow concierge client) is safe; pick next 2 from same industry before going cross-sector.

  3. Edge learnings DON’T transfer to Med/Terra/Realty (4 × 4 = 16). Agency buyers ≠ medical/farm/realty buyers. Mitigation: Edge is the cashflow product; Med/Terra/Realty are PARALLEL R&D efforts that share infra, not natural extensions. Recruit 1 GP, 1 farmer, 1 estate agent as concierge clients EARLY to test transfer per vertical.

Specialists’ single most underrated risk: the 8 universal agents + markdown-brain decision is locked in too early based on Richards Brain (n=1, Captain himself). Markdown has no concurrency model, no enforced schema, no row-level security. By the time these constraints are visibly wrong with 5+ tenants running, migrating is a 3-month engineering project nobody is paying for. Treat both as tentative for the first 3 paying clients; write down explicit kill criteria.

The 5 De-Risk Experiments (do these in months 1-6)

  1. Recruit ONE practising doctor as concierge client #2 or #3 — onboard them using ONLY the 8 Layer 1 agents, no Med-specific Layer 2. Document every gap they hit in 30 days. Those gaps ARE the Med Layer 2 spec, derived from real signal.
  2. Hard ceiling at 5 concierge clients for first 6 months. Use slack hours for pattern-spotting + Niki/agent automation, NOT for selling more.
  3. Build a vertical-fit scorecard before Med/Terra/Realty start. Score each candidate vertical on (a) buyer similarity to Edge buyers, (b) regulatory load fit, (c) practitioner-partner availability. Any “no” → vertical is parked.
  4. Month 4 founder-transfer test. Take Captain’s most painful workflow (e.g. cross-posting clip approvals across 10 brands), sell it as a STANDALONE product to a stage-2 client. If transfer is clean → dogfood-to-product pipeline works. If it’s a slog → architecture has more friction than it appears.
  5. Set kill criteria for the markdown-brain + 8-agent assumptions IN WRITING NOW — e.g. “if any tenant brain experiences a write conflict in production OR if any Med pilot reveals 50%+ of its needs aren’t covered by Layer 1, revisit foundations.”

Verdict (specialist consensus)

The plan is correct in shape. Dogfood → sell → package is the most reliable platform-business pattern in software history. It’s stronger than v3.2 framed it (Edge is the discovery engine for the empire, not just the first vertical).

Updates locked into v3.3:

  1. Edge re-framed from “first vertical configuration” to “platform foundation + adjacent-vertical discovery engine.”
  2. Each new vertical needs its own dogfood proxy (a real practising doctor / farmer / estate agent willing to be paying client #1 in their domain). The 8-agent Layer 1 is universal; everything else needs its own dogfood signal.
  3. The Meta-Brain is an explicit, shipped artefact — not a metaphor. Vault scaffolded at /opt/claude-workspace/projects/yba-meta-brain/ when Edge stage 2 starts.
  4. Gates replace timelines. Captain’s monthly review meeting checks gate dashboards, not calendar dates.

Captain’s confirmation (2026-05-02 evening): “yes i intend to have a real client using YBA edge to help us build industry specific solutions.” This locks in #2 above as Captain’s stated strategy, not just specialist advice. Med Layer 2 launch (Gate 4) is contingent on a real GP signing as concierge client + design partner. Terra and Realty plans don’t start until each has its own practitioner-client lined up.


Pending Vision Documents

Captain will provide visions for YBA Terra (and possibly Realty) next. v4 of the architecture will integrate those — and each gets its own Layer 2 specialist sweep just like Med got today. Med Layer 2 is the template; Terra/Realty get their own 5 teams sized to their domain.

— Synthesised by Niki on 2026-05-02 from 5 parallel specialist sweeps with Captain’s Flow vision baked in.