Every user gets their own private Grow Agent (a Rivet Kit actor) that orchestrates sub-agents and owns a dedicated sandboxed runtime — an OpenCode container for tool execution and a Gitea container for long-term memory. The frontend talks to the actor backend over a persistent connection; agents stream events, commit memory to the user's private git, and read/write structured state in the shared database.
Next.js 16 + React 19 on Vercel / OpenNext. Auth flows, chat composer, event console, and actor management. Talks to the actor backend over the Rivet Kit client and REST endpoints with a Clerk JWT.
Clerk on browser and server. JWT is verified on every request; users are mirrored into Postgres on first sight.
Stripe billing — plans, metering, webhooks, and customer portal. Flows through the same JWT identity as the rest of the app.
Hono routes for session listing and message logs. All persistent state flows through Postgres; the Rivet handler is mounted at /api/rivet/*.
Rivet Kit actors orchestrated by Hono. Two actor types — growAgent (one master per user) and subAgent (workers). Runner, Engine, and Storage are provided by Rivet; durable state mirrors into Postgres.
Per-user OpenCode container spawned via dockerode on first sign-in. Hosts sub-agent sessions, skill loading, and sandboxed tool execution. Streams events back over SSE which the Grow Agent re-broadcasts to the UI.
Three-layer memory surface exposed to Claude as tools (commit_memory, read_memory, list_memory). L1 in-actor state, L2 session in Postgres, L3 long-term in the user's Gitea repo.
Per-user Gitea container. Backend creates an admin user, mints an access token, and bootstraps a private growqr-memory repo. Long-term memory commits land here as plain markdown.
Postgres + Drizzle ORM. Tables: users, user_stacks, actors, repos, opencode_sessions, events. In production this is AWS RDS; in development it's the Postgres service in docker-compose.