Skip to main content
GenosOS is a self-hosted, encrypted AI assistant built on Bun. All channels — WhatsApp, Telegram, Slack, Discord, Signal, iMessage, voice — connect to a single gateway process, which routes messages to isolated agent sessions backed by persistent, encrypted memory.
WhatsApp · Telegram · Slack · Discord · Signal · iMessage · Voice

                        ┌─────┴─────┐
                        │  Gateway   │  ← single entry point
                        │  :18789    │
                        └─────┬─────┘

            ┌─────────────────┼─────────────────┐
            │                 │                 │
      Multi-Agent        Memory + TOON     Tools + Skills
      System (A2A)       Compaction        semantic filtering

Runtime and toolchain

ComponentChoiceNotes
RuntimeBun (>=1.2)Native SQLite, instant startup, unified runtime
LanguagePure JavaScript ES2024+TypeScript fully eradicated — no build step for dev
Package managerpnpmBun used only for runtime and bundling
UI buildVite 7 → dist/control-ui/Lit 3 web components
TestsVitest738 suites, 6,140+ tests (unit + E2E)
Linteroxlint + oxfmtNot eslint
No TypeScript means no build step during development. You can edit a source file and the change is live immediately under bun --watch. This is intentional — a single-developer personal companion project gains nothing from a type compilation layer.

Project structure

GenosOS/
├── src/                        # Core server (~475K LOC, 3,200 files)
│   ├── agents/                 # Multi-agent architecture (391 files)
│   │   ├── tools/              # Agent tools + blueprints
│   │   │   └── blueprints/     # 12 files, 190 declarative blueprints
│   │   ├── auto-config.js      # 6 pure functions for intelligent defaults
│   │   ├── subagent-spawn.js   # Subagent lifecycle + depth limits
│   │   ├── system-prompt.js    # Dynamic system prompt builder
│   │   └── static-model-catalog.json
│   ├── gateway/                # Server implementation (166 files)
│   │   ├── server.impl.js      # Gateway initialization orchestrator
│   │   └── server-methods/     # 20+ RPC handlers (139 methods)
│   ├── config/                 # Configuration system (115 files)
│   ├── memory/                 # Dual-backend memory (QMD + SQLite)
│   ├── cron/                   # Scheduling (croner-based)
│   ├── browser/                # CDP integration (playwright-core)
│   ├── tts/                    # Kokoro TTS (local, CPU)
│   ├── canvas-host/            # Visual workspace (port 18793)
│   └── infra/                  # Vault, encryption, audit log
├── ui/                         # Control UI (Lit 3 + Vite 7)
├── extensions/                 # Channel integrations (29 active)
├── skills/                     # Bundled skills platform
├── genosos.mjs                 # Entry point → src/entry.js
└── package.json

Data flow: inbound message

Every message from any channel follows this path through the gateway:
1

Channel receives message

The channel extension (e.g., WhatsApp Baileys plugin) receives an inbound message from the external service.
2

callGateway RPC

The extension calls the gateway via callGateway({ method: "chat", channel, peer, message }).
3

Resolve session key

The gateway applies the DM policy and channel-peer combination to resolve (or create) a session key. Default scope is per-channel-peer.
4

Load session transcript

The encrypted session transcript is loaded from ~/.genosv1/agents/{uuid}/sessions/. NYXENC1 decryption happens transparently.
5

Semantic memory prefetch

Relevant memory context is injected from the dual-backend memory system (QMD + SQLite). The query embedding is reused for tool filtering — zero extra API calls.
6

Semantic tool filtering

Tools are filtered by embedding similarity to the user’s intent. Core tools (read, write, exec, bash) always pass. Domain tools appear only when semantically relevant. Saves ~2,000–3,000 tokens per request.
7

Agent run (Pi embedded runner)

The Pi agent runner executes the model request: system prompt + tools + session context → model API → tool calls → results → final reply.
8

Reply streamed back to channel

The final response is delivered to the originating channel (e.g., WhatsApp).
9

Session transcript persisted

The updated session transcript is written back to disk, encrypted with NYXENC1 (AES-256-GCM).

Multi-agent system

Agents are isolated execution contexts. Each lives in ~/.genosv1/agents/{uuid}/ — opaque 8-character hex directories that decouple identity from the filesystem. Renaming an agent is a config + session key operation — zero filesystem moves.
ConceptDetails
Tool profileInferred from agent name: coding, messaging, minimal, full
Session keyagent:{agentId}:main (always present)
A2A communicationAgents can message each other; ping-pong default: 2 turns (max 5)
Input provenanceexternal_user vs inter_session — agents know who is talking
Smart model routingboost tool auto-escalates to the advanced model mid-conversation

Security layers

LayerImplementation
Encryption at restNYXENC1 (AES-256-GCM, PBKDF2 100K iterations)
Key managementmacOS Keychain → env → .env fallback
Biometric authWebAuthn / Touch ID
DM policyPairing (6-digit code) / allowlist / closed
Tool executionApproval gates per tool category
Channel restrictionsMessaging channels cannot run shell commands
FilesystemTransparent write/edit encryption
AuditTamper-evident HMAC checksums
SecretsBuffer zeroing after use
OS hardeningSpotlight and Time Machine exclusion
Auto-lock30-minute vault timeout

Key design decisions

Bun runtime. Bun provides native SQLite (bun:sqlite), instant startup, and a unified runtime that handles both server execution and bundling. No Node.js compatibility shims required for core functionality. TypeScript eradication. Pure ES2024+ JavaScript with no compilation step. The codebase runs directly under Bun during development. This is a deliberate tradeoff: zero build friction at the cost of static typing — correct for a product that values iteration speed over large-team coordination. Conversational configuration. 12+ UI tabs replaced with config_manage (30 actions, 190 blueprints). Configuration is conversation — users say what they want, the agent applies validated changes with automatic coercion and cross-field checks. Tests. 738 suites, 6,140+ tests across unit and E2E, run with Vitest. The test matrix covers gateway startup, channel integration, memory compaction, security audit, and agent-to-agent communication.

Further reading

Gateway

Full gateway startup sequence and configuration.

Memory system

TOON compaction, vector search, and semantic prefetch.

Extensions

Channel extension tiers and the plugin SDK.

Configuration

All config sections, blueprints, and the config_manage tool.