# The Ultimate System — Architecture

## Overview
One brain (Rivet), multiple specialist sub-agents, four subsystems.

```
MICHAEL (Telegram)
    ↓
RIVET (Main Brain — Opus/Sonnet)
├── Routes, decides, orchestrates
├── Memory system (hybrid search + session indexing)
├── Spawns specialist agents as needed
    ↓
┌─────────────────────────────────────────┐
│ SUBSYSTEM 1: SALES (Growth Engine)      │
│ Status: BUILT (paused for pivot)        │
│ - Lead scraping (nightly cron)          │
│ - CRM / lead management                │
│ - SMS outreach sequences               │
│ - AI intel briefs per lead              │
│ - Dashboard / analytics                │
│ Needs: New messaging for $50 model     │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ SUBSYSTEM 2: MARKETING (Content Engine) │
│ Status: PLANNING                        │
│ - LinkedIn content pipeline             │
│ - Site content / blog posts             │
│ - Case studies from activity            │
│ - Photo → post pipeline                │
│ - Competitor monitoring → content ideas │
│ - SEO / keyword tracking               │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ SUBSYSTEM 3: MEMORY (Knowledge Layer)   │
│ Status: LIVE ✅                          │
│ - Topic-based memory files              │
│ - Hybrid search (vector + BM25)         │
│ - Session transcript indexing           │
│ - Embedding cache (50k entries)         │
│ - Daily consolidation cron (1am AEST)   │
│ - Notion as structured knowledge base   │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ SUBSYSTEM 4: PERSONAL ASSISTANT         │
│ Status: PLANNED (detailed plan ready)   │
│ - Calendar/schedule management          │
│ - Gym tracking with progression logic   │
│ - Weather intelligence & alerts         │
│ - Smart reminders (respects schedule)   │
│ - Life admin (bills, appointments)      │
│ - Health tracking (sleep, hydration)    │
│ - 3-week implementation plan available  │
│ - See: memory/plans/personal-layer-plan.md │
└─────────────────────────────────────────┘
```

## Agent Roles (spawned on demand via sessions_spawn)
| Role | Model | When Spawned |
|------|-------|-------------|
| Research | DeepSeek | Lead enrichment, market research, competitor analysis |
| Content | DeepSeek | Draft posts, blog content, case studies |
| Analysis | DeepSeek | Data crunching, cost analysis, reports |
| Memory | DeepSeek | Nightly consolidation, knowledge organization |
| Ops | DeepSeek | System monitoring, health checks, git ops |

## Cron Schedule (UTC → AEST)
| Job | UTC | AEST | Purpose |
|-----|-----|------|---------|
| memory-consolidation | 14:00 | 01:00 | Consolidate daily logs → topic files |
| nightly-routine | 16:00 | 03:00 | Lead scraping, competitor scan |
| morning-brief | 18:00 | 05:00 | Daily brief to Michael |
| evening-brief | 07:00 | 18:00 | End-of-day summary |
| weekly-review | Sun 20:00 | Mon 07:00 | Week review + recommendations |
| monthly-review | 1st 16:00 | 2nd 03:00 | Month analysis + cost review |

## Memory Architecture
```
MEMORY.md                    ← Curated high-level learnings
memory/
├── YYYY-MM-DD.md           ← Daily raw logs
├── topics/
│   ├── business.md         ← RateRight knowledge
│   ├── michael.md          ← Preferences, patterns
│   ├── technical.md        ← System/platform knowledge
│   └── personal.md         ← Non-business stuff
├── nightly-scan.md         ← Latest lead/industry scan
├── fresh-leads.json        ← Current lead pipeline
└── heartbeat-state.json    ← Monitoring state
```

## Build Progress
- [x] Phase 1: Memory upgrade (topic files, hybrid search, session indexing, consolidation cron)
- [ ] Phase 2: Content Engine (LinkedIn pipeline, photo→post, SEO)
- [x] Phase 3: Personal Assistant layer **PLANNED** (detailed plan ready)
- [ ] Phase 4: Sales reactivation (new $50 model messaging)

**Personal Assistant Plan:** Complete 3-week implementation plan created. Ready to start building when Michael approves. See `memory/plans/personal-layer-plan.md`.

*Created: 2026-02-04*
