Toast AI — Architecture Map

Interactive reference for how everything connects. Click folders to expand/collapse.

Auto-generated from git repository structure. Last built:

Local Files
GitHub Repos
Cloud Services
Data Flow
Google Docs
Folder
Context (CLAUDE.md)
Memory
Skill
Code / Config
Repo / Folder
Context (CLAUDE.md)
Code / Config

Railway

Hosts toast-ai-ops. Auto-deploys from GitHub main branch. Runs 24/7.

toast-ai-ops-production.up.railway.app

Supabase

Operational database. Threads, drafts, events, feedback, auto-learned rules, finance data.

Project: lpdokiygbjhowfasesqi

HubSpot

Source of truth for ALL business data. 23 objects, 4,591+ properties.

Portal 5708986 · Private App for custom objects

Claude API (Haiku)

Powers all AI features in production — email drafting, classification, distillation, sidebar commands.

Gmail API

OAuth-connected. Monitors inboxes, creates drafts, detects outcomes.

Active: zachary@toastweddings.com

GCP Secret Manager

All API keys and tokens. Railway loads at startup.

toastweddingfilms-737df

Google Docs (Rules)

Live communication rules read at runtime via Apps Script proxy.

Apps Script Proxy

Bridge between Railway and Google Docs. No code changes needed to update rules.

GitHub

4 repos. Push to main deploys to Railway. Actions sync docs and build this map.

Email comes in

Gmail API

Scheduler polls every 5 min

Classify & gather context

HubSpot API

Contact, deal, project, engagements, line items

Google Doc Rules

Brand voice, pricing, draft rules

Supabase draft_rules

7 auto-learned rules

Generate draft

Claude Haiku

Rules + learned rules + CRM context → draft reply

Draft posted for review (never auto-sent)

Gmail Draft / HubSpot Comment

Team reviews, edits, sends or deletes

Auto-learning loop

Outcome Detection (10 min)

Sent → +0.1 · Deleted → -0.15 · Refined → highest signal

Nightly Distillation (2 AM)

Analyze outcomes → extract rules → store in Supabase

↑ feeds back into next draft ↑

Company & Department Context (synced from toast-ai-context repo)

Toast AI - Company Guidelines

AUTO-SYNCED

Global context: who you are, tech stack, team, folder structure. Source: company/CLAUDE.md

Toast AI - Sales

AUTO-SYNCED

Sales agent context. Source: departments/sales/CLAUDE.md

Toast AI - Operations

AUTO-SYNCED

Operations agent context. Source: departments/operations/CLAUDE.md

Toast AI - Post-Production

AUTO-SYNCED

Post-production agent context. Source: departments/post-production/CLAUDE.md

Toast AI - Finance

AUTO-SYNCED

Finance agent context. Source: departments/finance/CLAUDE.md

Toast AI - Marketing

AUTO-SYNCED

Marketing agent context. Source: departments/marketing/CLAUDE.md

Toast AI - Talent

AUTO-SYNCED

Talent agent context. Source: departments/talent/CLAUDE.md

Toast AI - Vendors

AUTO-SYNCED

Vendor agent context. Source: departments/vendors/CLAUDE.md

Code Project Context (synced from individual project repos)

Toast AI - Ops CLAUDE.md

AUTO-SYNCED

Full technical reference. Source: toast-ai-ops/CLAUDE.md

Toast AI - Ops Guidelines

AUTO-SYNCED

Development philosophy (10 rules). Source: toast-ai-ops/GUIDELINES.md

Toast AI - Finance App

AUTO-SYNCED

Finance dashboard context. Source: toast-finance-app/CLAUDE.md

Toast AI - Pricing App

AUTO-SYNCED

Package builder context. Source: toast-pricing-refinement-app/CLAUDE.md

Runtime (manually maintained)

Toast AI - Live Communication Rules

LIVE — READ AT RUNTIME

Brand voice, pricing, exclusion rules, draft instructions, urgency signals, tier classification. Edits take effect immediately via Apps Script proxy.