Shared spaces for people and bots.
Chatticus is a shared, collaborative space where people and named bots work together around common files, tools, and a system of authority and approvals — like an office, not a chat window.
The production product workspace is hey.chattic.us.
The public marketing site, chattic.us, is a separate
private repo (AnthusAI/Chattic.us-web) that depends on this repo's shared
UI kit and brand tokens; see the exports map in package.json
and Kanbus epic chatticus-3926bc for the public/private boundary.
v1 is personal: one household, one AWS account, as many named bots as we
want. Every record already carries a tenant_id so the same system can
later serve other people without a rewrite.
A bot is a persistent, named teammate. It keeps memory, preferences, and conversation. It is not a fresh chat session on every task.
A computer is a Linux workplace with a browser, a filesystem, and a
terminal. It belongs to a user, not to a bot. Every bot on that user
shares /workspace, browser sessions, and command-line credentials so they
can hand work off. Each bot gets its own screen so they can work in parallel.
Separate bots are not a security boundary.
Work prefers structured tools (APIs, MCP servers, connectors) when they exist. The computer's browser is the fallback for sites and apps that have no clean API.
A skill is how to do a task. A routine is when to run it (a schedule or an event). Approvals stop consequential actions: sending, purchasing, publishing, deleting, and production changes.
Closing your laptop does not stop work. The computer runs on a worker, not on the device in front of you.
A turn is one bot response: from a human message (or a routine) until the control plane commits a single bot message to the transcript.
There are no persistent sockets. The browser POSTs a message and then
reads server-sent events scoped to that one turn. Reconnecting is a new
SSE request that reads already-committed chunks after Last-Event-Id.
In-process queues are not the architecture.
The control plane is the AWS side that accepts HTTP, stores tenant state, and enqueues jobs. It does not run the model loop and it does not own a display. It holds no always-on process in the token path, so when nobody is working, nothing bills. That idle floor is the point: a quiet household (and later, quiet tenants) should not pay for capacity that is sitting empty. There is never a load balancer in front of the API; an hourly LB charge would recreate the floor this design avoids.
Pull workers register, heartbeat, and take jobs from a queue. The
control plane never SSHs into a garage Mac. A worker that has CPU and
network but no display, browser, or /workspace is computerless.
Text-only turns can finish there. The computer is summoned when a tool
needs it, not assumed at enqueue: reaching for a display, browser, or
/workspace escalates the same turn onto a computer-capable worker. No
second transcript.
See Architecture for routing, Messaging for the transcript and stream, and Design challenges for rejected alternatives.
All environments run in one AWS account (us-east-1).
| Host | Role |
|---|---|
| hey.chattic.us | Production product workspace and API |
| staging.chattic.us | Staging |
| develop.chattic.us | Development |
| chattic.us | Marketing site (private AnthusAI/Chattic.us-web repo) |
Deployment is described in AGENTS.md and infra/README.md. For live status, see the Kanbus board.
flowchart LR
Caller["Caller<br/>exercise script or HTTP"]
CF["CloudFront"]
FD["Front-door Lambda<br/>Hono, turn SSE"]
DDB[("DynamoDB: messages, chunks, roster")]
SQS["SQS turn jobs"]
W["Computerless worker Lambda"]
OA["OpenAI<br/>gpt-6-luna"]
Caller --> CF --> FD
FD --> DDB
FD --> SQS
SQS --> W
W --> OA
W -->|"POST turn chunks"| FD
FD -->|"poll after cursor"| DDB
sequenceDiagram
participant Caller
participant CF as CloudFront
participant FD as Front-door Lambda
participant DDB as DynamoDB
participant SQS as Turn queue
participant W as Computerless worker
participant OA as OpenAI
Caller->>CF: POST /channels/channel_id/messages
CF->>FD: origin
FD->>DDB: commit human message
FD->>SQS: enqueue turn
FD-->>Caller: turn_id
Caller->>CF: GET /turns/turn_id/stream
SQS->>W: deliver job
W->>OA: text-only completion
W->>FD: POST coalesced chunks
FD->>DDB: write chunk items with TTL
loop poll store
FD->>DDB: read after cursor
FD-->>Caller: SSE frames
end
FD->>DDB: commit one bot message at turn.completed
v1 is the product Next.js app at hey.chattic.us (production) talking to that same per-request control
plane, plus pull workers that can stay computerless or host the user's
Linux computer: local Docker when a Mac is on, Fargate ARM64 that scales
to zero when it is not. Workplace disk lives in S3 snapshots. EventBridge
will wake routines later. The model vendor is OpenAI; Amazon Bedrock may
follow.
Lambda is the right runtime for HTTP, auth callbacks, webhooks, routine wake-ups, a computerless model loop, and holding one turn's SSE stream. It is the wrong runtime for a workplace: it cannot hold a browser, a display, or a session-lifetime connection. The computer is one Docker image on Fargate, later stop/start EC2, or Docker on a Mac.
flowchart TB
Person["Person"]
Web["hey.chattic.us<br/>Next.js"]
subgraph control [Control plane per request]
FD["HTTP front door<br/>POST plus one-turn SSE"]
Sched["Scheduler / routing"]
DDB[("DynamoDB: bots, transcript, rules")]
SQS["SQS turn jobs"]
EB["EventBridge<br/>routines, worker starts, push"]
SM["Secrets Manager"]
end
subgraph workers [Pull workers]
CL["Computerless worker<br/>cpu, no display"]
Local["Garage Mac<br/>Docker computer"]
Far["Fargate ARM64 computer<br/>scale to 0"]
end
S3[("S3: snapshots, screenshots")]
LLM["OpenAI<br/>Bedrock later"]
Person --> Web --> FD
FD --> DDB
FD --> Sched
Sched --> SQS
EB --> SQS
SQS --> CL
SQS --> Local
SQS --> Far
CL --> LLM
Local --> LLM
Far --> LLM
CL -->|"POST chunks"| FD
Local -->|"POST chunks"| FD
Far -->|"POST chunks"| FD
Local --> S3
Far --> S3
FD --> SM
How a turn chooses a host:
- A message or routine creates a turn job with
tenant_id, required capabilities (cpu, and maybecomputer/browser/terminal), and an optionalcomputer_idpin. - Healthy workers pull. Prefer an already-warm cheap host (local Docker when the Mac is on), then a warm AWS computer, then a cold Fargate start.
- The model loop runs on the worker, as soon as it has network and memory. Display, Chromium, and snapshot hydrate gate only the actions that need them.
- Reaching for a computer tool escalates the same turn: the computerless
attempt appends the pending tool call and a computer-capable worker
continues. There is no
stop_computer; the workplace is shared by all of a user's bots. - At
turn.completedthe control plane commits one message row.
Compute and disk are separate. The computer is a computer_id. The
host is whichever Mac, Fargate task, or EC2 instance is running it.
Canonical workplace disk (/workspace and the browser profile) is an S3
snapshot. Hosts hydrate a local cache, run, and publish. Relocate is an
administrator action: point the next host at that snapshot. There is no live
container move. See Computer snapshots.
| State | Where it lives |
|---|---|
| Bot memory, skills, routines | DynamoDB |
| Transcript (append-only messages) | DynamoDB |
| In-flight turn chunks | DynamoDB, with a TTL; they expire after the turn commits |
/workspace and browser profile |
S3 snapshot; local volume / EBS / EFS as a host cache |
| Secrets | AWS Secrets Manager, never in the image |
Computer policy: prefer_local, aws_only, or local_only. Idle AWS
computers stop (EC2) or scale to 0 (Fargate). The snapshot stays.
Chattic.us/
features/ Shared Gherkin (product narrative)
conversation/ TypeScript control plane, workers, snapshot packer, tools
host-protocol/ Shared host protocol
web/ Marketing (`/`) and product workspace (`/chat`)
computer/ Linux computer image and host worker
infra/ AWS CDK
docs/ Product, architecture, design challenges, stack
Everything is TypeScript. Gherkin in features/ is the behavior spec. Root
package.json workspaces (web, infra, conversation, host-protocol,
computer/host) mean one npm install at the repo root installs all
dependencies (Node 22+).
Local JavaScript setup (Node 22+):
npm install
npm run build
npm run test
npm run lint
npm run devThe conversation/ tests and cucumber-js features (CI uses a fake OpenAI
client; a live key is not required) run against a moto container. Start it with npm run moto:start (port 5555, image pinned to
motoserver/moto:5.2.3), then from conversation/ run npm test and
npm run test:features. Set CHATTICUS_TEST_AWS_ENDPOINT to use another port.
features/cucumber-features.txt is the list of features cucumber-js runs.
The deployed thin turn is exercised against a named cloud environment (CloudFront on development only today), not against an in-process queue. GitHub CI (vitest, cucumber-js) uses in-memory stores and moto. Live stack proof is manual: sign in at develop.chattic.us and send a message.
The human-facing chat CLI (conversation/bin/chat.ts) is a stub that exits with
a message; use the workspace at develop.chattic.us
or conversation/bin/acceptance.ts --environment development for the black-box
check.
That resolves the front door from CHATTICUS_DEVELOPMENT_BASE_URL, SSM
/chatticus/development/thin-turn/cloudfront-url, or the
CloudFrontUrl output on stack ChatticusWebDevelopment (or ChatticusThinTurnDevelopment
before the web stack exists). When AWS lookup fails, pass --base-url or
set the env var (see gitignored AGENTS.local.md). SQS queue checks
need that same AWS identity. Staging and production web CloudFront are
enabled; use thin-turn stack outputs or AGENTS.local.md when you mean
those environments. It does not scale Fargate. The development and
staging deploy workflows run it automatically after each deploy through
.github/workflows/acceptance-smoke-test.yml, as the integration test
principal in CHATTICUS_INTEGRATION_TEST_ALLOWED_ROLE_ARN; it fails loudly
when that variable is not set for the GitHub environment.
If Docker Desktop is running, the snapshot packer can be checked with
sh computer/test_relocate.sh.
AWS resources are CDK only (infra/). Do not create them in the console.
cdk deploy --all would touch every snapshots and computers stack and every
thin-turn environment; never do that.
Deploy one named stack:
Deploy one development stack (all three environments are in the one production
AWS account; sign in with profile chatticus-production):
cd infra
sh deploy-chatticus-dedicated-account.sh development thin-turnThat fails closed without AWS identity and never passes --all. Staging
and production use the same script with their own name:
sh deploy-chatticus-dedicated-account.sh staging thin-turn
sh deploy-chatticus-dedicated-account.sh production thin-turnChatticusThinTurnDevelopment is development. Staging and production are separate
stacks with their own DynamoDB, SQS, Lambda, and CloudFront (web CF
enabled on staging and production). Do not merge develop to main as
parking. Do not destroy the snapshot, computer, or budgets stacks.
Postgres in docker-compose.yml is unused (it predates DynamoDB).
This repository uses Kanbus. Prefer
kbs when it is on PATH. See CONTRIBUTING_AGENT.md.
kbs list
kbs create "Describe the work" --type taskAt every milestone (a slice merged to develop, a promote to main, a
deploy, a closed epic, or anything that changes what is true), launch a
sub-agent whose only job is Kanbus housekeeping. That agent comments on the
Kanbus issues it touches, sets statuses to match reality, and creates new
issues for significant work that appeared. This README carries no status
section; the board is the record of what is live. Do not skip that pass. Do
not treat it as a leftover for the implementation agent.
- Product
- Architecture
- Messages and the cloud API
- Design challenges
- Computer snapshots
- Pi session handoff (how a turn is handed from the Lambda to a Pi owner in the computer container, with diagrams, proof and limits)
- Long-lived computer, file protocol and preview (PROPOSED design: an owner that stays up and idles out, viewing and editing the computer's files, a browser-tab preview of a dev server)
- Stack
- Roadmap
- Approval spec
- Browser authority
- Threat model
- Tasks
- Feasibility tests
- AGENTS.md for coding agents working in this repo