# AI Training — Full Series Overview

**Purpose:** the orientation document for the monthly AI training series. Read it before Session 1, or use it as the 10-minute opening.
**Audience:** team, strategic partners, and the public.
**Last updated:** 2026-10-26
**Running the AI training?** Start with the live page: https://www.resonancetunes.com/training/#setup — it has the four steps, the DeepSeek key, and the `/connect` flow. This file is a deeper reference.

**Program calendar:** `docs/ai-training-sessions.md`
**Session 1 handout:** `docs/ai-training-session-1-handout.md`
**Living notes:** `docs/ai-training-session-notes.md`

---

## 1. Why this series exists

Most AI advice is either a demo of something you will never build, or a pitch for a tool you do not need.

This series is the third thing: the actual system we use to run Resonance Tunes. Not the theory. The setup, the failures, the workarounds, and the parts that still annoy us.

We are a small company. We use AI across operations, marketing, product, research, finance, grants, and care. The hard part was never the model. The hard part was **access** — getting the AI safely into the systems where the work already lives.

So the series teaches the system, not the tool. One idea, one live build, one action per session.

**The funnel, stated plainly.** The session is genuinely useful on its own; that is the point. Every document we hand out — the invite, the calendar description, this overview, the handout, the recording notes — ends with the same single CTA (`www.resonancetunes.com`) and the same single ask: try one task, then tell us what happened. The path is: free session → recording + notes → one task tried → Seeker or Collective intake. No pricing, no pitch, never `/partner`, never Artizen.

**Registration** is native at `www.resonancetunes.com/training/` — one form for sessions and one for youth-session interest, with PostHog events `training_registered` and `youth_interest_registered`. No third-party form tool.

---

## 2. The thesis in five lines

1. **One brain, two hands.** opencode runs operations. Claude runs the product and the voice. They hand off through docs, not through chat.
2. **Context is the asset.** Write it once — in a repo, a prompt queue, a brief — and reference it. Never re-paste it into every conversation.
3. **Route by task.** Premium model for judgment. Cheap model for plumbing. Local model for privacy.
4. **Access is the bottleneck.** OAuth, scopes, keys, rate limits, webhooks, and developer consoles take more time than the prompt.
5. **Ethics is the moat.** Local models, consent, anonymization, EU hosting. Not a compliance layer — the product.

---

## 3. The system map

```
INPUTS
  voice memos · meetings · forms · email · social · transcripts · Google Drive

CAPTURE
  Fathom / Read.ai · Resonance Lens · GLASP · rclone · Supabase forms

CONTEXT
  repo docs (AGENTS.md, specs) · shared prompt queue · session notes · second brain

AGENTS
  opencode (DeepSeek Flash) · Claude (product/copy) · local Mistral · subagents

AUTOMATION
  n8n · cron · systemd · Python scripts · webhooks

SYSTEMS OF RECORD
  Supabase EU · EspoCRM · Brevo · Baserow · Stripe · PostHog / Plausible

OUTPUTS
  portal pages · email · LinkedIn / Facebook · reports · grant packets · games

GUARDRAILS
  secrets in env vars · consent · a strict no-email list · a three-email cap · human review gates
```

The point of the map: no single tool is the system. The system is the **handoffs**.

---

## 4. What we have built (by layer)

| Layer | What it does | Tools | Status |
|---|---|---|---|
| **Portal / product** | 108+ pages, auth, tiers, paywalls, readings, games | HTML/JS, Supabase EU, Stripe | Live |
| **Resonance Lens** | Meeting intelligence: inclusion signals, anonymized training suggestions | FastAPI, transcript pipeline, LLM | Live, iterating |
| **ReWeave** | Diagnostic runner game; writes assessments with `intake_mode: game` | Godot 4.3, WebGL, Supabase | Live prototype |
| **AI Companion** | Floating chat on portal pages; tier-limited | Groq + Ollama fallback | Live |
| **Operations** | Servers, deploys, cron, systemd, nginx, Docker | opencode, SSH, Python | Live |
| **Marketing automation** | Content queue, AI rewrite, image generation, direct publishing | n8n, Baserow, Brevo, LinkedIn API, Facebook Graph API | Live, fragile |
| **Email** | Welcome, nurture, reports, and updates | Brevo, n8n, Python | Live, rules-heavy |
| **CRM** | Leads, pipeline, segmentation | EspoCRM, Brevo | Live |
| **Analytics** | Traffic, events, funnels, traction | PostHog, Plausible, CSP collector | Live |
| **Research** | Web research, transcripts, source checking | Tavily, GLASP, opencode | Live |
| **Agents** | Grants, residencies, job search, wealth, QA, social watching | OpenClaw + DeepSeek | Live |
| **Images** | Social images with provider fallback | 8-provider image agent | Live |
| **Files** | Google Drive / Photos sync without paid connectors | rclone | Live |
| **Finance** | Banking, Stripe, accounting | Rho, Mercury, Stripe, Odoo (planned) | Partial |

Honest status matters. "Live" does not mean "finished." It means "running and observed."

### 4.1 What we learned wiring PostHog

- **One shared tracker, not 155 snippets.** `rt-track.js` is loaded everywhere; adding an event once reaches every page. Copy-pasted snippets drift and collide.
- **Server-side capture for the events the browser cannot see.** Email opens/clicks come from Brevo through `rt_report_pipeline.py`; payment comes from the Stripe webhook. Those are the source of truth, not the thank-you page.
- **Identity merge matters.** Email events were keyed by email; portal sessions were keyed by `user_id`. Without a lookup, the same person looks like two people. We resolve email → `users.id` before capture for existing users.
- **Headless tests are filtered as bots.** The event can be wired perfectly and still not appear from Playwright. Test the invocation; verify ingestion in a real browser.
- **Cache-busting is part of the work.** A shared `/assets/*.js` file lives in browsers for a week. If you do not bump `?v=`, the old file keeps running and the new event never fires.
- **Event names are a product decision.** `assessment_started/completed` and `interpretation_started/viewed` are not interchangeable. Pick the canonical funnel before you backfill every tool.

---

## 5. The marketing system — n8n and the direct-API turn

### The flow

```
Archive / CSV / Baserow content queue
        │
        ▼
n8n: content repurpose + batch captions
        │
        ▼
AI rewrite (Groq free tier → DeepSeek → Ollama fallback)
        │
        ▼
Image agent (8 providers, automatic fallback)
        │
        ▼
Baserow: Ready / Pending
        │
        ├──► LinkedIn direct publisher  → LinkedIn API
        └──► Facebook direct poster     → Graph API
        │
        ▼
PostHog / Plausible → weekly recap → watchdog
```

### What is actually true

- **LinkedIn does not use Postiz.** The current publisher is `/root/li_direct_post.py`, reading `LinkedIn` + `Ready` rows from Baserow. It publishes directly to the LinkedIn API.
- **Facebook has two paths.** The n8n workflow reads `Ready` rows; `/root/rt-scripts/fb_daily_post.py` reads `Pending` rows. Both are active and post different queues.
- **Content cycles from a durable library.** The 588-line content CSV is the fallback that never runs dry. The queue refill runs weekly.
- **AI is not in the posting path.** Posts are pre-written and approved. AI drafts offline; it does not generate at post time.
- **A watchdog checks queue depth, image quality, posting windows, and token expiry.** It emails when a platform drops below five ready posts.
- **Email is rules-heavy.** One validated Brevo sender. A 201 response is not proof of delivery. No re-sends. One email per address per UTC day. Max three promotional emails, plus the one-hour reminder. Some contacts are never auto-emailed; a strict no-email list is enforced in every sender.
- **CRM is the segmentation layer.** Individual subscribers and org subscribers are separate buckets. Team access flows through the shared automation and the AI agent.

### What broke and what changed

| Failure | What happened | Rule now |
|---|---|---|
| Postiz LinkedIn token expired | 60-day token, no refresh; posts queued silently | Direct publisher; check expiry; require a returned post ID |
| AI content generators died together | One API balance ran out; every workflow failed | Multi-provider fallback (Groq → DeepSeek → Ollama) |
| Empty queue looked like success | Workflow exited in 0.7 seconds with 0 rows | Queue-depth alert; watchdog |
| Duplicate Facebook posts | Two posting paths, same content | Separate queues; `Posted_At` written on success |
| Brevo "sent" but not delivered | HTTP 201 with an unvalidated sender | Verify sender + delivery events; never trust 201 |
| Posts contained `/partner` | 413 legacy rows and generators | Publish-time sanitizer; CTA is always `www.resonancetunes.com` |

---

## 6. The API problem — the honest section

> "The hardest piece is getting the AI access to the different systems. Once it has access, it works seamlessly."

That sentence is the whole series. Access is 80% of the work. The prompt is 20%.

### What makes it annoying

| Pain | What actually happened | What we do now |
|---|---|---|
| **OAuth token expiry** | Postiz LinkedIn token lived 60 days, had no refresh token, and failed silently | Direct API; request `offline_access`; check expiry inside the posting script |
| **Platform OAuth** | YouTube token expired; no auto-refresh | Refresh token + expiry check + watchdog |
| **Developer consoles** | Meta, Google, Stripe, LinkedIn each have their own app, scope, and review flow | Document the setup once; use the narrowest scope that works |
| **API keys and balance** | Zhipu balance ran out; every AI-dependent workflow died | Provider fallback; spend alerts; never one provider |
| **Webhooks** | Stripe endpoint registration unconfirmed; events can silently miss | Register, verify signatures, test one live event, log failures |
| **Rate limits** | Free tiers throttle batch work | Queue, backoff, provider cycling |
| **Auth headers** | Baserow nodes missing the auth header; data loss | Shared client; test one record before a batch |
| **False success** | HTTP 200/201 does not mean delivered or published | Read back the object; require an ID or a delivery event |
| **Secrets in code** | Keys discoverable in repos and configs | Env vars or auth screen; rotate if publicly exposed |
| **Bot detection and CAPTCHA** | Some job platforms block automation | Do not bypass. Human packet or skip the platform |
| **Sandbox vs production** | Test keys and live keys get mixed | Separate projects and keys; label them |
| **DNS / nginx / SSL** | A new subdomain in CSP without DNS or a cert | Checklist: DNS + nginx + SSL before any new subdomain |
| **File access** | Google Drive API approval is slow | `rclone` for Drive/Photos; local files for the AI |

### The 10-step checklist for connecting any new system

1. Decide: direct API, open-source connector, or middleware.
2. Create a dedicated app/project — never reuse a personal login.
3. Request the **least-privilege scopes**, plus `offline_access` if you need refresh.
4. Store the secret in an env var or a secret manager. Never commit it.
5. Test in a sandbox with one record.
6. Register webhooks and verify signatures.
7. Handle rate limits with backoff and a queue.
8. Verify success by **reading the object back**, not by the status code.
9. Add an expiry check and a watchdog.
10. Document the setup in the repo so the next person does not repeat it.

**Rule of thumb:** if the integration has no "last successful run" check, it is not done.

### 6.1 The first connection, written out: DeepSeek → opencode

Same account as the free chat, **separate prepaid wallet.** The chat at `chat.deepseek.com` is free. The API bills per token from its own balance. Topping up the API does not change the chat, and using the chat does not add API credit.

1. Sign in at `https://platform.deepseek.com` — your chat login usually works; if not, sign up with the same email.
2. **Top up:** left sidebar → **Top up** (or **Billing**) → **$10**. A light month is $5–$20. With no balance, every call returns `Insufficient Balance` even when the key is valid.
3. **Create the key:** left sidebar → **API Keys** → **Create new API key** → name it for the device → copy it immediately (`sk-...`, shown once).
4. **Save a copy** in a password manager, then add it to opencode with `/connect`.
5. **Connect:** Terminal → `opencode` → `/connect` → **DeepSeek** → paste the key.
6. **Verify:** `/models` → pick the listed DeepSeek Flash entry → ask one short question. A reply proves the key and the balance.
7. **If it fails:** `Insufficient Balance` means top up; an auth error means re-copy or create a new key; `Model not found` means pick the listed ID from `/models`.
8. **One key per person and device.** A key is money; revoke it if a laptop is lost or the key is exposed.

---

## 7. The 13-session arc

| # | Date | Session | The promise |
|---|---|---|---|
| 1 | **Wed 18 Nov 2026** | **One Brain, Two Hands** | Which AI to ask for what, and one task you can hand off |
| 2 | Wed 16 Dec | **Connect Your World** | Your files, Drive, and a single prompt queue |
| 3 | Wed 20 Jan 2027 | **Cheap by Design** | Premium vs cheap vs local; stop paying for the wrong model |
| 4 | Wed 17 Feb | **From Meeting to Motion** | Transcript → tasks, CRM update, and draft content |
| 5 | Wed 17 Mar | **Research Without Hallucination** | Sources, search, and what "verified" means |
| 6 | Wed 21 Apr | **Marketing on Autopilot** | Voice memo → caption → image → scheduled post, without losing your voice |
| 7 | Wed 19 May | **Your Second Brain** | Obsidian + archive: teach the AI how you think |
| 8 | Wed 16 Jun | **From Prompt to Offer** | Turn a workflow into something people buy |
| 9 | Wed 21 Jul | **Games as Inner Work** | Text-to-game and youth sessions |
| 10 | Wed 18 Aug | **The Ethical AI Stack** | Local models, consent, data sovereignty |
| 11 | Wed 15 Sep | **Team Weather** | See collective patterns without surveilling people |
| 12 | Wed 20 Oct | **Vibe Coding Clinic** | Bring an idea; leave with a working tool. No code degree required |
| 13 | Wed 17 Nov 2027 | **One Year of AI** | What worked, what broke, the year-two stack |

### The four arcs

- **Foundations (Nov–Jan):** two hands → connect your world → cheap by design.
- **Capture and research (Feb–Mar):** meeting to motion → research without hallucination.
- **Marketing and voice (Apr–May):** automation → second brain.
- **Product and ethics (Jun–Oct):** offer → games → ethical stack → team weather → clinic → year one.

---

## 8. Topic index — everything from the transcript

This is the full map. Some topics are a whole session; some are a segment; some are a live build.

| Topic | Where it lives | Status |
|---|---|---|
| Agentic AI vs chat AI | Session 1 | Taught |
| Choosing tools and installing them | Session 1 handout | Taught |
| opencode vs Claude | Session 1 | Taught |
| DeepSeek Flash / model routing | Session 1, Session 3 | Taught |
| Local models / Mistral / Ollama | Session 1, Session 10 | Taught |
| Token and cost discipline | Session 1, Session 3 | Taught |
| Shared prompt queue / Notion board | Session 1, Session 2 | Taught |
| Google Drive / rclone / files | Session 2 | Demoed |
| Tavily research / source checking | Session 5 | Demoed |
| Meeting capture / Fathom / Read.ai | Session 4 | Demoed |
| Resonance Lens | Session 4 | Demoed |
| Voice memos / transcripts | Session 4 | Demoed |
| GLASP / YouTube transcripts | Session 5 | Demoed |
| Second brain / voice corpus | Session 7 | Taught |
| n8n automation | Session 6 | Taught |
| Brevo email | Session 6 | Taught |
| EspoCRM / lead pipeline | Session 6 | Taught |
| Baserow content queue | Session 6 | Taught |
| Direct LinkedIn / Facebook publishing | Session 6 | Taught |
| AI image generation | Session 6 | Demoed |
| Stripe / payments | Session 8 | Mentioned |
| Pricing / freemium | Session 8 | Taught |
| Sales / lead generation | Session 8 | Taught |
| Grants / fundraising agents | Series Q&A | Mentioned |
| Job-hunter / residency / wealth agents | Series Q&A | Mentioned |
| ReWeave / Godot | Session 9 | Demoed |
| Text-to-game / Meta / Rosebud | Session 9 | Demoed |
| Personalization / learning styles | Session 11 | Taught |
| Human Design / authority | Session 11 | Taught |
| Ethical AI / consent / EU hosting | Session 10 | Taught |
| Team diagnostics / Group Weather | Session 11 | Taught |
| AI Companion | Session 12 | Demoed |
| API access / OAuth / webhooks | Every session; Session 6 deep dive | Taught |

If a topic is not on the calendar yet, it belongs in the "Vibe Coding Clinic" or the year-two plan.

---

## 9. How we work together

| Who | Owns | Does not own |
|---|---|---|
| **Founder / teaching** | Vision, product, teaching, final voice, partnerships | Server plumbing, routine deploys |
| **Operations lead** | Ops, sales, marketing, team, promotion | Portal code |
| **Finance lead** | Finance model, fundraising, use of funds | Product code |
| **Product lead** | Product design, Resonance Lens direction | Server ops |
| **Claude** | Portal HTML/CSS/JS, brand copy, paywalls, frontend tier checks | Servers, n8n, CRM, email plumbing |
| **opencode** | Servers, n8n, Python, Supabase edge, CRM, email, research, automations | Portal HTML, Claude's files |
| **Agents** | Grants, residencies, job search, wealth, QA, social watching | Final human judgment |

**Handoff rules that keep it sane**

1. One living doc per topic. Git history is the changelog.
2. Claude cannot read this repo. If a doc is for Claude, paste the content or upload the file.
3. Never edit Claude's files (`Claude/`). Flag errors instead.
4. Never delete a file you did not create. Move it first; confirm later.
5. Never hardcode a fix for one person. It must work for the next 100 users.
6. Verify before "done." A status code is not a result.

---

## 10. Guardrails

- **Secrets:** no API keys on screen, in slides, or in public docs. Give them to the AI through its auth screen; rotate if exposed.
- **Data:** demo contacts and a sandbox repo only. Never show a real client, investor, CRM, or personnel record.
- **Email:** max three promotional emails per person per campaign, plus the one-hour reminder. No re-sends. Never auto-email investors or funders.
- **CTA:** `www.resonancetunes.com` only. Never `/partner`. Never Artizen.
- **Consent:** state that the session is recorded at the start. Stop recording for sensitive Q&A.
- **Claims:** show what we actually run. No invented capabilities, no invented dates, no invented prices.
- **Access:** do not bypass CAPTCHA, bot detection, or OAuth walls. Use a human packet instead.

---

## 11. The 10-minute opening for Session 1

Use this as spoken notes, not a script to read word for word.

**0:00 — The problem**
"Most AI advice is either a demo of something you'll never build, or a pitch for a tool you don't need. We're going to do the third thing: show you the actual system we use to run a small company."

**0:01 — The two hands**
"We run with two AI teammates. opencode holds operations: files, servers, scripts, research, automation. Claude holds the product: portal, brand copy, architecture, final synthesis. They hand off through documents, not through chat."

**0:03 — The real bottleneck**
"The hard part was not the model. It was access. OAuth tokens expire. Developer consoles are a maze. A 201 response can mean nothing. Most of our time went into access, not prompts. That is what this series is really about."

**0:05 — The map**
Show the system map. "Inputs, capture, context, agents, automation, systems of record, outputs. No single tool is the system. The handoffs are the system."

**0:07 — The series**
"Once a month, 45 minutes, one idea and one live build. Foundations first: two hands, connect your world, cheap by design. Then capture, research, marketing, voice, product, ethics."

**0:09 — The action**
"Before you leave, write down the one task you keep doing by hand. Ask your AI to do only that. Don't automate the whole workflow yet."

**0:10 — Close**
"Recording and notes go to everyone who registered. Next session: Connect Your World, 16 December."

---

## 12. How to use this document

- Read it before Session 1.
- Use §11 as the opening.
- Use §5 and §6 when someone asks, "Why is this so hard?" or "Why don't we just use Zapier?"
- Update it in place when the stack changes.
- Link it from the program doc, the handout, and the partner page.
- For the operational detail behind the system map, read `docs/opencode-how-it-works.md`.
- For an operator setup, use `docs/opencode-coo-bootstrap.md` and `scripts/opencode-coo-check.sh`.
