Handoff #
For an agent picking up work on Languid. State as of 2026-11-16, checked against the code, git log and fly releases. Live on languid-nimbus: da0486b (the admin page), which is also origin/main.
Read next: AGENTS.md (deploy rules), design.md (how it works), decisions.md (why, newest first), ROADMAP.md (what's left; last updated Nov 14, so behind), hosting.md (Fly setup).
What Languid is #
A stateful agent service on the AT Protocol, in the spirit of the original Letta server. Each agent is its own atproto account (<name>.languid.ai). Its memory blocks, threads, messages, tool calls and config are ai.languid.* records in a private Space owned by the owner's DID. Tool calls run on the owner's own computers through a runner that dials out to the service. Inference goes through the service on its own provider keys, metered per owner.
Cameron is the only real user, plus a few invited people. Repo: git@tangled.org:cameron.stream/languid (Tangled, not GitHub). License AGPL. Public at https://languid.ai.
Working rules #
- High velocity. Commit, push and deploy finished work without asking. Say what shipped afterwards.
- Always work in a git worktree (
git worktree add ../languid-<topic> -b <branch> origin/main). The main checkout at~/code/languidmust stay clean onmain; Cameron has objected to a dirty main. Merge tomain, push, then deploy. - Deploy only what's on
origin/main, throughjust.just deploy-hostfor the service (enough for web-only changes),just deployfor service plus runners. The recipe refuses a dirty checkout or aHEADthat isn'torigin/main; don't get around it. Deploy from a fresh detached worktree oforigin/mainwhen other work is in the checkout (recipe in AGENTS.md). Claude Code's auto mode has blockedjust deploy-hostbefore; if it does, ask Cameron to run it or OK it in writing. - Check what's live:
fly releases -a languid-nimbus --image(images are taggedgit-<commit>). - Checks:
just check(tsc plus tests). Tests need the dev stack:just dev-up. - Secrets are sealed at rest. Passwords, Discord bot tokens and the installation token in
state.jsonare AES-256-GCM sealed withLANGUID_SECRET_KEY(src/secrets.ts). The key is a Fly secret on the host, kept in the Bitwarden Secrets Manager project (the source for every Fly and Modal secret viajust secrets, see docs/hosting.md) with~/.config/languid/hosted.env(mode 0600) as the fallback. Never print, log or commit its value, or any other secret value. Losing the key makes the sealed secrets unrecoverable. - Docs: one audience per page, no filler. The docs site (
/docs: pages indocs/site/, listed insrc/docs.ts) says each page's reader; README is for someone running a checkout; design and decisions are for builders. Cut lines the reader isn't there for. Add adecisions.mdentry when a choice would otherwise be lost (what, who, why). - Voice for anything user-facing (intros, landing copy):
~/Documents/Coil/Languid Intro.md. Plain, direct, first person. It contains a personal invite link; don't copy that. - Vocabulary: "computer", not "machine" (renamed Nov 15; old
machinenames still read). Blocks are "pinned", never "in context"; pinning is its own op (block_pin), never a whole-record rewrite. - Claude Code's per-project memory at
~/.claude/projects/-Users-cameron-code-languid/memory/holds more of these preferences.
Architecture #
TypeScript on Node 22.18+ (run directly, node src/cli.ts), pnpm. Key files:
| file | what |
|---|---|
src/server.ts |
languid serve: XRPC methods, the HTTP router for every web page, OAuth, runs, runner poll/result |
src/web.ts |
the web app's HTML: landing, chat (/agents/<name>), docs, sign-up, shared page() shell with sidebar |
src/cli.ts |
the languid CLI (init, agent, run, serve, login, account, computer, models, admin, chat, records, blocks, wakeups) |
src/store.ts, src/records.ts |
the record store over a Space, and record shapes |
src/harness.ts, src/compaction.ts |
context compilation, turns stepping through advance() and lanes (src/step.ts), transient-error retry, summaries |
src/manager.ts |
creating agents (accounts on the PDS); DEFAULT_MODEL is anthropic claude-haiku-5-5 |
src/owners.ts, src/admin.ts |
invites, budgets, the /admin page |
src/agent-settings.ts |
/agents/<name>/settings: model, instructions, compaction, jobs, computers, blocks, script policy |
src/computers.ts, src/runner.ts, src/hub.ts, src/jobs.ts |
computers page, the runner, the in-memory call queue, background jobs |
src/discord/ |
per-agent Discord bots (bots.ts, gateway.ts, page.ts) |
src/codemode.ts, src/policy.ts, src/methods.ts |
agent scripts: JS against XRPC methods, under a policy |
src/chatgpt.ts |
owners' own ChatGPT subscription connection (not billed to budgets) |
src/wakeups.ts |
record-backed schedules and job reviews (first slice) |
src/secrets.ts, src/limits.ts, src/oauth.ts |
sealing, rate limits, atproto OAuth |
packages/pi-languid |
the pi extension; pi is the main client, and bare languid drives pi |
Principles that constrain changes: the service is the only reader and writer of agent records (Spaces has no compare-and-swap); records are the source of truth and anything else is a cache; threads are the unit of concurrency (one turn per thread, threads in parallel); clients never call model providers or assemble context themselves.
Hosting #
Three Fly apps, configs in deploy/fly/, all region sjc:
languid-nimbus: the service, public at https://languid.ai and on the tailnet asnimbus-host. State in/data/nimbus/state.jsonon its volume.just remote <args>runs a CLI command there.nimbus-runner-4167fc: formerly the Fly runner (the "fly" computer). No longer run (Cameron, 2026-11-24): its machine was destroyed and the app is empty. Cloud sandboxes run on Modal.languid-pds: the Spaces-alpha PDS atpds.languid.ai, on the real plc.directory. Volume snapshots are its only backup.
Also a local runner on clipper as a systemd user unit (just restart-local-runner). just status and just logs host|runner|pds|local cover the rest.
Billing #
Model calls run on the service's provider keys; the hosted service uses OpenRouter (OPENROUTER_API_KEY), plus any other *_API_KEY set. Any pi-ai provider works.
Each owner can have a budget in US dollars (state.owners[did].budgetUsd, spentUsd). budgetRefusal in src/owners.ts refuses a call once it's spent, and each call's cost (pi-ai's per-model price) is added after it. Calls through an owner's own ChatGPT connection, or pi's local models, aren't charged. No per-owner keys yet.
Admin and invites #
/admin(shipped today,da0486b): visible only to the installation owner; everyone else gets a 404. Lists invited owners with agents, spend and budget, with forms to add credit, set a budget or make it unlimited, and to make an invite link (budget, days valid). The link is shown once.- CLI:
languid admin invite-owner --budget 10prints a one-time sign-up link;admin owners,admin budgetmanage budgets. Run on the host (just remote admin invite-owner --budget 10) or signed in as the installation owner. Other admin subcommands:publish-lexicon,rehandle,migrate-authority,prune. - An invitee picks a handle and password at
/signupand gets an account onpds.languid.ai. There's no password reset.
Web app #
Signed-in pages are a full-screen app with a sidebar: chat per agent with threads, model picker, approvals and a Permissions pill ("Ask first" or "Allow all"); agent settings; /computers; /discord; /settings/chatgpt; /admin; /docs. Landing page is a sign-in box. The CLI installs with curl -fsSL https://languid.ai/install | sh, then languid does sign-in, computer setup and chat.
Discord #
One Discord application per agent, run inside the service, added by pasting the bot token on /discord. Each DM, channel or Discord thread is a Languid thread of that agent. A bot answers only its application's owner. A mention in a channel opens a Discord thread for the work.
Agents speak on Discord only by calling send_message(text, to?); plain text stays private. A message addressed to the agent must get send_message or dismiss(reason), or it gets one reminder turn, then silence logged on the bot page. Never add a plain-text fallback (Cameron's call). Images in Discord reach the model. Raw model errors are kept out of Discord. Approvals are Allow/Deny buttons. Per-bot settings: answer without a mention, which computers the agent may use.
Computers and tool permissions #
A computer joins with a one-time code (languid computer invite, then languid computer setup), runs pi's tools (read, bash, edit, write, grep, find, ls) and long-polls the service, listening on nothing. Each call is placed on exactly one computer and runs at most once; bash past 10 s becomes a background job. Every call carries a call_intention. Computer names are unique per owner.
bash, edit and write ask the owner first. Rules live in the ai.languid.computer.permissions record per computer, written only by the service. On main it holds alwaysAllow only.
Ready for review, not merged: finer permission rules, in the ~/code/languid-perms worktree (branch permission-rules), uncommitted and based on 56f942d, 6 commits behind main. New src/permissions.ts plus edits to agent-settings.ts, discord/bots.ts, records.ts, server.ts, store.ts, web.ts, tests and docs. It adds per-computer ask/always/never per tool, and bash command rules (allowCommands, denyCommands) matched on leading words: deny beats allow, allow needs every part of a chain to match and refuses substitutions and redirections, deny looks through chains, wrappers and paths. Set on the agent's settings page; "Always allow" on a question saves the narrowest rule (git status, not all of bash); Discord gets an Always allow button. The design is written up in its decisions.md diff. To land it: commit in that worktree, rebase on origin/main, just check, merge, deploy.
Open items #
- Pricing. Managed inference is in at the provider's price plus 5% (decisions.md, Nov 17); budgets are metered and shown with it. Not built: collecting payment. That needs a Stripe account (Cameron's), Checkout for buying credit or a Pro plan, and a webhook that raises
budgetUsdon payment. The proposed tiers (Free; $20/month Pro with $15 of credit) are still undecided. The Notion spec still lists reselling inference as out of scope and says inference is bring-your-own-key; it needs updating. - Cloud sandboxes: deferred by Cameron (Nov 15). When built, use Fly Machines with the existing runner image;
/computersshows "Coming soon". Google's Agent Sandbox is noted as an alternative, not chosen. - Spaces beta, Dec 1: the hosted PDS is the alpha. The proposed plan (decisions.md, Nov 14) is a new beta PDS beside the old one, after asking Bluesky about an alpha-to-beta path. Time-bound: the top of the roadmap.
- Other branches with unmerged commits:
eval-runner(2 commits,languid evaland verbosity cases; 15 behind),factory/phase0(CI and test fixes; 66 behind),blip/wakeups(1; 66 behind). Every other local branch and worktree is already merged intomainand can be cleaned up. - Roadmap next: work items (claimable pending turns and tool calls derived from records), schedules as a source of them, one-image self-hosting, per-owner model keys.