Architecture

Built like an OS.
Architected for AI.

Every design decision in Genesis OS prioritises local-first operation, persistent memory, and zero-compromise privacy — from the daemon kernel to the Docker image.

Up and running
in 4 steps

1

Prerequisites

Install Docker Desktop (or Docker Engine + Compose). That's all. No Node.js, Python, or Ollama needed on your host.

2

Clone the repository

Clone from GitHub. The repository includes docker-compose.yml, all Dockerfiles, and the workspace directory.

3

Start the stack

Run docker compose up in the project root. Ollama automatically pulls gemma4:e4b on first boot (~9.6 GB download).

4

Open Genesis OS

Navigate to http://localhost:3000 in any browser. The full OS desktop opens immediately.

shell — complete setup
# 1. Clone
git clone https://github.com/shaik-shahansha/genesisAIOS
cd genesis-os

# 2. (Optional) customize model
cp .env.example .env
# Edit .env: GENESIS_MODEL=gemma4:e2b for lighter CPUs

# 3. Start everything
docker compose up

# First run downloads the model — be patient
# Subsequent starts are instant

# 4. Open in browser
# → http://localhost:3000

# ─────────────────────────────
# Optional: run in background
docker compose up -d

# View logs
docker compose logs -f daemon
💡 Tip: Lighter model for slower machines

Set GENESIS_MODEL=gemma4:e2b in your .env file. Same features, 7.2 GB download, faster on CPU.

Five layers.
One coherent system.

Genesis OS is composed of five loosely-coupled layers communicating over a shared event bus and HTTP APIs. Each layer can be upgraded or replaced independently — the interfaces never change.

⚛️
UI Layer
React 18 + Vite + Framer Motion
Desktop.jsx Taskbar.jsx WindowManager.jsx AppLauncher.jsx AIOrb.jsx NotificationPanel.jsx FileManager Terminal (xterm.js) PDF Viewer Monaco Editor
Daemon Layer (OS Kernel)
Node.js + Express + EventEmitter Bus
Event Bus (bus.js) HTTP API :3000 WebSocket Shell PTY Agentic Loop Tool Registry File System API Auth Middleware SQLite (better-sqlite3) File Watcher (chokidar) Service Manager
🧠
Memory Sidecar
Python + FastAPI :7701
ChromaDB (vector) sentence-transformers SQLite history Context compression Identity profile
🎤
Voice Sidecar
Python + FastAPI :7702
faster-whisper STT Piper TTS openWakeWord Web Audio API
🦙
LLM Layer
Ollama :11434 (OpenAI-compatible)
gemma4:e4b (default) gemma4:e2b qwen3:8b mistral phi-4 llama3 Any Ollama model Streaming responses Function calling Multimodal (images)

The nervous system
of Genesis OS

All internal communication flows through a central EventEmitter bus — never through direct function calls between packages. This loose coupling means any component can be upgraded, replaced, or extended without touching other parts of the system.

  • Daemon never crashes — all errors caught, logged, recovered
  • File watcher events flow through bus to memory indexer
  • Tool execution emits approval_required events
  • Voice wakeword detection fires via bus to UI
  • LLM streaming chunks pushed to connected WebSocket clients
  • Proactive cron jobs emit scheduled messages through bus
packages/daemon/src/bus.js
// The internal event bus
const { EventEmitter } = require('events');
const bus = new EventEmitter();
bus.setMaxListeners(50);
module.exports = bus;

// ────────────────────────────
// Emitting events
bus.emit('approval_required', {
  tool: 'run_shell',
  args: { cmd: 'rm -rf /tmp/old' },
  resolve, reject
});

// ────────────────────────────
// Listening to events
bus.on('file:changed', async ({ path }) => {
  await memory.index(path);
});

bus.on('wakeword:detected', () => {
  voice.startListening();
});

Reason → Act → Observe.
Repeat.

👤
User Input
text or voice
🧠
Memory Retrieve
ChromaDB search
🦙
LLM Reason
Gemma 4 function call
Approval?
if destructive
🔧
Tool Execute
via registry
👁️
Observe
tool result
💬
Respond
stream to UI
💾
Store Memory
SQLite + ChromaDB
🔄

Multi-step reasoning

The agentic loop continues calling tools until the task is complete or needs user input. "Summarise all invoices in my Documents folder" triggers file enumeration, reading, and synthesis automatically.

🛡️

Approval gates

Before any tool with requiresApproval: true runs, the UI shows a confirmation card. You see exactly what command will run and can cancel or approve.

⏱️

All requests have timeouts

Every Ollama call, ChromaDB query, and external fetch has an AbortSignal timeout. If any service is slow or down, Genesis degrades gracefully — it never hangs indefinitely.

📡

Streaming to UI

LLM output streams token-by-token via Server-Sent Events. Tool execution progress streams in real-time. You never stare at a loading spinner wondering what's happening.

One file.
Complete stack.

docker/docker-compose.yml
services:
  ollama:
    image: ollama/ollama
    volumes:
      - ollama_data:/root/.ollama
    ports: ["11434:11434"]
    entrypoint: ollama-entrypoint.sh

  daemon:
    build: . # Node.js daemon
    ports: ["3000:3000"]
    environment:
      GENESIS_MODEL: ${GENESIS_MODEL:-gemma4:e4b}
      OLLAMA_BASE_URL: http://ollama:11434
    depends_on: [ollama, memory]
    volumes:
      - ./docker/workspace:/workspace

  memory:
    build: Dockerfile.memory # Python sidecar
    ports: ["7701:7701"]
    volumes:
      - genesis_data:/data

  voice:
    build: Dockerfile.voice # Python sidecar
    ports: ["7702:7702"]

volumes:
  ollama_data:
  genesis_data:
🐳

Five services, zero configuration

Ollama, daemon, memory, voice, and the UI all start with a single command. Service dependencies are declared in compose — everything starts in the right order automatically.

📦

Persistent volumes

Your memories, conversation history, and model weights are stored in named Docker volumes. They survive container restarts and upgrades — data is never lost.

🌐

Works without GPU

Gemma 4's MoE architecture activates only ~4B parameters at inference. Fast enough for real conversations on a modern laptop CPU. No NVIDIA card required.

Everything configurable.
Nothing hardcoded.

Variable Default Description
GENESIS_MODELgemma4:e4bOllama model tag — any model works
OLLAMA_BASE_URLhttp://localhost:11434Ollama API base URL
GENESIS_PORT3000Daemon HTTP port
GENESIS_DATA_DIR./dataAll persistent data (SQLite, ChromaDB)
MEMORY_SERVICE_URLhttp://localhost:7701Python memory sidecar endpoint
VOICE_SERVICE_URLhttp://localhost:7702Python voice sidecar endpoint
GENESIS_PROJECT_ROOT./workspaceDirectory Genesis watches and can edit
GENESIS_USER_NAMEUserYour name for the identity profile
WHISPER_MODELbasetiny | base | small | medium
TTS_VOICEen_US-lessac-mediumPiper voice model identifier
GENESIS_VOICE_ENABLEDtrueEnable/disable voice sidecars
GENESIS_APPROVAL_MODEtrueRequire approval for destructive tools

Where everything lives

Daemon (Node.js)

packages/daemon/src/index.jsEntry point — starts everything
packages/daemon/src/bus.jsInternal event bus
packages/daemon/src/llm/client.jsAll LLM calls route here
packages/daemon/src/agent/loop.jsReason → tool → observe loop
packages/daemon/src/routes/fs.jsFile system API (/api/fs)
packages/daemon/src/routes/shell.jsTerminal WebSocket PTY
packages/tools/registry.jsTool registration and dispatch

UI (React)

packages/ui/src/shell/Desktop.jsxWallpaper + icon grid
packages/ui/src/shell/Taskbar.jsxBottom bar — dock, clock, orb
packages/ui/src/shell/WindowManager.jsxFloating window system
packages/ui/src/shell/AIOrb.jsxAnimated AI assistant icon
packages/ui/src/apps/registry.jsxAll built-in app registry
packages/memory/main.pyFastAPI memory service entry
docker/docker-compose.ymlFull stack definition

Ready to run Genesis OS?

The entire stack starts with one command. No cloud setup, no API keys, no monthly cost.