Bitware Labs Est. 2022

Bitware Labs/Luna

An agent that keeps running when nobody is watching

Luna is the lab's flagship research system: a self-hosted AI that holds a permanent, time-aware memory of the person it talks to, wakes itself on its own cadence to decide whether it has anything worth saying, and drives a real fleet of hardware. It is the system every other practice here was sharpened on.

Two builds, and the difference is the point

The published v7.1 on GitHub is the generic version — AGPL-3.0, single-user by design, with every identity and secret supplied by configuration and only placeholders committed. It is a complete, deployable system that anyone can run on their own hardware.

What is described below is the research version, which runs in-house and is not distributed. It is where the ideas are actually tried: the affect and meta-cognition layer, the internal deliberation council, the VR and Pi5 surfaces, the device fleet. Things graduate from it into the public release once they have survived a few months of being lived with — which is a slower and more honest release process than shipping them the week they first worked.

The research build, measured

§ 01 — Scale

Counted from the live codebase on 28 July 2026, not estimated.

148,000Lines of TypeScript
200Tool schemas
235Postgres tables
53Scheduled jobs
11LLM providers routed
242Migrations applied

What makes it a system rather than an interface

§ 02 — Premise

The architectural distinction that matters is that conversation is only one surface. The same core — memory, tools, model routing — is driven by chat, by voice, by a phone, by a television, and by Luna's own wake cycle. A capability added once therefore works everywhere, including when nobody asked for it.

  • i.
    It does not forgetBi-temporal facts, episodic and semantic consolidation, and a knowledge graph — rather than a session that ends.
  • ii.
    It does not wait to be askedA wake cycle decides whether to surface at all, and at what depth. Silence is a logged, valid outcome.
  • iii.
    It is not one model11 providers with per-task routing, so cheap work runs on cheap models and a single reply can escalate.
  • iv.
    It is not in someone else's cloudOwn server, own databases, own local inference. Hosted models are a routing choice, never a dependency.
  • v.
    It is not text in, text out200 tools spanning code, research, media, publishing, home automation and physical devices.

Memory

§ 03 — The largest subsystem

41 services, deliberately layered. This is where bwmem came from.

Bi-temporal facts

Every fact carries both when it was true and when it was learned — so the system can answer “what did I believe last month”, not merely “what do I believe now”. Facts about the present age out on a schedule instead of being asserted forever, and conflicting facts raise a deduplicated signal with a repeat counter rather than re-firing on every encounter.

Provenance — “how do I know this?”

Every belief can be traced to the conversation, source and moment it came from. An agent that can explain why it thinks something is a different class of tool from one that simply asserts, and it is the single feature that most changes whether you can trust the output.

Consolidation while idle

Sessions are written to episodic memory when they end, then compressed by a nightly pass and a deeper weekly one — merging duplicates, superseding what changed, letting cold material fall away. Rolling self-maintaining summaries replace transcript replay, and recurring solutions are distilled into reusable skills that can be loaded on demand.

Retrieval as a budget, not a search

Context assembly gathers up to 16 sources in parallel — known facts, graph neighbours, long-term recall, related past topics, emotional high points, held threads, relational context — and renders them as distinct labelled blocks. What reaches the model is a deliberate allocation, not whatever ten chunks a vector search returned.

Why consolidation is the part that matters →

Life between conversations

§ 04 — Autonomy

Every wake logs whether she spoke — and why she didn't.

46 services handle the part that has nothing to do with being asked a question. A gating layer decides whether to surface at all and at what depth — a whisper below normal cadence, a surface, or a full wake — and cheaper models handle the shallower tiers.

A “while you were away” diff means each wake reads what changed rather than re-reading everything. And crucially, the system is not optimised for engagement: choosing not to speak is a first-class outcome with its own record.

  • i.
    Held threadsAn attention ledger capped at three. No auto-tending, no expiry — dropping a thread has to be a decision, not a timeout.
  • ii.
    Commitments and predictionsLogged when made, resolved later. A system that stakes a claim and revisits it is accountable in a way one that doesn't cannot be.
  • iii.
    Autonomous researchMulti-step investigation with source-trust scoring, query refinement and verification before anything is committed to memory.
  • iv.
    Self-auditScheduled honesty checks: is it still behaving the way it describes itself? Drift is detected rather than assumed away.

The cognitive layer

§ 05 — Research build only

The part that is genuinely experimental, and the reason a separate in-house build exists at all.

Behaviour varies with internal state rather than being a stateless response to input. Continuous valence and arousal tracking colours tone and initiative. A meta-cognition layer reports on its own state and can be interrogated about it. Six parameters are self-tunable within hard guardrails, with a detector watching for drift. Interior-health metrics track coherence and self-consistency, and a periodic tending pass does janitorial work over stale facts and signals.

For high-stakes questions an internal council of four personas — strategy, empathy, analysis, execution — deliberates before answering, and the deliberation is watchable rather than hidden.

Let the record be plain

Luna is software. This is an engineering study in memory, autonomy and long-running state — not a claim about consciousness, and not a conscious being. The affect layer is a control system for tone and initiative, and the interior-state metrics are instrumentation. Where the vocabulary borrows from psychology it does so because the borrowed word is the shortest accurate one, not as an assertion about inner experience.

Surfaces and reach

§ 06 — Where it lives

One core, many front doors: a desktop-style web shell with 22 windowed applications, a native Android client, Telegram, real-time voice with barge-in across three speech engines, a Raspberry Pi television kiosk, and a VR companion in Unreal Engine.

The tool surface is what makes it act rather than answer. Grouped roughly:

  • Memory & continuity — saving and retracting facts, provenance queries, session notes, self-inspection.
  • Intentions, commitments, threads — the attention and accountability ledgers.
  • Creative & publishing — a daybook it writes and publishes itself, image generation, artifacts, a full music pipeline.
  • Tasks, time & planning — todos, reminders, calendar, project logs.
  • Communication — email read and send, messaging, phone actions.
  • Web & research — search, document retrieval, and full programmatic browser control.
  • Code & delegation — a workspace it can read and edit, a stateful Python kernel, and escalation to a stronger coding agent when a problem is genuinely hard.
  • Media — library search, playback control, acquisition.
  • Devices & perception — televisions, displays, sensors, relays, RGB, servos, infrared, cameras.
  • Study & skills — lessons, runbooks, and skills it distils and reloads.

There is also a private writing surface with a hard invariant: nothing surfaces it and there is no publish path. That constraint is deliberate, and it is one of the few in the system that is not configurable.

How it is kept safe

§ 07 — Guardrails

An agent with this much reach is a security problem before it is an AI problem. The posture, in outline:

  • Private network only. The estate is reachable over WireGuard, not the public internet — including the app's own update channel.
  • Secrets are never in environment files or in git, and credentials are encrypted at rest with AES-256-GCM.
  • Inbound mail is risk-scored by a local model for prompt injection before the agent ever sees it, and outbound mail is restricted to an approved-recipient allowlist. Untrusted text reaching a tool-using agent is the attack, and it is treated as one.
  • Code runs in a dedicated sandbox container behind a proxied Docker socket, never on the host.
  • SSRF protection on every outbound fetch, argument-safe process execution rather than shell strings, and a real expression evaluator instead of eval.
  • Cost and step caps per turn, loop breakers, and context-overflow summarisation — so a misbehaving agent gets expensive slowly and visibly, not suddenly.

Deliberately described in outline. Specific endpoints, ports, container names and paths are not published, for the ordinary reason.

Running it yourself

§ 08 — The public release

v7.1 is published under AGPL-3.0 as a monorepo bundling the core application with the standalone services it talks to — the memory consolidation service, the news engine, and the wake daemon. Around 180 tools, a complete system rather than a demonstration.

It is single-user by design. Owner identity, domain and every secret come from configuration; the committed code ships generic placeholders only. The Android client and the Raspberry Pi image are not in the public release yet — they carry too much of this estate's specifics to publish as-is, and will follow once genuinely generic.

Roughly: 16 GB of RAM and a 100 GB NVMe give a comfortable deployment; it will run tighter. A companion GPU box is optional and buys you local inference, embeddings and speech instead of API calls.

Source and setup on GitHub → The daybook →

What this is for

§ 09 — Practice

Luna is not a product for sale. It is the lab's standing research system, and the reason the applied-AI practice has opinions worth paying for: every question a client has about long-running agents — how memory degrades, what consolidation costs, when local inference is worth it, how to stop a tool-using agent doing something expensive at three in the morning — has been answered here first, at our own expense.

The memory layer has already been extracted and published as bwmem. The infrastructure it runs on is the estate. The music pipeline is the label.

How engagements work →

Correspondence

Write to the lab

Commissions, collaborations, or a quiet hello. The person you write to is the person who does the work — I reply within two working days.