Cattt
A shared 3D companion app for couples
A shared companion app for couples on iOS and macOS. Tuanzi lives in a 3D felt yard with its own routines and temperament, joining chat, sitting nearby, keeping a diary and handling delegated tasks and reminders in the background.
GitHub repository (opens in a new tab)On this page
- Built
- iOS & macOS thin clients · 3D yard · Cloud actor engine · Vectorless memory
- Stack
- SwiftUI Three.js TypeScript Cloudflare Workers Durable Objects Workflows SQLite FTS5
Product film
Read the video description
The film opens in Tuanzi’s 3D yard. In chat, the user asks Tuanzi to plan a relaxed half day with a walk and some time to draw. Tuanzi acknowledges the request. A background workflow drafts the plan, saves three checkpoints, and submits a report. The foreground publisher checks consent and conversation context, then sends a chat message letting the user know a letter is ready. The user returns to the yard and opens the letter to read the plan and its rainy-day alternative.
More demos
Walk to the pond
Ask Tuanzi to wait by the pond. Tuanzi walks there through the yard, and the app reports its arrival to the backend.
Sit with me
An invitation starts a sit-together action. The yard chooses a seat, and the app confirms that Tuanzi has settled beside the pond.
Remember a preference
Ask Tuanzi to remember that turquoise is your favorite color. Open Long-term Memory to see the saved preference and its original message.
The yard, three spaces and lifecycle
Tuanzi walks, drinks and rests on its own schedule while the yard shifts with time of day and weather. The yard is the home screen, chat opens over the scene, and the mailbox leads to the diary, without streaks, levels or feeding chores. Conversations span three spaces: a shared group chat, private direct chats with Tuanzi, and diaries authorized per entry. Neither partner can see the other’s direct chat, while Tuanzi shares household context and relays attributed notes only with permission. One person can sign up and start a yard, then pair later with a six-character invite code. Leaving supports personal data export before a single cloud transaction deletes the departing member’s private chats, diaries, private memories and keys.
One cloud writer per household
The backend moved from an earlier two-Mac local-host setup to a single-writer Cloud Actor model so couples can start without running local servers. Each household maps to one Cloudflare Durable Object with its own SQLite database, keeping data isolated and writes serialized on one thread. Core logic stays in a platform-free TypeScript package injected with a synchronous SqlDriver, separated from the Cloudflare edge adapter.
- HouseholdDO · Single writer
- Owns conversations, three-space permission views, yard state and the sole publishing gate. Both live replies and background reports pass through it to check consent, excluded topics and quiet hours, while a single Alarm wheel drives scheduled jobs and APNs pushes.
- Workflows · Async work
- Cloudflare Workflows handle memory extraction, profile refreshes, delegated tasks and daily cat diaries. A self-built streaming agent loop runs tools without a heavy AI SDK, saving step checkpoints and returning structured reports without posting directly to chat.
- iOS & macOS · Thin clients
- Both apps share zero-dependency Swift CatttCore for Keychain storage, single-flight token refresh, SQLite WAL caching and an offline outbox. Clients write through idempotent HTTP and receive live streams and yard sync over WebSocket.
- 3D world
- Three.js drives pathfinding, poses and scene interactions inside one shared WKWebView for yard and chat. The household actor updates Tuanzi’s state on demand, syncs it to online clients over WebSocket and receives action receipts through a two-way bridge.
Global D1 handles login and household routing, and R2 stores static assets. Models run through shared household BYOK across DeepSeek, OpenRouter, OpenAI, Gemini and compatible endpoints. A single key maps automatically to Smart and Fast slots, stored with AES-256-GCM envelope encryption alongside SSRF blocking, health probes and a 30-day usage log. The retired dual-Mac local-host codebase is archived at archive/r9.8-local-host.
In development. The film and iPhone captures come from earlier local-integration recordings. The architecture notes reflect the December 2026 Cloud Actor codebase, with production Cloudflare and APNs rollout still underway.

