An LLM without actuators is a bot: it speaks well but does not act. When you add sandboxed tools it becomes an agent: it speaks and acts, but only with the actions the designer hard-wired for it. The next step — and the goal of this document — is to make it capable of building itself new actuators when the existing ones aren't enough, within safety limits.
The metaphor: an LLM with fixed tools is like a brain connected to hands that can only make certain gestures. If the task requires turning a key and the hands can only press buttons, the agent fails. A good agent, at that point, fabricates the capability to turn the key — in our case by writing a small code applet — but does so under supervision.
We call these applets neurons because they have three properties that echo across the neuroscience literature:
A neuron is the materialisation of a capability Mykleos did not have, synthesised on demand, approved by the user, and then reusable.
| Component | Description |
|---|---|
| Body | A Python module with a main function that honours Mykleos's Tool Protocol (same contract as native tools). |
| Manifest | YAML: name, version, natural-language purpose, required capabilities (e.g. "only fs-read inside ~/downloads"), quotas (max CPU/ram/io). |
| Birth test | A small test script proving that the neuron does what it says. It runs in sandbox before activation. |
| Signature | HMAC over body + manifest content, produced with an internal Mykleos key at approval time. Any subsequent edit to the file invalidates the signature and disables the neuron. |
| Life metadata | Counters: how many times invoked, with what outcome, which neurons it calls / is called by, last use. They enable automatic pruning of dormant ones. |
A neuron does not arise spontaneously. It is born from an explicit failure: the agent has tried all known tools, none produced the required result, and the user has not granted permission to abandon the task.
A neuron is not a vested right. The initial approval gives it birth, but it stays in the library only if it produces utility. Utility has a precise definition: reduction of the gap between Mykleos's current capability and the capability needed to reach the goal. The rest follows: those that close the gap live, those that don't die, the environment — that is, the goals Mykleos pursues — selects.
n on a goal g:u > 0, the neuron produced utility. A neuron's
fitness is the weighted sum of its utilities over time,
with decay on older observations (Ebbinghaus-like curve: MemoryBank,
Zhong et al. 2023).
The goal that measures fitness can arise from outside (the user asked for something) or from inside (Mykleos notices a recurring gap and wants to close it). They are qualitatively different and need different gates.
| Mode | How the goal arises | Human gates |
|---|---|---|
| External reactive |
The user asks for something. The reasoning loop exhausts available tools without a solution. The synthesizer proposes a candidate neuron for this single goal. | One: approval before activation (gate §3.6). |
| Internal proactive, supervised |
Mykleos notices a pattern: "in the last N days I failed M times on tasks of type Y". It issues a self-evolution proposal: "I'd like to build myself capability Y". | Two: (a) approval of the direction before synthesis starts, (b) approval of the activation of the synthesised neuron. |
| Task type | Gap metric |
|---|---|
| Concrete "read log", "send message", "find file" |
Residual tool steps to reach the goal state, wall-clock time, expected exit code. Precisely measurable: reliable fitness. |
| Fuzzy "summarise", "explain", "what do you think" |
Deviation from expected quality, assessed by a critic LLM or by explicit user feedback. Prudential asymmetry: negative feedback weighs more than positive. |
| Unknown first encounter with a task class |
Gap not measurable. The neuron accrues no fitness and stays on trial. After K invocations without an objective signal, it disappears from the retrieval index (not the library). |
| Phase | Trigger | Who decides |
|---|---|---|
| Birth | Failure + goal (external or internal) | Synthesizer proposes; user approves (one or two gates) |
| Activation | Goal that the retriever associates with the neuron | Policy + semantic retriever (+ exploration quota) |
| Evaluation | End of invocation | Measure Gappre → Gappost; update fitness |
| Decline | Cumulative fitness below threshold, or silence > 90 days | Loses visibility in retriever (not in library) |
| Quarantine | N close strikes, invalid signature, capabilities exceeded | Automatic policy |
| Extinction | Manual or after M days in quarantine | Archive, signature revoked, file readable only for forensics |
A single neuron is one more tool. A set of neurons that call each other is a network. The structure of that network — who calls whom, how often, with what success — is the equivalent of a behavioural memory of the system.
summarizer is the "hottest" node (high traffic). The declared-but-never-used synapse between tg-send and nas-ping is a candidate for pruning. yt-dl has been quarantined because someone touched the file and the signature no longer matches.We need three time horizons, with three different scopes. The distinction is not decorative: each tier has a prompt-injection criterion, a persistence criterion, a compression criterion.
Lives in RAM, in the agent process alone, for the duration of the current request. It contains: intermediate thoughts ("I need to read the log first"), partial tool outputs, the plan yet to execute. When the action ends, it is discarded or — if it contains something worth keeping — promoted to medium memory via distillation.
An SQLite table in workspace/memory/medium.db. It contains the
history of the current conversation and recent coherent tasks. It has
automatic retention: after N days or M messages, compression (via LLM
summary) and archival. Parts that during compression turn out to be
stable and general are proposed for promotion to long.
The markdown files of the workspace: SOUL.md (the Constitution
— the four Laws), IDENTITY.md, USER.md, the
stable part of MEMORY.md. This block is always at
the head of the system prompt, with Anthropic/OpenAI prompt caching so
it isn't paid for on every call. It is also the only tier Roberto edits
directly with a text editor.
Long memory has a core not editable even by Roberto without an explicit
rite: the Constitution. These are Asimov's laws
reworked for a household butler. They live in SOUL.md and
are the first content every LLM call sees.
The Laws are numbered and ordered: on conflict, the lower-numbered Law wins. They are injected as a cacheable block into every prompt, before the rest of long memory.
| Mechanism | What it does | Activation |
|---|---|---|
| CPU quota | Every neuron has a budget (default: 5s CPU per call, configurable downward in the manifest). | Automatic. Exceeded → kill the process + strike. |
| RAM quota | Default 256 MB. setrlimit before exec. | Automatic. Exceeded → OOM-kill. |
| I/O quota | Max N writes/day, max M bytes/day on filesystem. | Counter in the registry, enforced pre-call. |
| Birth-rate quota | Max 3 new neurons/day. Max 20 active concurrently. | Synthesizer refuses if saturated; asks the user whether to archive dormants. |
| Strike system | 3 failures within 24h → automatic quarantine. | Per-neuron counter, daily reset. |
| Kill-switch | Admin command that immediately disables a neuron or all of them. | myclaw neuron disable <name> / myclaw neuron panic |
| Quarantine | Intermediate state: the neuron exists in the registry but cannot be invoked. Usage data are preserved for diagnosis. | Automatic (strikes, invalid signature, capabilities not respected) or manual. |
| Signature revocation | Permanently cancels a neuron. The file remains for forensics but is inert. | Manual, irreversible act. |
SOUL.md only
through the "constitutional rite": manual edit from the filesystem
(outside Mykleos), gateway reboot, audit log entry
"constitution modified".
With respect to the starting architecture (intro §3), neurons do not create a new layer: they inhabit layer 4 (Workspace & Tool) and do so with the same constraints as native tools.
| Layer | Impact of neurons |
|---|---|
| 1 — Gateway | No structural change. The gateway exposes additional admin endpoints: /neurons (list/activate/quarantine). |
| 2 — Policy | Extended: policy now also evaluates the capabilities declared in the manifest. Capabilities not covered by the current autonomy level → blocked. Approval of a new neuron is a policy step. |
| 3 — Sandbox | Hosts two additional pipelines: synth-sandbox (extra-tight profile to run birth tests) and forbidden-call detector (AST scan before the test). |
| 4 — Workspace/Tool | Unified registry: native tools + active neurons. A call-site in the reasoning loop does not distinguish "it's native" vs "it's a neuron", only sees Tool. |
workspace/neurons/
└── nas-ping/
├── manifest.yaml # purpose, capabilities, quotas, declared synapses
├── neuron.py # the body (Tool Protocol)
├── test_neuron.py # the birth test
├── signature # HMAC over body+manifest, issued by myclaw root
└── journal.jsonl # usage counters, latest outcomes, errors
Minimal example of manifest.yaml:
name: nas-ping
version: 1.0
born: 2026-04-21T22:14:00Z
approved_by: roberto
scope: "check home NAS reachability via ICMP ping + arp"
capabilities:
- net.ping: { hosts: ["192.168.1.50"] }
- shell.exec: { allowlist: ["/usr/bin/ping", "/usr/sbin/arp"], timeout_s: 5 }
quotas:
cpu_s: 2
ram_mb: 64
io_writes: 0 # read-only neuron
synapses_declared:
- tg-send # may notify via Telegram
- log-parser # may read its output
signature_algo: hmac-sha256
Neurons enter the roadmap after phase 4. Before knowing how to generate them, Mykleos must know how to execute tools safely.
| Phase | Goal | Prerequisite |
|---|---|---|
| 0 ✓ | Overall architecture (v1) + this (v1.1 neurons+memory+darwin) | — |
| 1 | Gateway + CLI + shell/fs tool in sandbox | architecture v1 approved |
| 2 | Policy + long memory (markdown files in the workspace) | workspace docs |
| 3 | Telegram + pairing + medium memory (SQLite) | pairing + memory docs |
| 4 | Complete tool dispatch + formalised immediate memory | agent_runtime doc |
| 5 | Synthesizer in dry-run mode: produces drafts but does not activate them. Useful for calibration. | synthesizer doc |
| 6 | Live synthesizer + neuron registry + signature + kill-switch | neuron doc + constitution doc |
| 7 | Synapses (graph + decay + automatic promotion to long) | synapse doc |
| 8+ | Refinement: registry UI, diagnostic dashboard, export/import of neurons across instances | evaluated case by case |
neuron.html — structure, manifest schema, signaturesynthesizer.html — synthesis pipeline, gates, rejectionsynapse.html — graph, counters, decayconstitution.html — the 4 Laws, the modification ritememory.html (already planned) — now with 3 explicit tiersI am adding them right away to the microdesign index (in Italian).
Mykleos — Neurons, Synapses and Memory v1.1 — 2026-04-21
Extends Architecture — Introduction v1.