
relatum
io.github.IronAdamant/relatum
Pass-by-reference notes for agent swarms, over the same files as the CLI.
Documentation
Relatum
Formerly Examen.
Pass-by-reference notes for agent swarms.
When an agent spawns subagents, it usually pastes the same decisions, constraints, and conventions into every spawn prompt. Relatum lets the parent write each fact once as a short note, then send each child a brief that names note IDs:
Task: add retry logic to src/acme/net/client.py per the retry decision.
Read first: _shared/report-format, _shared/repo-conventions, net/retry-decision
Your scope: net/client
Done when: client retries per the decision; existing tests still pass.
Children read what they are told to, write findings and dead ends back as notes, and return short reports that cite note IDs. Siblings see each other's findings, and a later session can pick the work up cold from the same files.
Relatum is one small Rust binary (standard library only, no Cargo crates) with a CLI and a stdio MCP server over the same files. No service, no account.
How it works
.swarmnotes/
_shared/report-format.md <- id: _shared/report-format
net/retry-decision.md <- id: net/retry-decision (written by the parent)
net/client/timeout-bug.md <- written back by a child in scope net/client
- A note is markdown with a little frontmatter (
kind,summary,author,updated,tags). Its ID is its path. - Parents write
decision,constraint,convention,context, andformatnotes. Children writefindingandattemptnotes in their own scope. - A summary is one line of up to 200 characters; the body holds the rest.
- Creating a note never overwrites one. To change your mind, write a new
note and
supersedethe old ID (or pass--supersedes OLDtonew, one step);geton the old ID follows the chain. For handoffs written as deltas,relatum_getwithinclude_supersededalso returns the notes the live one replaced. ls --since 2026-11-06lists what was written or changed since local midnight that day; a time such as2026-11-06T09:30:00Zor2026-11-06T09:30+11:00works too.- Every write lands whole, so agents in parallel never read a half-written note.
new --batch FILEwrites several notes from a JSON array, all or none.ls --bodiesprints each note's body too, so one call reads a scope.- A running record (a lane's decisions, appended all day) is a
lognote:relatum append ID --heading "..."adds a dated section, andrelatum get ID --last 2(orrelatum_getwithlast: 2) reads only the end. A log has no word limit and is not a rule. - Working files do not belong in the store, but if they are there, list
their folders in
.swarmnotes/.relatumignore(one path per line,*within a name, a trailing/for a folder) or put an empty.not-notesfile in the folder. Excluded files are invisible to every command and to lint. Names starting with.are never notes. checklints the store.check --summary(andrelatum_checkby default) answers in a few kilobytes however large the store is: counts by problem and by folder, two examples of each, what to do, and.relatumignorelines for folders where nothing looks like a note.- A hand-written header with
titleinstead ofsummarystill loads (the title is the summary, and lint warns). A key Relatum does not know (another tool's, such as a harness field) is kept verbatim and in place whenever Relatum rewrites the note, is a lint warning, and never stops a note from loading. Over MCP, the next call after a note file changed names it if it no longer loads or has a lint error. - Every note has a stamp, the Sigillum
sha256-c1stamp of its file, computed when it is read or written and never stored.relatum_getreturns it (relatum get ID --stampprints it), and every write reply lists each note written asrelatum:<id>with its stamp. A brief can pin a note to the version it was written against,Read first: net/retry-decision@sha256-c1:...; reading the pinned id returns the note withchanged_since_brief: trueif it was edited or replaced since, so the child knows before acting on it. - A note copied in by another tool (Libellus's promote) records where it
came from in
source(libellus:main/retry-q) andsource_stamp; lint checks both. relatum ready --jsonprints one line saying whether the store is usable (ready,missing,damaged, with counts or the first cause), for hosts such as Mem-Harness.
The store is the nearest .swarmnotes/ walking up from the working
directory, or $SWARMNOTES_DIR. Any agent that can read files can take
part, with or without the tools. The full format, the parent/child
protocol, and the lint rules are in SPEC.md.
Install
npm install -g @iron_adamant/relatum # relatum, relatum-mcp, swarmnotes on PATH
npx -y @iron_adamant/relatum --help # or run it without installing
The npm package is a small launcher with no dependencies; npm installs the
one prebuilt binary for this OS and CPU (@iron_adamant/relatum-<os>-<arch>:
Linux and macOS on x64 or arm64, Windows on x64), published with
provenance from this repository's release workflow. From 1.7.0 the server
is also listed in the MCP Registry as io.github.IronAdamant/relatum. As
an MCP server through npm, with nothing installed first:
{
"mcpServers": {
"relatum": {
"command": "npx",
"args": ["-y", "@iron_adamant/relatum", "mcp"]
}
}
}
After npm install -g, "command": "relatum-mcp" works as in
MCP setup.
Or download an archive for Linux or macOS (x64, arm64) or Windows (x64) from
Releases and check it
against SHA256SUMS. Or build it (Rust 1.83 or newer):
git clone https://github.com/IronAdamant/Relatum
cd Relatum
cargo build --release --locked # target/release/relatum and relatum-mcp
Each install gives relatum (CLI), relatum-mcp (MCP server; relatum mcp
is the same), and swarmnotes (the old CLI name). --version on any of
them prints the version. Relatum is not on
crates.io or PyPI; the unscoped examen packages there and on npm are
unrelated projects.
MCP setup
Claude Code (.mcp.json in the project) or Claude Desktop
(claude_desktop_config.json):
{
"mcpServers": {
"relatum": {
"type": "stdio",
"command": "relatum-mcp",
"args": [],
"env": { "SWARMNOTES_DIR": "/absolute/path/to/project/.swarmnotes" }
}
}
}
From the shell: claude mcp add relatum -- relatum-mcp. With npm only, use
"command": "npx", "args": ["-y", "@iron_adamant/relatum", "mcp"].
SWARMNOTES_DIR is needed only when the host does not start the server
inside the project. Cursor (.cursor/mcp.json) takes the same JSON without
"type". Grok Build (.grok/config.toml):
[mcp_servers.relatum]
command = "relatum-mcp"
args = []
env = { SWARMNOTES_DIR = "/absolute/path/to/project/.swarmnotes" }
Tools: relatum_init, relatum_ls, relatum_get, relatum_new,
relatum_edit, relatum_supersede, relatum_check, relatum_append.
Results are compact JSON, and errors say what to call next. Each call is a
model turn, so the tools save turns: relatum_new takes supersedes
(replace a note in one call) and notes (several notes in one call, all or
none), and relatum_ls takes include_bodies (list and read in one call).
The first relatum_new in a project with no store creates it (where
relatum_init would) and says so in its reply; so does the CLI's
relatum new (one line on stderr). relatum_ls, relatum_get
and relatum_check carry readOnlyHint. Behind Mem-Harness
(MEM_HARNESS=1) hints name tools with MEM_HARNESS_TOOL_PREFIX and leave
out standalone setup advice; a hint never names a tool that is switched
off. Each tool's description says when it beats grep or
asking (handoff notes after a context refresh, api notes between agents).
To teach agents the protocol, paste
AGENTS.snippet.md into the project's CLAUDE.md or
AGENTS.md, or install skills/relatum.
Tool groups
Each MCP tool belongs to one group, so an agent can drop the parts it does
not use. Set these in the server's env (names are case-insensitive,
comma-separated, and may be groups or tool names):
RELATUM_TOOLS: allowlist; only these are exposed, pluscore.allmeans everything.RELATUM_DISABLE: hide these, applied afterRELATUM_TOOLS.
| Group | Tools | Overlaps with |
|---|---|---|
core (always on) | relatum_ls, relatum_get, relatum_new | other suite notes groups (Trammel, wikifier) |
revise | relatum_edit, relatum_supersede | none |
lint | relatum_check | none |
setup | relatum_init | none |
log | relatum_append | none |
"env": { "RELATUM_DISABLE": "lint,setup" }
With neither set and no agent-tools lines for relatum, the server's
output is as before, except that it advertises tools.listChanged. Once
something is set, the initialize instructions end with one line naming the
groups that are on and how to change them. A hidden tool is absent
from tools/list, and calling it anyway returns one line saying which
variable to change. An unknown name, or trying to disable core, stops
the server at startup with exit code 2 and a one-line message, so the host
shows it as failed. The tools/list result is 9548 bytes with every
group on and 5079 bytes with RELATUM_TOOLS=core (1.4.0: 7592 and 4301).
relatum_new can supersede with revise off. The CLI ignores both
variables.
Choosing groups
Agents choose the groups per project in the project's AGENTS.md
(the directory that holds .swarmnotes/, or the server's working
directory). The server reads the first fenced block tagged agent-tools
and only the lines for relatum:
```agent-tools
# one agent works here and the store exists
relatum: disable lint, setup
```
relatum: tools <list> is an allowlist; relatum: disable <list> hides
groups or tools. Names are those of the env variables, separated by commas
or spaces. Per key, RELATUM_TOOLS overrides the tools line and
RELATUM_DISABLE overrides the disable line. A mistake in the file never
stops the server: the line is ignored and a warning appears in the
initialize instructions. The server stats AGENTS.md on every request; when
the block changes the tool set, it sends notifications/tools/list_changed
(it advertises tools.listChanged), so the client refetches the list
mid-session. AGENTS.snippet.md has a short
decision table for agents.
Example
relatum init
relatum new net/retry-decision --kind decision --author parent \
--summary "Exponential backoff, max 4 attempts" \
--body "Base 200ms, factor 2, full jitter. Retry only 502/503/504."
# a child, in any subdirectory, later or in parallel
relatum get net/retry-decision _shared/report-format
relatum new net/client/timeout-bug --kind finding --author worker-a \
--summary "Timeouts were not retried" --body "client.py:88 caught them first."
# the parent
relatum ls net # id, kind, summary
relatum ls net --bodies # and each body, in one call
relatum new net/retry-v2 --kind decision --author parent \
--summary "Max 6 attempts" --body "Upstream raised its limit." \
--supersedes net/retry-decision # or: relatum supersede OLD NEW
echo '[{"id": "net/api", "kind": "context", "summary": "Client API",
"body": "retry(fn, attempts=6)"}]' | relatum new --batch -
relatum check
examples/retry-swarm walks through a parent and three children. templates/ has a blank brief and note.
Benchmarks
Relatum 1.5.0 release build on the GitHub Actions runners, medians with
one warmup run dropped (bench/recorded.txt). The small store has 30
notes, the large store 2000, and the big check store 8000, each plus the
report note. ls, get, and check read that store. new and
supersede run on a copy. The MCP row is one process start, an initialize
request, and one ls call. Memory is the peak resident set of check on
the big store.
| Row | Linux | macOS | Windows |
|---|---|---|---|
cli startup (--help) | 0.6 ms | 3.5 ms | 6.2 ms |
| mcp startup + ls round trip | 1.4 ms | 7.0 ms | 10.4 ms |
| init empty | 0.9 ms | 3.6 ms | 11.0 ms |
| init on large store | 0.9 ms | 5.9 ms | 7.9 ms |
| ls small | 0.9 ms | 4.8 ms | 8.5 ms |
| get small | 0.7 ms | 3.2 ms | 6.7 ms |
| check small | 1.1 ms | 3.8 ms | 8.5 ms |
| ls large | 9.2 ms | 25.2 ms | 45.6 ms |
| get large | 0.8 ms | 3.2 ms | 6.7 ms |
| check large | 11.8 ms | 40.9 ms | 56.1 ms |
| new small | 0.8 ms | 6.4 ms | 7.6 ms |
| new large | 0.9 ms | 6.3 ms | 8.0 ms |
| supersede small | 0.9 ms | 4.0 ms | 7.3 ms |
| supersede large | 1.0 ms | 4.4 ms | 7.6 ms |
| check big | 48.9 ms | 166.5 ms | 185.8 ms |
| memory check big (RSS) | 7216 KB | 7056 KB | 9124 KB |
cargo run --release --locked --example bench -- target/release/relatum target/release/relatum-mcp measures again and fails when a row is several
times slower than these figures (see CONTRIBUTING.md).
CI runs it on every pull request.
Coming from Examen
Relatum is the Rust rewrite of Examen 0.3.0 (Python). Examen is frozen,
unsupported, and not part of this repository. Relatum reads the same
.swarmnotes/ files and honours SWARMNOTES_DIR, with no migration. The
CLI is relatum (swarmnotes still works) and the MCP tools are
relatum_* instead of examen_*. What changed for an Examen user:
- MCP argument errors are one line that says what to send, instead of pydantic's multi-line report.
- Tool results are compact JSON; tool descriptions say when to use each tool.
- A summary may be up to 200 characters (Examen: 100) and must be one line.
- New:
relatum_edit,relatum_appendand thelogkind,supersedesandnotesonrelatum_new,include_bodies,limit,sinceanddetailsonrelatum_ls,lastonrelatum_get, a summary fromrelatum_check,relatum ready,.relatumignore, and--version. - The first
relatum neworrelatum_newwith no store creates it whereinitwould; Examen refused and asked forinit.
Changes are in CHANGELOG.md.
License
MIT. See LICENSE.
@iron_adamant/relatumnpm install @iron_adamant/relatumRelated Servers
io.github.IronAdamant/coordinationhub
Shared board for coding agents: identity, file locks, tasks, messages and handoffs.
io.github.IronAdamant/libellus
A private notepad and token ledger per AI agent, plus a shared task board. Survives compaction.
io.github.IronAdamant/mem-harness
One MCP server and one set of Claude Code hooks in front of ten std-only Rust agent tools.