Repository avatar
Other Tools
v1.7.1
active

relatum

io.github.IronAdamant/relatum

Pass-by-reference notes for agent swarms, over the same files as the CLI.

Documentation

Relatum

Formerly Examen.

License: MIT

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, and format notes. Children write finding and attempt notes 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 supersede the old ID (or pass --supersedes OLD to new, one step); get on the old ID follows the chain. For handoffs written as deltas, relatum_get with include_superseded also returns the notes the live one replaced.
  • ls --since 2026-11-06 lists what was written or changed since local midnight that day; a time such as 2026-11-06T09:30:00Z or 2026-11-06T09:30+11:00 works too.
  • Every write lands whole, so agents in parallel never read a half-written note.
  • new --batch FILE writes several notes from a JSON array, all or none. ls --bodies prints each note's body too, so one call reads a scope.
  • A running record (a lane's decisions, appended all day) is a log note: relatum append ID --heading "..." adds a dated section, and relatum get ID --last 2 (or relatum_get with last: 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-notes file in the folder. Excluded files are invisible to every command and to lint. Names starting with . are never notes.
  • check lints the store. check --summary (and relatum_check by 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 .relatumignore lines for folders where nothing looks like a note.
  • A hand-written header with title instead of summary still 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-c1 stamp of its file, computed when it is read or written and never stored. relatum_get returns it (relatum get ID --stamp prints it), and every write reply lists each note written as relatum:<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 with changed_since_brief: true if 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) and source_stamp; lint checks both.
  • relatum ready --json prints 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, plus core. all means everything.
  • RELATUM_DISABLE: hide these, applied after RELATUM_TOOLS.
GroupToolsOverlaps with
core (always on)relatum_ls, relatum_get, relatum_newother suite notes groups (Trammel, wikifier)
reviserelatum_edit, relatum_supersedenone
lintrelatum_checknone
setuprelatum_initnone
logrelatum_appendnone
"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.

RowLinuxmacOSWindows
cli startup (--help)0.6 ms3.5 ms6.2 ms
mcp startup + ls round trip1.4 ms7.0 ms10.4 ms
init empty0.9 ms3.6 ms11.0 ms
init on large store0.9 ms5.9 ms7.9 ms
ls small0.9 ms4.8 ms8.5 ms
get small0.7 ms3.2 ms6.7 ms
check small1.1 ms3.8 ms8.5 ms
ls large9.2 ms25.2 ms45.6 ms
get large0.8 ms3.2 ms6.7 ms
check large11.8 ms40.9 ms56.1 ms
new small0.8 ms6.4 ms7.6 ms
new large0.9 ms6.3 ms8.0 ms
supersede small0.9 ms4.0 ms7.3 ms
supersede large1.0 ms4.4 ms7.6 ms
check big48.9 ms166.5 ms185.8 ms
memory check big (RSS)7216 KB7056 KB9124 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_append and the log kind, supersedes and notes on relatum_new, include_bodies, limit, since and details on relatum_ls, last on relatum_get, a summary from relatum_check, relatum ready, .relatumignore, and --version.
  • The first relatum new or relatum_new with no store creates it where init would; Examen refused and asked for init.

Changes are in CHANGELOG.md.

License

MIT. See LICENSE.