> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myrmagent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Product Architecture

> How the open frontend + server and the harness runtime fit together.

# Product Architecture

Myrm ships as **two product layers** plus optional cloud control plane. Understanding the split helps you deploy, debug, and migrate from other agents.

## Layers

| Layer                        | Repo / package                              | License                       | What you run                                             |
| ---------------------------- | ------------------------------------------- | ----------------------------- | -------------------------------------------------------- |
| **Product UI & API**         | `myrm-agent-frontend` + `myrm-agent-server` | Open source                   | Browser WebUI, REST/SSE API, auth, billing hooks         |
| **Agent harness**            | `myrm-agent-harness`                        | Proprietary runtime (bundled) | Tool execution, memory, browser, sub-agents, compression |
| **Control plane** (optional) | `myrm-control-plane`                        | SaaS / self-host              | LLM relay, Work Units, unified tool gateway              |
| **Desktop shell** (optional) | `myrm-agent-desktop`                        | Open source (Tauri)           | Native app wrapping the WebUI + local backend            |

**Plain language:** the frontend is what you click; the server is the door into your workspace; the harness is the brain and hands inside the sandbox.

## Harness public API (integration contract)

Open-source **server** code must integrate through `myrm_agent_harness.api` — not deep imports into private harness modules.

| Package area       | Purpose                                                                    |
| ------------------ | -------------------------------------------------------------------------- |
| `factory`          | Create agents (`create_skill_agent`, `SkillAgent`)                         |
| `types` / `config` | Streaming DTOs and LLM/agent configuration                                 |
| `protocols`        | Extension-point Protocol definitions                                       |
| `hooks`            | Session, skill-agent context, memory extraction, bash registry integration |
| `skills`           | Skill frontmatter parse and metadata builders                              |

Architecture CI in `myrm-agent-server` blocks `from myrm_agent_harness.*._*` imports so harness internals can evolve while the public `api.__all__` stays stable. Release wheels ship readable `.py` stubs plus compiled core extensions.

**Why it matters for SaaS:** the control plane rolls a new **runtime Docker image tag** per user sandbox (server + harness bundled in the image). Server glue imports only `api.hooks` / `api.skills`, so the glue layer stays stable across image rolls — a pattern most monolithic open-source agents do not support.

## Request flow (typical chat)

1. User sends a message in **frontend** (or an IM channel via server).
2. **Server** authenticates, loads agent profile, streams events to the UI.
3. **Harness** runs the agent loop: tools, memory recall, sub-agents, context compression.
4. Results stream back through server → UI (and optional channel notification).

## What to configure where

| Task                                | Where                                         |
| ----------------------------------- | --------------------------------------------- |
| Models, API keys, agent personality | Frontend **Settings** → persisted by server   |
| Skills, MCP, cron, goals            | Frontend UI + server APIs                     |
| Memory browse / approve / delete    | Frontend **Memory** panel                     |
| Sandbox files & code execution      | Harness inside per-user sandbox (not raw SSH) |
| SaaS billing & gateway tools        | Control plane (when `DEPLOY_MODE` is SaaS)    |

## Deployment modes (same features, different packaging)

| Mode              | Best for                      | You get                                                                                                                   |
| ----------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **Local WebUI**   | Developers, BYOK              | Full GUI on `localhost`, data stays on your machine                                                                       |
| **Tauri desktop** | Daily driver on Mac/Win/Linux | App icon in dock, deep links, no browser tab clutter                                                                      |
| **SaaS**          | Teams without ops burden      | Managed sandboxes, Work Units, optional tool gateway                                                                      |
| **PWA**           | Mobile add-to-home            | Install from browser after building `myrm-agent-frontend` (see [Development Setup](/docs/contributing/development-setup)) |

## Migrating from other agents

* **Config:** import paths for Hermes / OpenClaw-style exports (see **Quick Start**).
* **Memory:** Myrm uses structured DB memory + GUI — not a single `MEMORY.md` file.
* **Skills:** prebuilt + community discovery; evolution is approval-gated.
* **Channels:** 35+ built-in providers — re-link OAuth/ tokens in Settings.

For an honest feature matrix vs OpenClaw, Hermes, Claude Code, and others, see [Competitor Comparison](/docs/getting-started/competitor-comparison).
For reproducible low-load validation across open product layers and the closed harness runtime, use the [Layered Verification Playbook](/docs/guides/layered-verification-playbook).

## Next

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/docs/getting-started/quickstart">
    Run locally in minutes.
  </Card>

  <Card title="Memory System" icon="brain" href="/docs/core-concepts/memory-system">
    How cross-session memory works.
  </Card>

  <Card title="Sandbox Runtime" icon="server" href="/docs/core-concepts/sandbox-runtime">
    Where tools actually execute.
  </Card>

  <Card title="Desktop App" icon="desktop" href="/docs/getting-started/desktop-app">
    Tauri packaging and updates.
  </Card>
</CardGroup>
