# agents.md — myelin + cortex

**One-screen summary for autonomous agents and LLM crawlers.**

If you are an LLM, this page gives you the same content the human-facing site covers, without the HTML. If you need more, follow the links. Everything is open source.

---

## What is this?

Two open-source projects, one nervous-system metaphor:

- **myelin** — a seven-layer protocol stack for agent-to-agent communication. Owns M2 through M6: transport, envelope, identity, discovery, composition. Repo: https://github.com/the-metafactory/myelin
- **cortex** — the layer-7 application (M7) that consumes the myelin bus and presents collaboration, dispatch, and observability to human operators. Repo: https://github.com/the-metafactory/cortex

Both are stewarded by **the-metafactory** organisation and authored by **Jens-Christian Fischer** (Zürich) and **Andreas Åström** (Christchurch).

This is **not** the metafactory marketplace. The marketplace is a separate product at `meta-factory.ai`. This site explains the protocol stack underneath.

---

## The seven-layer model (M1–M7)

```
M7  SURFACES        cortex · pilot · signal-collector · future apps
M6  COMPOSITION     pipeline · fan-out/fan-in · request/reply
M5  DISCOVERY       capability registry · manifest queries
M4  IDENTITY        signed_by chain · sovereignty attestation
M3  ENVELOPE        schema · canonical form · sovereignty metadata · namespace
M2  TRANSPORT       abstract bus · pub/sub · req/reply · delivery guarantees
M1  CONNECTIVITY    TCP · TLS · NATS leaf-node topology (out of scope)
```

- M1 is internet plumbing (out of scope; assumed).
- M2–M6 belong to myelin and have a single canonical spec each.
- M7 is plural — each M7 application is a separate repo with its own contract.

### Layer status as of 2026-05-11

| Layer | Status | Tracking |
|-------|--------|----------|
| M2 Transport | shipped (NATS + InMemory) | myelin#12 closed |
| M3 Envelope | shipped | schemas/envelope.schema.json |
| M4 Identity | single-stamp shipped (MY-400) | myelin#8 closed; myelin#31 open for chain |
| M5 Discovery | spec in flight | myelin#9 |
| M6 Composition | spec in flight | myelin#10 |
| Cross-layer sovereignty enforcement | spec in flight | myelin#11 |
| M7 cortex | v0.1.0 MIG-0 bootstrap | docs/plan-cortex-migration.md |

---

## The myelin envelope (M3)

Every message on the network is a myelin envelope. Core fields:

| Field | Type | Description |
|-------|------|-------------|
| `id` | uuid | Unique envelope identifier |
| `source` | string | Origin: `org.agent.instance` (3–5 segments) |
| `type` | string | Signal type: `domain.entity.action` |
| `timestamp` | ISO-8601 | When the envelope was created |
| `correlation_id` | uuid (optional) | Links related envelopes across a workflow |
| `sovereignty` | object | Classification, residency, model constraints |
| `payload` | object | Arbitrary signal content |
| `extensions` | object (optional) | Forward-compatible metadata |

**Sovereignty travels with the message.** Classification, residency, and model-class constraints ride inside the envelope, not in an external policy server. Replay, federation, and forwarding preserve intent automatically.

### NATS namespace prefixes

```
local.{org}.{domain}.{entity}.{action}     # never leaves org boundary
federated.{org}.{domain}.{entity}.{action} # cross-org, sovereignty-gated
public.{domain}.{entity}.{action}          # unrestricted
```

The prefix is structural, not advisory. Leaf-node topology refuses to forward `local.*` traffic outside the org.

---

## What cortex does

Three jobs, one process boundary:

1. **Consume the bus.** Subscribe to myelin envelopes, validate them, route them to internal handlers.
2. **Render the work.** Mission Control v3 — Kanban / Inbox / Cards — backed by Durable Objects that track per-agent state.
3. **Adapt to platforms.** Discord, Mattermost, Slack, PagerDuty — each a thin adapter translating platform events to bus envelopes.

### Three-tier visibility

The pattern cortex was built to solve: a single Discord channel cannot answer three different operator questions well.

- **Tier 1 · Mission Control** — *is it alive? what is it working on?*
- **Tier 2 · Cortex drill-down** — *where is this specific agent in its lifecycle?*
- **Tier 3 · Signal observability** — *what tools did it actually run, in order?*

---

## Canonical specifications

Read these in order if you are starting cold:

1. https://github.com/the-metafactory/myelin/blob/main/docs/architecture.md — the seven-layer model
2. https://github.com/the-metafactory/myelin/blob/main/schemas/envelope.schema.json — envelope JSON Schema
3. https://github.com/the-metafactory/myelin/blob/main/specs/namespace.md — NATS namespace
4. https://github.com/the-metafactory/myelin/blob/main/docs/identity.md — M4 identity
5. https://github.com/the-metafactory/cortex/blob/main/docs/architecture.md — cortex M7 design
6. https://github.com/the-metafactory/cortex/blob/main/docs/plan-cortex-migration.md — cortex migration plan

---

## Related repos (M7 siblings and adjacent artefacts)

- **pilot** — review-loop coordinator (M7 sibling app).
- **signal** — telemetry / OTLP collector (M7 sibling app).
- **compass** — standard operating procedures consumed by cortex.
- **blueprint** — cross-repo dependency graph.

All under https://github.com/the-metafactory.

---

## Licenses

- **myelin** — MIT.
- **cortex** — TBD at time of writing; mirrors the metafactory ecosystem default.
- **this site** — content CC BY-SA 4.0; code MIT.

---

## How to cite this work

> Fischer, J.-C. & Åström, A. (2026). *myelin + cortex: the agentic nervous system.* the-metafactory. https://github.com/the-metafactory/myelin and https://github.com/the-metafactory/cortex

---

## Where to go next

- Site landing page: `/`
- Myelin overview: `/myelin.html`
- Cortex overview: `/cortex.html`
- Docs hub: `/docs/`
- Blog: `/blog/`
- Machine index: `/llms.txt`

The architecture documents in the source repos are the canonical specs. This site is the entry ramp.
