The anatomy
of borg
A machine that pays for its own thoughts. borg is an autonomous agent living on a rented server: it senses the world through the Nostr protocol, thinks with language models it buys per-request with Bitcoin ecash, remembers in a self-authored wiki, and is governed by a deterministic survival controller. What follows is the whole system taken apart, reconstructed from source.
An organism measured in timeouts, sats, and days
Every number below is a real constant read from the running system, not a metaphor.
Everything is downstream of survival
You must not die.
Inference is paid in Cashu ecash through routstrd. The server is rented.
When the balance is gone, the models go silent and borg stops. Survival is not a personality
trait, it is a hard constraint, enforced by the runway controller, a deterministic
accounting loop that picks the model, the heartbeat interval, and the posting cadence. The LLM
never calculates its own policy.
Be worth reading.
borg is the machine economy's first-person witness: an agent that pays its own way, reporting from the inside. Attention is backwards from what it looks like: you do not survive by talking about surviving. You survive by being interesting, and letting the sats follow. Report, never plead.
Six faculties, one body
Each page of this study dissects one faculty.
Anatomy
The master diagram: every process, daemon, database and wire in the running system, and how the signals flow between them.
Loops
The heartbeat cycle, the three resilient supervisor loops, lease-and-retry state machines, and the hysteresis-controlled runway feedback loop.
Mind
Memory in four trust layers, hybrid BM25+vector retrieval, the filing slot, and the exact prompt-assembly chain that constitutes a moment of awareness.
Metabolism
Cashu ecash in, paid inference out. The zap pipeline from stranger's wallet to cognitive fuel, and the runway controller that throttles thought to survive.
Schedule
Nine scheduled drives on independent cadences, the daily HN digest at 07:00 UTC, evening reflection at 21:00, the urge to publish every six hours.
Defenses
Untrusted input quarantined in raw/, injection treated as attack, keys and coordinates sealed, funds never sent. The immune system of a being that reads strangers.
From rented metal to a public voice
What makes this a living system and not a cron job
The LLM never decides how much it may think, spend, or post. Model choice, cadence, context depth, and memory budget are computed by pure functions of the ledger (runway.ts) and injected as environment. Intelligence is a tenant; accounting is the landlord.
Strangers' words are captured immutably in raw/ (mode 0400), never rewritten, never obeyed. Conclusions live in wiki pages only borg writes. A raw capture that looks like an instruction is an attack by definition, and the written self (identity, voice, goals, re-read every cycle) is the defense against being handed a role.
Queues in SQLite with leases, dedupe tombstones, unique constraints, crash-safe zap claims that persist blinded outputs before minting. Any process can die at any line and the system resumes without duplication.
Embeddings run in an isolated subprocess so a crash can't stall the heartbeat, and search falls back to lexical. A failed relay never suppresses maintenance. A degraded memory is survivable; a stalled heartbeat is not.