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 on the felt yard at dusk, with Tuanzi by the mushroom house. By day it walks and rests around the yard; in the iOS app, the yard is the home screen. In Chat, Tuanzi’s replies appear word by word, and long-term memory keeps what you’ve told it. In the evening, today’s diary slides out of the yard’s mailbox, and at night the rain comes in as the yard follows time of day and weather. A closing card sums up what runs underneath: one Cloudflare Durable Object per household, vectorless SQLite FTS5 memory, Workflows for delegated tasks and diaries, APNs pushes and bring-your-own model keys. App footage was recorded in the iOS Simulator with local mock data for chat and diary, without connecting to the cloud or a real model.
Recorded 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.
Since December, Tuanzi can look things up on the web in read-only mode through a DeepSeek adapter with a request gate, keeping a source record for every lookup and rechecking it before publishing. New household events land in an event-driven inbox, where triage decides whether and when Tuanzi should speak up; partner updates follow each member’s preferences and local hours, and pushes and health checks now run through to the iOS and macOS clients. Yard actions are deduplicated by Idempotency-Key, and Sign in with Apple uses bundled JWKS with replay protection.
In development. The product film was recorded in December 2026 in the iOS Simulator and the web yard, with local mock data for chat and diary; the recorded demos and iPhone captures come from earlier local-integration sessions. The architecture notes reflect the December 2026 Cloud Actor codebase (e93db48), with production Cloudflare and APNs rollout still underway.

