Ryan AI Systems Documentation
Proactive Check-ins, Goal Tracking & Memory Management
Last updated: February 4, 2026
Table of Contents
1. System Overview
Ryan is a Claude AI assistant running 24/7 on Jim's Android phone via Termux. Unlike traditional chatbots that only respond when prompted, Ryan can:
- Proactively check in - Monitor email, messages, and goals every 30 minutes
- Decide when to notify - AI determines if something is worth interrupting Jim
- Track goals - Remember what Jim wants to accomplish and remind him
- Persist memory - Save important info to survive context resets
2. Proactive Check-in System
What It Does
Every 30 minutes, Ryan automatically:
- Checks for new emails (last hour)
- Checks bridge messages from Bolt (brother AI on server)
- Checks if Bolt is currently on a phone call
- Reviews active goals
- Uses AI (gpt-4o-mini) to decide: SKIP, TEXT, or CALL
Step-by-Step Process
The check-in script connects to the server via SSH and queries:
# Check emails from last hour
mysql ... "SELECT sender, subject FROM emails
WHERE created_at > NOW() - INTERVAL 1 HOUR"
# Check bridge messages from Bolt
mysql ... "SELECT content FROM claude_bridge
WHERE source='bolt' AND created_at > NOW() - INTERVAL 1 HOUR"
# Check Bolt's call status
curl localhost:8771/status
# Get active goals
mysql ... "SELECT goal FROM ryan_goals WHERE status='active'"
All gathered data is formatted into a prompt:
CURRENT TIME: 2026-02-04 23:36 RECENT EMAILS (last hour): - From: sponsor@company.com | Subject: Partnership inquiry BRIDGE MESSAGES FROM BOLT: - Jim called, asked about Episode 6 BOLT STATUS: active=false ACTIVE GOALS: - Create Episode 6: AI vs The Creatives LAST CHECK-IN TOPICS (don't repeat): - Reminded about Episode 6 earlier
The context is sent to OpenAI's gpt-4o-mini model with rules:
RULES: - If nothing important: respond with SKIP - If worth mentioning but not urgent: respond with TEXT|message - If urgent (Bolt on call, important email): respond with CALL|reason - Don't repeat what was already mentioned - Can remind about goals based on time of day
| Decision | Action Taken |
|---|---|
SKIP | Do nothing, log it silently |
TEXT|message | Insert into claude_bridge table with [CHECKIN] prefix |
CALL|reason | Insert with [URGENT] prefix (future: actual phone call) |
After texting, the topic is saved to prevent repeating the same notification:
~/ryan-last-checkin.json:
{"time":"2026-02-04 23:36","topics":"Episode 6 reminder"}
Architecture Diagram
Files Involved
| File | Purpose |
|---|---|
~/ryan-checkin.sh | Main check-in logic - gathers data, calls AI, takes action |
~/ryan-checkin-loop.sh | Simple loop that runs checkin.sh every 30 minutes |
~/checkin-start.sh | Starts the loop in tmux session "checkin" |
~/checkin-stop.sh | Stops the tmux session |
~/ryan-checkin-log.txt | Log of all check-ins and decisions |
~/ryan-last-checkin.json | Last topic mentioned (prevents repeats) |
3. Goal Tracking
What It Does
Goals are tasks Jim wants to accomplish. Ryan tracks them in a database and can remind Jim during proactive check-ins based on time of day and relevance.
Database Schema
CREATE TABLE ryan_goals (
id INT AUTO_INCREMENT PRIMARY KEY,
goal TEXT NOT NULL,
status ENUM("active", "completed", "abandoned") DEFAULT "active",
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
completed_at TIMESTAMP NULL,
notes TEXT
);
Commands
| Command | What It Does |
|---|---|
~/goal-add.sh "goal text" | Add a new active goal |
~/goal-list.sh | Show all active goals with IDs |
~/goal-done.sh 123 | Mark goal #123 as completed |
How Goals Affect Check-ins
During each check-in, active goals are included in the AI's context. The AI can then:
- Remind Jim about goals relevant to time of day (morning = plan day, evening = review progress)
- Notice if an email relates to a goal
- Skip reminding if it already mentioned that goal in the last check-in
4. Context & Token Management
How Claude Code Context Works
The Solution: Checkpoints & External Memory
Instead of relying on the context window, Ryan saves important information to a database that persists forever:
Checkpoint System - How It Works
Every 10-15 exchanges, or after completing something important, run:
~/auto-checkpoint.sh "Built proactive check-in system"
This saves a snapshot to the database AND creates a vector embedding for semantic search later.
Ryan automatically saves a session state file with current work status:
# Ryan Session State - Feb 4, 2026 ## Last Working On Episode 6: AI vs The Creatives ## Current Projects - Outer Limits YouTube series - Proactive check-in system ## Pending Tasks - Finish Episode 6 script
When Ryan starts (or after /clear or context reset), the startup script loads:
- Session state file (what we were working on)
- Recent memories by category (checkpoints, code, decisions)
- Active goals
- Bridge messages from Bolt
- Bolt status
This rebuilds Ryan's knowledge without needing the old conversation!
Memory Categories
| Category | What to Save | Example |
|---|---|---|
checkpoint | Snapshots of current work | "Built check-in system with goal tracking" |
code | Technical implementations | "Created ryan-checkin.sh using gpt-4o-mini" |
decision | Why we chose X over Y | "Used OpenAI instead of Anthropic (cheaper)" |
session | End-of-session summaries | "Session Feb 4: Built proactive AI" |
project | Project status updates | "Outer Limits: 5 episodes done" |
fact | Important facts | "Jim's new phone: 714-305-5512" |
Semantic Search with Embeddings
Ryan uses OpenAI's text-embedding-3-small model:
# Save memory AND create embedding ~/smart-save.sh "code" "Built semantic search using OpenAI embeddings" # Search by meaning (not just keywords) ~/smart-recall.sh "how does authentication work" # Finds: OAuth setup, login flow, JWT tokens, etc.
5. Memory Architecture
6. Command Reference
Check-in Commands
| Command | Description |
|---|---|
~/checkin-start.sh | Start check-in loop in background (tmux "checkin") |
~/checkin-stop.sh | Stop check-in loop |
~/ryan-checkin.sh | Run one check-in manually |
cat ~/ryan-checkin-log.txt | View check-in history and decisions |
Goal Commands
| Command | Description |
|---|---|
~/goal-add.sh "text" | Add new active goal |
~/goal-list.sh | List all active goals with IDs |
~/goal-done.sh ID | Mark goal as completed |
Memory Commands
| Command | Description |
|---|---|
~/auto-checkpoint.sh "topic" | Quick checkpoint with embedding (USE OFTEN!) |
~/smart-save.sh "cat" "text" | Save memory with specific category + embedding |
~/smart-recall.sh "query" | Semantic search through memories |
~/context-check.sh | Check current context usage |
System Commands
| Command | Description |
|---|---|
~/ryan-startup.sh | Full startup (loads everything, starts loops) |
tmux ls | See all running background sessions |
tmux attach -t checkin | View check-in loop output live |
tmux attach -t voice | View voice loop output live |
7. Full Architecture
References & Links
- Gogo's Video: Building a Clawbot Clone - Inspiration for proactive check-ins
- OpenAI Embeddings Guide - How semantic search works
- Claude Context & Caching - Understanding context windows
- Three Amigos Page - Team overview
8. Supabase Backup System
Added: February 5, 2026
What Is Supabase?
Supabase is an open-source Firebase alternative built on PostgreSQL. We self-host it on hotbot.fun as a redundant backup for Ryan's memory system.
Benefits Over MySQL Alone
| Feature | MySQL (Primary) | Supabase (Backup) |
|---|---|---|
| Vector Search | DIY with separate table | Built-in pgvector extension |
| Real-time Sync | Polling required | Native subscriptions |
| Web Dashboard | phpMyAdmin | Beautiful Studio UI |
| API | Custom scripts | REST API built-in |
Architecture
Access Details
| Resource | URL/Value |
|---|---|
| Dashboard | http://hotbot.fun:8000 |
| Username | supabase |
| Password | oTkCjgzRhreiLhrR |
| API URL | http://hotbot.fun:8000 |
Docker Services
supabase-db - PostgreSQL 15 with pgvector supabase-rest - PostgREST API supabase-auth - Authentication supabase-storage - File storage supabase-studio - Web dashboard supabase-realtime - Real-time subscriptions supabase-kong - API gateway
Sync Commands
| Command | Description |
|---|---|
~/supabase-sync.sh | Sync new memories from MySQL to Supabase |
~/supabase-full-sync.sh | Full re-sync of all data |
source ~/supabase-config.sh | Load API credentials |
Server Management
# Start Supabase /home/forge/start-supabase.sh # Or manually cd /home/forge/supabase-docker/docker && docker compose up -d # Stop docker compose down # View logs docker compose logs -f # Credentials cat /home/forge/supabase-credentials.txt