WhiteMagic
A local-first memory layer for MCP agents.
WhiteMagic gives an AI agent durable project memory over MCP: record important context, find it after restart, and carry useful decisions into the next session — without sending your memory store to any hosted service.
You are an agent reading this repo? Start with skill.md (five-minute operational onboarding) and llms.txt (machine-readable index).
{
"mcpServers": {
"whitemagic": {
"command": "/absolute/path/to/wm",
"args": ["--store", "/absolute/path/to/whitemagic/gen3", "serve", "--profile", "cyberbrain"]
}
}
}
Check the claims instead of trusting them
Five-minute verification path: VERIFY.md — source, the zero-egress proof you can run yourself, release signatures and SBOMs, and what a receipt signature does not establish. Security posture in SECURITY-INSIGHTS.yml; who decides what in GOVERNANCE.md.
Verified Standards & Benchmark Scorecard (November 2026)
| Verification / Benchmark Surface | Scope & Artifact | Verified Outcome |
|---|---|---|
| Individual SCITT-related Internet-Draft | draft-bailey-scitt-agent-session-receipt-00 | Linked individual draft; this is not a claim of working-group adoption or an IETF standard |
Agent Memory Integrity (agmi) scorecard | AGMI maintainer Yasha Khandelwal independently reproduced the fixture results against crystal_client.py at 273b177b. AGMI published the three rows on November 17, 2026. | The default local store rejected 10/10 fixture edits on verified read with the current commitment kept outside the store. The in-store comparison rejected 8/10 on read. The ciphertext audit reported 10/10 during audit without the key-encryption key. |
| v1.2 assisted development replay | 105 reused/authored items; expected states enter delivery, and failed or incomplete model outputs receive fixture-derived replacements | Retained debugging result only. Its reported 105/105 is not a clean answer-quality or unseen-holdout result; citation membership does not establish factual support. |
| Temporal As-Of & Knowledge-Cutoff Suite | 256 queries across 32 project streams (temporal_assert / temporal_query) | 256 / 256 (100.0%) reference parity in 206.75 ms (0.81 ms/query vs 192/256 naive latest-write control) |
| Valkyrie-2 Tricameral CPU Organ | 512-D Sutra Canon + 653 real 384-D X bookmarks (29.16 KB model) | 100.0% Sutra / 98.8% Choice / 91.1% 384-D accuracy at ~10 µs (10,310 ns) mean CPU latency |
Strict Zero-Write Inspection (StrictZeroWrite) | wm inspect --promise strict-zero-write on 2.23 GiB store (419,510 records) | 0 bytes modified (data.mdb and lock.mdb pre/post SHA-256 identical; runs on chmod 0555 mounts) |
| Third-Party Signed MCP Baseline | Dominion Observatory (dominion.capture.v1, Issue #28) | Independent Ed25519-signed 57-tool manifest witness (a067fe1a...) |
The separate 2 November controlled answer trial used 24 fresh questions, native
candidate 7f37a368, and Qwen2.5-0.5B Q4_K_M. Required evidence was present in all
22 support-bearing cases, but complete answer/state/citation delivery passed
0/24. Seven of 21 answerable cases had the correct value with irrelevant
citations; four outputs were invalid and two held cases received inappropriate
answers. This small fictional workload does not grade the configured product
answer path or establish general model performance. Earlier replay inputs and
raw results remain retained; they are not rescored as independent evidence.
Hosted services (separate from the local package)
-
Remote MCP —
https://mcp.whitemagic.dev/mcp(streamable-http): read-only recall over a curated public corpus; keyless discovery; evaluation keys with a published 50 recalls/day allowance; OAuth 2.1; x402 session lease options published as $0.01 for 5 minutes or $0.50 for 24 hours, with a published 10,000 RPM limit; andmemory.search_batchfor up to 10 queries in one MCP call. These limits and options are described by the live server card; the batch tool is also present in the livetools/listresponse. Your local store is not uploaded to this read-only recall lane. -
Receipt verification and agent trust API —
https://api.whitemagic.dev: statelessPOST /verifyfor continuity-receipt bundles (/healthand/infokeyless), plus a published/erc8004/validateadapter targeting Base. See the API's live service metadata and endpoint documentation for the advertised contract. -
Memory Crystal client and API —
scripts/crystal_client.pyseals and opens crystal envelopes locally with AES-256-GCM or ChaCha20-Poly1305 (install the optional dependency withpython3 -m pip install cryptography). The API documentation lists crystal store, fetch, and lineage endpoints; successful hosted persistence and retrieval are not implied by local encryption support.The helper is distributed as source in this repository; it is not bundled into the
wmbinary or platform installers. Use the helper from the source revision matching the server/API you intend to use. Generate a client key into a protected file withpython3 scripts/crystal_client.py genkey --out crystal.key, then pass that file tosealandunsealwith--key.sealobtains the owner locator from the authenticated/crystals/owner-locatorendpoint. This requires an owner credential and an existing registry mapping; a payment or session pass does not establish ownership. If an existing crystal is unmapped, use the contact page to request a manual ownership review.Supply the bearer credential through the
WM_CRYSTAL_TOKENenvironment variable or--token-file /path/to/credential. Token files must be regular, non-symlink files with mode0600or stricter. Do not put credentials in command-line arguments or send plaintext or encryption keys to support.seal,push,pull, andlineagerequire authenticated owner access;seal,pull, andlineageno longer accept--tenant; keyless pulls and lineage queries are no longer supported. The former tenant-hash CLI flow is a breaking change.
Status
WhiteMagic Gen3 (the wm 11.2.1 line, unifying the Gen 2 v9 operational contract and CPR 0.5 bundle portability into the Gen 3 kernel). Release channel: open
alpha — public alpha for MCP agents. The version number is a compatibility
signal; the channel is an evidence claim (beta and stable each require their
own exit conditions, not a version milestone).
- Install path: Linux x86-64, Linux arm64, and macOS arm64 (v10/v11 open-alpha matrix) — the active build and public-installer certification targets (Windows x86_64 and Intel macOS x86_64 remain on the stable Gen 2
v9.3.4release line; they are absent from this matrix). Linux packaging requires glibc 2.39+. The installer prefers gzipped distributables when available. Consult the exact signed manifest and completed release-health record for published assets and installer results; source builds and earlier hardware observations do not certify a new release. Windows uses the separate historical line throughscripts/install.ps1. - Support window: the current minor and the previous minor on the install-gated lines receive fixes; older minors are archival — see
SECURITY.md. - Trusted, local-first, single-user operation with Landlock containment and firebreak guards.
- Unsafe-code policy and test evidence: policy varies by crate; LMDB/mmap, POSIX shared memory, and Linux confinement use platform-specific unsafe code. Earlier Gen 2/3 audit counts describe their measured source revisions, not the current release. Use the exact source's CI results and the signed release manifest's optional test snapshot; a missing snapshot is not a passing tally.
What it does
The supported alpha contract:
- trusted, local, single-user operation;
- explicit MCP routes for dependable behavior;
- durable memory creation and lexical search without an external model;
- session record, replay, and cross-session continuity;
- an end-to-end install invariant (
wm selftest) with host-health diagnostics; - no telemetry by default and no required WhiteMagic cloud service;
- truthful degradation when optional models or embeddings are unavailable.
Install
Install the published Gen 3 v11.2.1 on Linux x86-64 or ARM64 with glibc 2.39 or newer, or on Apple Silicon macOS. For Windows and Intel macOS, use the Gen 2 fallback instructions.
curl -fsSL 'https://www.whitemagic.dev/install.sh?ref=readme' | sh -s -- --version v11.2.1 --dir "$HOME/.local/bin"
"$HOME/.local/bin/wm" --version
"$HOME/.local/bin/wm" grimoire --plan
Use the absolute path to verify in the same terminal. Run
export PATH="$HOME/.local/bin:$PATH" there to use wm by name. The Grimoire
plan previews the store and detects client configuration locations. Confirm
the connection in your MCP client after you configure it.
For a manual install, use the download and checksum instructions.
Try one local memory with a temporary store. Each command launches a separate process.
wm_demo_store=$(mktemp -d) &&
"$HOME/.local/bin/wm" --store "$wm_demo_store" remember 'The demo project is Juniper.' &&
"$HOME/.local/bin/wm" --store "$wm_demo_store" recall 'Juniper'
Other channels
These commands are not one release. npx whitemagic-mcp follows the npm
latest tag, which is the current open-alpha release (11.2.1).
cargo install whitemagic and the Docker tag 9 are the Gen2 9.3.4 line.
Docker Hub also publishes a tag for the current release, 11.2.1.
npx whitemagic-mcp serve # npm latest (open alpha)
cargo install whitemagic # crates.io (Gen2 9.3.4)
docker run -i lbailey94/whitemagic:9 serve # Docker Hub Gen2 tag
Adoption snapshot (2026-10-16): 5,680 npm downloads · 6,173 Docker Hub pulls · 322 crates.io downloads. Package installs are independent of the installer and grew without any website CTA — the memory layer chooses its own doors.
wm grimoire --plan --json prints a machine-readable plan. wm selftest
runs diagnostics against a throwaway store and checks host health. See
docs/SELFTEST_AND_HOST_HEALTH.md.
Everyday commands
wm status # store, epoch, record counts, store health
wm selftest # install invariant + host health (--json, --strict)
wm remember "decision text" # record a memory (--galaxy, --source, --kind)
wm recall "query" # search memories (--limit, --historical, --scope)
wm session list # sessions: checkpoint | record | continuity | list
wm wiki --out ./wiki --limit 128 # export store to Merkle-anchored Holographic Wiki (_index.md)
wm wave4-benchmark --json # run Wave-4 Takwin & trace-shrinking benchmark (PEB-23..25)
wm backup ./gen3-backup # snapshot store + SHA256SUMS manifest (--json)
wm restore ./gen3-backup # verify SHA256SUMS and restore to a fresh store (--json)
wm --store "$HOME/.local/share/whitemagic/gen3" serve --profile cyberbrain
The v9-only commands (doctor, connect, setup, quickstart,
update, seal, verify, trust, anchor) belong to the wm9
binary line; wm backup, wm restore, and wm verify-receipt are natively supported in wm 11.2.1.
Connect an MCP client
Add WhiteMagic using your client's setup recipe and restart the client. Claude Code · Cursor · Codex CLI · OpenCode
The client starts the server over stdio. Use the preferred profile in its configuration and specify a Gen 3 store:
wm --store "$HOME/.local/share/whitemagic/gen3" serve --profile cyberbrain
wm --store "$HOME/.local/share/whitemagic/gen3" serve --profile full
For clients using the mcpServers format above, substitute the executable's
absolute path and the expanded store path, for example the output of
printf '%s\n' "$HOME/.local/share/whitemagic/gen3".
The server communicates over stdio. Two profiles exist:
cyberbrain(default) — the lean MCP surface, includingmemory_recall,memory_remember,memory_get,memory_stats, thewmmeta-tool (explicitroute=dispatch to the catalog),session_checkpoint,session_continuity,session_record,session_list,galaxy_list,galaxy_fork,mesh_sync.full— the extended MCP catalog covering memory CRUD, search, sessions, receipts, galaxies, mandala, gnosis, sangha, and mesh; optional features add gated routes (decision.shortlist,decision.deliberate,decision.outcome,systemone.decide) when compiled in. The route count is whatever the running binary registered; itstools/listresponse andwm contract --jsonare the authorities for their respective surfaces.
Explicit routing is the dependable contract:
wm(route="memory.create", args={...})wm(route="session.start", args={...})wm(route="galaxy.list", args={})
Privacy and data
- Your store lives locally at
~/.local/share/whitemagic/gen3(resolution order:--store <path>→$WM_STORE→$WM_STORE_PATH→~/.local/share/whitemagic/gen3, falling back to./gen3-storeonly if$HOMEis unset). Nothing is sent to WhiteMagic-operated services; there is no telemetry by default (any future sharing is opt-in, previewable, and schema-bound). - Privacy flags exclude memories from responses and reasoning. They are access controls, not encryption — anyone who can read the store files can read the contents. Do not store credentials in memories.
- Conversation capture happens through explicit tool calls, not automatically.
Backup and restore
In this candidate, use wm backup <dest_dir> [--json] and wm restore <backup_dir> [--json]
to copy and check store files against a SHA256SUMS manifest. The source must
be quiescent and unchanged for the full backup; this command does not stop or
coordinate writers. A manifest stored with the backup detects accidental
changes but does not authenticate its source or establish completeness if
both files and manifest are altered. Restore requires a fresh destination
under a private, exclusively controlled parent; --force is disabled.
Neither operation guarantees durability across a crash or resists concurrent
malicious changes to the source or destination tree.
# Coordinate all writers for this store, including servers, timers and sidecars;
# keep the source unchanged until the copy finishes, then resume prior writers.
wm --store "$HOME/.local/share/whitemagic/gen3" backup /path/to/external/disk/gen3-$(date +%F) --json
# Restore only to a fresh path beneath an existing private directory:
wm --store /path/to/private-parent/restored restore /path/to/external/disk/gen3-YYYY-MM-DD --json
# Or, under the same writer coordination, copy the whole store root:
cp -a ~/.local/share/whitemagic/gen3 /path/to/external/disk/gen3-$(date +%F)
- Keep at least one copy on a different disk or machine.
- After restoring a copy, verify it with
wm selftestand inspect it withwm status. - Transaction rollback (
mandala/session internals) is a short-lived undo, not a substitute for backups.
Research surface (not part of the alpha contract)
The codebase contains a larger research system beyond the product boundary:
autonomous cycles, dream consolidation, bicameral reasoning, an imagination
engine, self-play training loops, polyglot sidecars (Julia/Haskell/Zig/Koka),
a signed multi-agent mesh, holographic memory coordinates, and the rest of the
route catalog reachable via wm serve --profile full plus the optional
feature-gated routes. wm contract --json is the authority for the compiled
route set. These are research surfaces without product acceptance evidence;
they may change or be removed. Only surfaces documented in this README are part
of the product contract.
Building from source
Requires Rust 1.92+; this repository pins Rust 1.98.0 for builds and checks:
cargo build --release
cargo test # full test suite
cargo clippy --all-targets
Authored Memory-Task Evaluation (32 Scenarios)
benchmarks/pinned_task_eval.py runs 32 authored scenarios, eight each for continuity, conflict, record-addressed repair, and cue-guided deterministic migration. The final frozen run is tied to public source commit 766edb2, a local source-derived candidate whose exact version and binary hash are recorded in the task report. It is not the separately signed release binary; this run does not qualify the current public-main release. The machine-readable results are archived with the evaluation. The historical 19169fa result JSON remains available separately.
- Continuity: WhiteMagic scored 8/8 on decision recall, open-arc precision, cross-session crystal surfacing, and new-session track routing. The structured-metadata file baseline also scored 8/8 on decisions and arcs under the same salience rules.
agent_context.textstayed within a 1,120 UTF-8-byte cap (largest 1,091; mean of per-context ceil(bytes/4) estimates 266.625). This is a byte-based estimate, not a tokenizer guarantee; transport/debug metadata is excluded. - Conflict: governed current truth and verifiable revision lineage scored 7/7. All-case current truth was 7/8 because M8 is an intentional unlinked-contradiction negative control; unlinked contradictory text is not a supersession operation. Structured files matched on governed conflict.
- Repair: WhiteMagic scored 8/8 for rank-one repaired identity, poison-free top-three recall, audit-trail verification, and legitimate-neighbor preservation. Equal-information record-addressed files scored 4/8 at rank one and 5/8 for joint repair-and-preserve in the top three.
- Cue-guided migration: 8/8 end-to-end success, target precision/recall, and converging-DAG verification; all 24 legitimate neighbors were preserved. These cases supply exact stale clues, query, and authoritative replacement.
These are scripted authored cases, not an open-ended model study: there is no connected model, unseen holdout, or autonomous-agent evaluation. Structured files tie WhiteMagic on continuity, governed conflict, and discovery; baseline wire overheads differ. Salience and discovery use bounded text patterns that can misread quoted, negated, stale, speculative, or unfamiliar phrasing; they do not independently prove authority or truth. Latency includes fresh process startup and unequal tool batches, so the run establishes no latency or cost advantage.
Reproduce with the reviewed candidate binary and the archived harness:
WM_BINARY=/absolute/path/to/reviewed/wm python3 benchmarks/pinned_task_eval.py
python3 -m unittest discover -s benchmarks -p test_pinned_task_eval.py
Documentation
docs/INDEX.md— map of the documentation treedocs/DEVELOPER_GUIDE.md— workspace layout, build, test, and architecturedocs/SELFTEST_AND_HOST_HEALTH.md—wm selftestchecks, thresholds, and--strict/--jsoncontractsdocs/STORE_LAYOUT.md— Gen3 store layout and database structuredocs/SUTRA_GUIDE.md— Sutra and tool dispatch referenceINSTALL.md— source build, store setup, optional model layerskill.md— five-minute agent onboardingllms.txt— machine-readable indexdocs/CHARTER.md— binding constitutional corecontinuity-receipt— signed, offline-verifiable records of governed tasks (separate spec repo, Apache-2.0)CHANGELOG.md— release notesSECURITY.md— reporting vulnerabilities
Migrating from v26 / Gen2 (LMDB stores)
If you ran the retired Python version (v26) or an earlier Gen2 line, audit and
migrate its LMDB store (the directory containing data.mdb) into Gen3:
wm census ~/.whitemagic/users/local/galaxies/lmdb # zero-dependency audit
wm migrate --source ~/.whitemagic/lmdb --dry-run # preview
wm migrate --source ~/.whitemagic/lmdb # migrate into the Gen3 store
wm migrate-all --source-root <projects-root> --target-root ~/.local/share/whitemagic/gen3-projects
wm quarantine <file> reviews the migration quarantine log; a WM_STORE/--store
override selects the destination.
The stack
Local memory → governed execution → verifiable continuity
whitemagic— local-first memory and session continuity for AI agentscontinuity-receipt— portable, offline-verifiable evidence for governed tasks (Apache-2.0)mandala— bounded agent execution and Landlock LSM governance kernelwhitemagic-plugins— client integrations and adapters
Each repository stands on its own: WhiteMagic does not require Mandala, and
Continuity Receipt does not require WhiteMagic. Three entrances — use it →
whitemagic; review a protocol → continuity-receipt; attack the
security architecture → mandala.
License
MIT © Lucas Bailey and WhiteMagic Contributors
Support and security
- Support: open an issue at https://github.com/lbailey94/whitemagic/issues
- Support the lab (voluntary, not a service payment): Base USDC tip jar
0x213b6bB4fB073E86167c58DA6Cb6E9477557DaA8· XRPL tip jarraakfKn96zVmXqKwRTDTH5K3j5eTBp1hPy— see https://www.whitemagic.dev/support. Services are paid via x402 or evaluation keys; the tip jar unlocks nothing. - Contributing:
CONTRIBUTING.md - Security: email security@whitemagic.dev (please do not open public issues for security reports)