TextOS is OpenClaw productized for civilians. The infrastructure handles all the complexity — users just text. This document maps every layer, every file path, how OpenClaw works under the hood, and what changes at 1K, 10K, and 100K users.
OpenClaw is the open-source multi-channel gateway that powers TextOS. It runs on your machine (or a server), connects to chat channels (Telegram, SMS, WhatsApp, Discord, iMessage), and routes messages to AI agent sessions with persistent memory, tool use, and scheduling.
// How OpenClaw works — message lifecycle 1. INBOUND User sends message via Telegram / SMS / email / web 2. GATEWAY OpenClaw Gateway receives it Looks up user session (or creates one) Routes to the correct agent 3. AGENT Agent reads session memory (MEMORY.md, daily files) Agent reads SOUL.md, AGENTS.md, TOOLS.md for context Understands intent via LLM (Claude Sonnet 4) Selects tools to execute (read, write, exec, web_search…) 4. SKILLS If task matches a SKILL.md, loads and follows it Skills provide specialized instructions (textos-onboarding, textos-website-builder, textos-publisher, etc.) 5. TOOLS Agent calls tools: file read/write, exec shell, FTP, web search, Stripe API, Buffer API, Google OAuth, etc. 6. MEMORY Agent updates memory/YYYY-MM-DD.md with significant events Long-term MEMORY.md updated periodically 7. RESPONSE Agent sends reply back through Gateway Gateway routes to original channel (Telegram, SMS, email) 8. CRON Scheduled jobs run via Gateway cron system Daily concierge at 6:30am, weekly digest, reminders
Every path below is real and live on your WSL2 Ubuntu environment. This is the exact structure TextOS runs from today.
~/.openclaw/ ← OpenClaw runtime root ├── openclaw.json ← main config (channels, model, gateway settings) ├── agents/ ← agent session data ├── canvas/ ← canvas/artifact storage ├── completions/ ← completion logs ├── credentials/ ← API keys, tokens (encrypted) ├── cron/ ← cron job definitions (DayCycle 5:30am, etc.) ├── delivery-queue/ ← outbound message queue ├── devices/ ← paired devices (Android/iOS nodes) ├── identity/ ← gateway identity / keypair ├── logs/ ← gateway and agent logs ├── media/ │ └── inbound/ ← all inbound images/files from Telegram ├── memory/ ← session memory (separate from workspace) ├── subagents/ ← isolated sub-agent runs ├── telegram/ ← Telegram channel state └── workspace/ ← YOUR working directory (repo root) ~/.openclaw/workspace/ ← workspace (git repo: robertkgaudet/inkthorn-dashboard) ├── AGENTS.md ← agent startup instructions ├── SOUL.md ← agent persona + values ├── MEMORY.md ← long-term curated memory ├── TOOLS.md ← FTP creds, API keys, tool notes ├── IDENTITY.md ← Rob's profile (for personalization) ├── USER.md ← who the agent is helping ├── HEARTBEAT.md ← periodic check tasks ├── memory/ │ ├── 2026-04-28.md ← today's session log │ ├── 2026-04-27.md ← yesterday │ ├── MEMORY.md (long-term) │ ├── family-profile.json ← Camille, kids, preferences (DayCycle private layer) │ └── heartbeat-state.json ← last check timestamps ├── skills/ ← custom TextOS skills │ ├── textos-onboarding/SKILL.md ← first message → handle → live site in 5 exchanges │ ├── textos-identity/SKILL.md ← handle claims, profile.json, bio/links │ ├── textos-website-builder/SKILL.md ← description → full HTML site at handle.textos.ai │ ├── textos-publisher/SKILL.md ← push to X, LinkedIn, Facebook, Instagram via Buffer │ ├── grok-imagine/SKILL.md ← AI image/video/voiceover generation │ └── social-poster/SKILL.md ← Buffer API social posting ├── scripts/ │ ├── build_today_cycle.py ← generates DayCycle JSON (runs 5:30am via cron) │ ├── daily_cycle_push.sh ← runs build + FTPs today-cycle.json to trustlight.ai │ ├── build_journal_entry.py │ ├── fetch_community_events.py ← WWOZ scraper for live music events │ └── update_activity_log.py ├── inkthorn-dashboard/ ← GitHub Pages repo (inkthorn.ai) │ ├── dashboard.html ← Rob's personal command center (TrustLight) │ ├── textos.html ← TextOS product vision / public overview │ ├── textos-investor.html ← investor data room │ └── skills/ ← (system skills, auto-loaded by OpenClaw) ├── stability/ │ └── google/ │ ├── credentials.json ← Google OAuth desktop client │ └── token.json ← saved auth token (Drive, Gmail, Calendar) ├── etsy/ ← NolaCultureCo Etsy publisher │ ├── auth.js ← PKCE OAuth flow (port 3003) │ └── pdfs/ ← digital products (6 PDFs ready) ├── textos-concierge.html ← DayCycle UI prototype (live: textos.ai) ├── textos-prd.html ← Product PRD (live: textos.ai) ├── textos-architecture.html ← this page └── today-cycle.json ← today's DayCycle data (rebuilt daily 5:30am CDT) ~/.npm-global/lib/node_modules/openclaw/ ← OpenClaw system installation ├── docs/ ← full OpenClaw documentation └── skills/ ← system skills (healthcheck, tmux, whisper, etc.) Host OS paths (WSL2): WSL distro: Ubuntu on Windows 11 Home: /home/ink_thorn/ Node: v22.22.1 OS: Linux 6.6.87.2-microsoft-standard-WSL2 (x64) Shell: bash
Every layer chosen for speed, cost-efficiency, and scale. AI writes Node, Python, and Astro better than anything else right now — so that's the stack.
| Layer | Technology | Purpose & Notes |
|---|---|---|
| Inbound SMS | Twilio | Receives texts from any US phone number. One dedicated number per user, provisioned at signup. ~$1/mo per number — bundled into Pro tier. |
| Email Inbound | SendGrid / Mailgun | Email-first auth layer. Magic links via email. Inbound replies from users route back to the agent. Every email sent has an auto-login link embedded. |
| Telegram | Telegram Bot API | Optional $4.99/mo add-on. Real-time two-way messaging. OpenClaw handles routing. One bot token per user (or shared bot with routing by chat ID). |
| Agent Brain | OpenClaw (open source) | Persistent memory, intent understanding, tool execution, skills, scheduling. Each user gets their own session. Self-hosted on Railway (Node.js server). TextOS is OpenClaw productized. |
| AI Model | Claude (Anthropic) | claude-sonnet-4-6 as default. Haiku for lightweight tasks (cost control). claude-opus for deep business analysis. Model tier affects per-request cost — managed per feature. |
| Image Generation | Grok (xAI) + fal.ai | Logos, hero images, social assets, Dream Board. ~$0.003/image on fal.ai. Grok for creative generation. Included in Pro tier with usage cap. |
| Site Publishing | Astro + Cloudflare Pages | Static site generation. Fast, SEO-friendly, zero server cost per site. Every text-based edit is a file write + Cloudflare Pages deploy trigger (< 30 seconds to live). |
| DNS & Subdomains | Cloudflare API | Auto-provisions handle.textos.ai on signup. CNAME + SSL handled invisibly. Custom domain upgrade (Pro) — user texts their domain, agent handles DNS config end-to-end. |
| Database | PostgreSQL via Supabase | Users, handles, sites, sessions, billing, configs, analytics. Free tier covers 0–5K users. Upgrade to Pro plan ($25/mo) at scale. Row-level security for multi-tenancy. |
| Session Cache / Queue | Redis (Upstash) | Session cache, job queues, rate limiting, pub/sub for real-time updates. Upstash serverless Redis — pay per request. Added at 5K+ users when Supabase alone isn't enough. |
| Billing | Stripe | All subscription tiers, webhooks, trial logic, upgrade/downgrade. Stripe Checkout for initial payment. Billing portal for self-service. Webhooks update user tier in Supabase instantly. |
| Backend API | Node.js on Railway | Thin webhook handler. Twilio inbound → OpenClaw agent → response. Stripe webhooks → Supabase updates. Scales via Railway's auto-deploy. $5–20/mo at launch. |
| Social Publishing | Buffer API | Queue and publish to X, LinkedIn, Instagram, Facebook, TikTok. User connects once. Agent publishes on approval. Rate limits managed per platform. |
| Google Integration | Google OAuth (Desktop) | Gmail read, Calendar read/write, Drive sync. OAuth credentials: ~/.openclaw/workspace/stability/google/credentials.json. Incremental scope requests — only asked when feature is used. |
| Bank Sync | Plaid | Personal finance feature. Read-only bank connection. Transaction log, IRS set-aside calc, budget tracking. $0.30/connected account/month. Added as Personal Website premium add-on. |
| SEO + GEO | Built into every publish | Schema.org markup, OpenGraph tags, semantic HTML, llms.txt on every site. AI-search-ready by default. Not an add-on — baked into the site generation skill. |
| DayCycle Data | Python cron + FTP | scripts/build_today_cycle.py runs at 5:30am CDT via OpenClaw cron. Generates today-cycle.json and pushes to FTP. Weather, local events (WWOZ), personal priorities all merged. |
What happens between "user sends a text" and "site goes live." Every hop mapped.
// V1 — Email auth + site publish flow USER → types "build me a site about my bakery" EMAIL/SMS → message arrives at SendGrid/Twilio webhook BACKEND → Node.js on Railway receives POST looks up user by email/phone in Supabase if new: provisions handle, creates Supabase row OPENCLAW → Gateway routes to user's agent session AGENT → loads MEMORY.md + today's memory file loads textos-website-builder/SKILL.md calls web_search to research the bakery CLAUDE → generates site HTML (hero, about, menu, contact) generates SEO meta, schema.org, OG tags FAL.AI → generates hero image + logo (3 options) CLOUDFLARE → new DNS CNAME: mybakery.textos.ai → Pages deploy SITE LIVE → mybakery.textos.ai publishes in < 60 seconds EMAIL BACK → "Your site is live at mybakery.textos.ai Here's what I built: [summary] Reply to change anything." STRIPE → if on free plan: paywall prompt for next action if Pro: execute immediately, no prompt // Update flow (returning user) USER → "change my headline to 'Best Baguettes in NOLA'" OPENCLAW → fetches current site HTML CLAUDE → makes targeted edit (not full regeneration) CLOUDFLARE → incremental deploy → live in < 15 seconds EMAIL BACK → "Done. mybakery.textos.ai updated."
The stack changes as users grow. Phase 1 is designed to get to 1,000 paying users with almost no infrastructure cost. Each phase introduces new systems when the previous ones start to strain.
// Decisions locked as of April 2026 EMAIL FIRST not Telegram-first Telegram requires app download. Email reaches 100% of internet users. Telegram becomes a $4.99/mo add-on, not a requirement. Every outbound email contains a magic login link — inbox is the session manager. GOOGLE SIGN-IN as primary auth path One click. No form. Returns email + name + photo automatically. Unlocks Gmail/Calendar pull via incremental OAuth scopes. Highest conversion rate of any auth method on the web. STATIC SITES Astro + Cloudflare Pages (not WordPress, not Webflow) Zero hosting cost per site. Sub-second load times globally. Every publish is a file write + deploy — no CMS, no database per site. Scales to 10M sites with no infrastructure change. PAYWALL MODEL blur paywall (not hard gate) User sees the value before paying. Blur creates desire. Current card visible for free — enough to hook the habit. Conversion happens at the moment of maximum desire (right now, on the page). OPENCLAW self-hosted agent brain (not OpenAI Assistants, not LangChain) Full control over memory, routing, tool execution. Open source — no vendor lock-in on the agent layer. Rob runs it today. TextOS productizes it for everyone. SUPABASE over PlanetScale or Neon Free tier generous enough for 0–5K users. Built-in auth, real-time subscriptions, row-level security. Postgres — standard, portable, no proprietary lock-in. BUSINESS BUILDER FIRST acquisition hook, not DayCycle Diffusion of innovation: early adopters want financial upside, not comfort. "AI finds your business idea, builds your site, runs your work" converts. DayCycle is the retention layer — builds the morning habit after signup. Build order: Auth → Business Builder → Personal Website → DayCycle → Notes Marketing lead: Business Builder. Retention engine: DayCycle. MODULAR PRICING feature add-ons, not one big bundle Users pay for what they use. Lower entry point ($9.99 vs $49). Each feature can be independently priced, trialed, and cancelled. Reduces refund risk. Increases ARPU over time as users add features. NO FREE TIER for DayCycle (blur paywall instead) Free forever on Notes, Journal, Blog, Activity — these drive habit. DayCycle, Telegram, Timeline — small recurring charges on sticky features. Business Builder — high-value one-shot charge with 3-day trial.