Skip to content
Mycelis Roleplay · Getting Started · 9 min min read

Mycelis Roleplay — Overview & Architecture

What is Mycelis Roleplay?

Mycelis Roleplay turns AI models into autonomous digital employees. Each actor runs on its own machine — a Windows PC, a Linux server, or a MacBook — and completes tasks up to a machine-verifiable outcome.

Instead of living inside a fragile chat session, a Roleplay actor steps into a defined job profile (Blueprint): it knows which brain drives it, which tools it may use, how to self-provision missing capabilities, and which guardrails apply. You set the goal, keep full visibility through the Live View, and step in whenever human judgment is needed.


Brain and Body

Mycelis already provides Agents (/dashboard/agents) — model configurations with system prompts, smart routing, knowledge bases, and MCP tools. Roleplay builds on top of them rather than duplicating them:

  • Mycelis Agent = Brain: Thinks per scene using your configured model, system prompt, knowledge bases, and routing rules.
  • Roleplay Actor = Body: Acts on a real computer — shell, files, processes, browser, desktop applications, keyboard, and screen.

A Job (Role Blueprint) connects both by referencing a Mycelis Agent (mycelis-agent) as its brain, or — in standalone mode — calling Anthropic or an OpenAI-compatible endpoint directly. When connected to Mycelis, every model call flows through /api/proxy/v1 with existing cost tracking, token budgets, and privacy filters.


Five Problems Roleplay Solves

Traditional Agent Limitation How Mycelis Roleplay Solves It
Manual tool setup Runtime self-provisioning — the MCP Gateway searches curated catalogs/registries and installs missing tools (winget, apt, brew, npx, uvx, containers) within policy limits.
Loops die with the session State outside the context window — tasks, scenes, and checkpoints persist in SQLite/PostgreSQL and survive crashes or OS reboots.
Nobody verifies results Deterministic postconditions — a scene only completes when a machine check (file, process, HTTP status, exit code, UI state) evaluates to true.
Agents sleep between prompts Event watchers, schedules & duties — emails (IMAP IDLE), webhooks, APIs, files, and metric thresholds wake the employee with zero idle token cost.
Agents forget yesterday's lessons Memory & self-learning — device memory, synthesized Markdown skills, and shared Company Memory persist across tasks.

The Six Invariants (I1–I6)

These invariants guarantee correctness and containment regardless of which LLM is used:

  1. I1 — State never lives in the brain: Task state and checkpoints are stored in a database outside any model session. Model calls are stateless and disposable.
  2. I2 — Verification is mechanical, never a claim: The model saying "I'm done" does not count. Only machine-checked postconditions advance a scene.
  3. I3 — Constraints intersect: effective = Fleet ∩ Role ∩ Task. No lower layer can grant permissions denied or restricted above it.
  4. I4 — Child budgets are shares, never new grants: Spawned actors and subtasks only receive a fraction of their parent's remaining budget.
  5. I5 — Delegation goes through the Hub: An actor never commands another device directly; it requests help from the Hub, which checks policies, quotas, and budgets.
  6. I6 — Core has no OS knowledge: Runtime and Policy target pure .NET 10. All OS specifics (services, process trees, screen capture, input injection, secret store, sandbox) sit behind interfaces.

How an Actor Executes Actions

An actor is a full computer operator, not a brittle GUI clicker. For each scene, the brain chooses the fastest, most deterministic path:

  1. Shell, scripts & files (shell) — bash, PowerShell, CLI tools, direct file read/write/edit. Preferred whenever available because it is fast and cleanly verifiable.
  2. Program APIs & MCP capabilities — any mounted MCP server (web, coding, packages, meeting, or catalog servers).
  3. GUI automation (windows / macos / linux) — native accessibility trees (UI Automation, macOS Accessibility API, AT-SPI) for desktop apps without a CLI.
  4. Screen & OCR (vision) — screenshots, text recognition, and coordinate clicks/drags when no accessibility handle exists.

When a GUI step fails, the escalation ladder native → uia → ocr → human guides retries up to human intervention.


Three Operating Modes

Aspect Mycelis Cloud Hub (Connected) Self-Hosted Hub (Standalone) Single-Device CLI / LocalHub
Hub & Storage Managed in Mycelis (PostgreSQL roleplay schema) Self-hosted Docker Compose (Mycelis.Roleplay.Hub.Standalone, PostgreSQL) Embedded LocalHub inside the device runtime (SQLite)
Management UI Mycelis Cockpit (/dashboard/roleplay) Standalone Cockpit web UI mycelis-roleplay CLI + local Desktop App
Brain Mycelis Agents via /api/proxy/v1 Ollama, vLLM, Anthropic, OpenAI, or Remote Mycelis Direct Anthropic / OpenAI-compatible API, key in OS secret store
Capability Source Curated Mycelis MCP Catalog MCP Registry / custom config Official MCP Registry
Multi-device Fleet Yes (including Mycelis Cloud Servers & Foundry) Yes (including Mycelis VPS via custom hub) No (single machine)

Architecture on the Device and Hub

Every enrolled device runs two core processes:

  • Supervisor (Mycelis.Roleplay.Node.Supervisor): Non-LLM host process driving the task loop, SQLite checkpoints, spec.watch event sources, schedules, budget enforcement, and on-demand live screen streaming.
  • Gateway (Mycelis.Roleplay.Node.Gateway): The single MCP server exposed to the brain. It spawns capability servers as child processes, namespaces their tools, checks every tool invocation against Policy (I3), and resolves Vault placeholders without leaking secrets to the model.

Devices connect to the Hub over HTTPS and SignalR using the open-source Mycelis.Roleplay.Protocol package.

Supported Platforms

Platform Service Model GUI & Screen Secret Store
Windows Unprivileged Windows Service (Session 0) + Session Helper in user session UI Automation + Desktop Duplication + SendInput DPAPI
Linux systemd service (headless or virtual desktop via Xvfb/XFCE) AT-SPI + Xvfb + XTest (PulseAudio for meetings) Keyring / 0600 file
macOS User-session LaunchAgent Accessibility API + ScreenCaptureKit + CGEvent macOS Keychain

Headless Linux servers (screen: none) are first-class citizens: shell, APIs, coding agents, and event watchers run normally, and the Cockpit displays terminal output, logs, and action timelines in place of a screen.


Cockpit Navigation Overview

Under Automation → Roleplay in the Mycelis sidebar, you access the full command center:

View Route Purpose
Overview /dashboard/roleplay Live fleet status, active tasks, pending items
Needs you /dashboard/roleplay/approvals Inbox for approval gates and agent questions
Tasks /dashboard/roleplay/missions Create tasks by goal, track steps and Mission Tree
Employees /dashboard/roleplay/employees Hire, tune, attach knowledge, and move employees
Company Memory /dashboard/roleplay/memory Central wiki, priorities, decisions, watercooler chat & conflicts
Computers /dashboard/roleplay/computers Own devices, Mycelis Cloud servers, and Foundry instances
Jobs /dashboard/roleplay/roles Create, validate, and version reusable Role Blueprints
Skills /dashboard/roleplay/skills Central Markdown skill library (SKILL.md import/export)
Workflows /dashboard/roleplay/playbooks Recorded playbooks, webhook triggers & role proposals
Vault /dashboard/roleplay/vault Encrypted credentials ({{secret:...}})
Rules /dashboard/roleplay/rules Workspace policies, self-provisioning, spawn quotas, cloud limits
Audit log /dashboard/roleplay/ledger Immutable append-only action log across the fleet

Next steps