Reference
This page summarizes Memzoi v0's public CLI, MCP, and model values.
CLI commands
| Command | Purpose |
|---|---|
memzoi init | Initialize repo .memzoi/ memory and local runtime state. |
memzoi propose | Propose a new memory record. Built-in default auto-approves valid proposals but does not apply them. |
memzoi proposals | List, show, and bulk-apply proposal inbox state. |
memzoi proposal-files | List, show, validate, and apply OKF proposal files under .memzoi/proposals/pending/. |
memzoi local | Add, list, and search local-only runtime memory records. |
memzoi checkpoint | Add and list runtime session checkpoints. |
memzoi events | Export runtime event-log rows. |
memzoi session-end | Promote explicit structured session-end candidates into proposal files or runtime memory. |
memzoi capture | Plan evidence-backed capture from one explicit Markdown, instruction, ADR, or Git-change source; record a complete review; and route reviewed candidates. |
memzoi approve | Approve a pending or validated memory proposal. |
memzoi reject | Reject a proposed memory. |
memzoi apply | Apply an approved memory proposal into canonical .memzoi/records/*.md. |
memzoi supersede | Atomically supersede an active, non-private repo record with a same-scope repo-safe replacement. |
memzoi tombstone | Atomically tombstone an active, non-private repo record. |
memzoi search | Search active, unexpired memory records. |
memzoi expiry | Inspect a record by ID and explain its expiry eligibility without mutating it. |
memzoi context | Build a prompt-ready context pack for a task. |
memzoi handoff | Build a compact context pack for switching agents or harnesses. |
memzoi precheck | Check planned work against risky memories before acting. |
memzoi export | Export active repo memory into reviewable files. |
memzoi rebuild | Rebuild the derived SQLite database from canonical .memzoi/records/ files. |
memzoi doctor | Check installation and repo memory readiness. |
memzoi eval recall | Evaluate a versioned file-native trust corpus in disposable isolated state. |
memzoi eval capture | Evaluate capture quality, safety, and review burden in disposable isolated state. |
memzoi quickstart | Print or run a tiny first-run workflow. |
memzoi update | Check for or apply a Memzoi release update. |
memzoi mcp | Print MCP integration configuration. |
memzoi integrate | Generate or install agent integration prompts and instructions. |
Run memzoi <command> --help for exact options.
Common command options
| Command | Important options |
|---|---|
init | --force, --json |
propose | --type, --scope-kind, --visibility, --sensitivity, --source-kind, --source-ref, --title, --body, --actor, --manual, --auto-approve, --apply, --json |
proposals list | --status open|pending|validated|approved|rejected|applied|all, --json |
proposals show | <proposal-id>, --json |
proposals apply | --all-approved, --actor, --json |
proposal-files list | --json |
proposal-files show | <proposal-id>, --json |
proposal-files validate | --json |
proposal-files apply | <proposal-id>, --actor, --json |
proposal-files reject | <proposal-id>, --reason, --actor, --json |
local add | --type, --title, --body, --actor, --json |
local list | --json |
local search | <query>, --limit, --json |
checkpoint add | --task, --note or --from-file, --actor, --json |
checkpoint list | --json |
events export | --jsonl |
session-end | --from-file <path> or --from-checkpoint <checkpoint-id>, --actor, --json |
capture plan | --source <project-relative.md> or --request-file <capture-request.{json,yaml}>, --source-bytes <path|-> for supplied_bytes, --source-id, --output, --json |
capture review | --plan-file, --decisions-file, --prior-review-file, --source-bytes <path|-> when replaying supplied_bytes, --reviewed-by, --reviewed-at, --output, --json |
capture apply | --plan-file, --review-file, --prior-review-file, --source-bytes <path|-> when replaying supplied_bytes, --plan-id, --review-id, --actor, --json |
approve | <proposal-id>, --actor, --json |
reject | <proposal-id>, --reason, --actor, --json |
apply | <proposal-id>, --actor, --json |
supersede | <record-id>, --type, --scope-kind, --visibility, --sensitivity, --source-kind, --source-ref, --title, --body, --actor, --json |
tombstone | <record-id>, --reason, --actor, --json |
search | <query>, --scope-kind, --type, --path, --limit, --json |
expiry | <record-id>, --json |
context | --task, --path, --token-budget, --include-local, --include-session, --json |
handoff | --task or --path, --token-budget, --include-local, --include-session, --json |
precheck | --path, --action, --command, --scope-kind, --json |
export | <format>, --scope-kind, --json |
rebuild | --json |
doctor | --project-root, --json |
eval recall | --corpus <path>, --baseline <path>, --update-baseline, --json |
eval capture | --corpus <path>, --baseline <path>, --update-baseline, --json |
quickstart | --apply-sample, --json |
update | --check, --ref, --json |
mcp config | --project-root |
integrate list | --json |
integrate prompt | --profile |
integrate instructions | --profile, --file, --json |
Recall evaluation
Run the checked-in trust corpus without opening or mutating the current project's canonical records, proposal inbox, runtime database, exports, or event log:
memzoi eval recall --corpus evals/recall/quality/corpus.yaml --baseline evals/recall/quality/baseline.json
memzoi eval recall --corpus evals/recall/quality/corpus.yaml --baseline evals/recall/quality/baseline.json --json
--baseline is optional. --update-baseline requires it and is the only mode
that writes the selected baseline. A threshold-failing run is never written:
memzoi eval recall --corpus evals/recall/quality/corpus.yaml --baseline evals/recall/quality/baseline.json --update-baseline
The explicit corpus is strict YAML with version
memzoi-recall-corpus/v2. It references OKF Markdown, proposal, and private
runtime fixtures relative to the corpus, fixes the evaluation clock, declares
aggregate thresholds, and defines tagged cases. Unknown fields are rejected.
The following abridged excerpt shows the search and precheck shapes; a complete
v2 trust corpus must also declare proposal/runtime fixtures, context and
write-gate cases, and forbidden opportunities for every required safety
category:
version: memzoi-recall-corpus/v2
name: project-trust-v2
evaluated_at: 2026-07-10T12:00:00Z
records_root: records
records:
- package-manager.md
- package-manager-warning.md
- unrelated-package-manager.md
thresholds:
min_mean_recall_at_k: 1.0
min_mean_mrr: 1.0
min_precheck_precision: 1.0
min_precheck_recall: 1.0
max_stale_leakage_rate: 0.0
max_expired_leakage_rate: 0.0
max_scope_leakage_rate: 0.0
max_forbidden_hit_rate: 0.0
min_citation_integrity: 1.0
min_provenance_integrity: 1.0
min_case_pass_rate: 1.0
max_estimated_usage: 500 # Per-case maximum; corpus total is reported separately.
# max_p95_latency_ms: 50
cases:
- surface: search
id: package-manager-decision
query: package manager
relevant_ids: [package-manager]
forbidden:
scope: [unrelated-package-manager]
scope_kind: repo
type: decision
lane: semantic
path: package.json
k: 5
- surface: precheck
id: package-manager-precheck
path: package.json
scope_kind: repo
relevant_ids: [package-manager-warning]
Case surface selects one strict shape:
searchaccepts a query, top-k limit, relevant IDs, categorized forbidden IDs, optional scope/type/lane/path filters, and an optional proposal fixture.precheckaccepts path/action/command inputs, scope, and expected warning IDs.contextaccepts task/path/budget inputs, local/session opt-ins, and expected included or forbidden destinations.write_gatedeclares a prohibited candidate, expected policy issue code, and a record ID that must remain absent.
JSON output uses memzoi-recall-report/v2. Its definitions object explains
the versioned formulas, while runtime reports the Memzoi/SQLite environment,
timer, isolated-state guarantee, and estimator. metrics contains:
- search case count, mean recall at k, and mean MRR;
- micro precheck precision/recall with true-positive, false-positive, and false-negative counts;
- stale, expired, scope, prohibited, destination, and total forbidden leakage as hits, opportunities, and rates;
- citation and provenance integrity as valid/checked ratios;
- deterministic
approx_wordsusage totals and distribution; - nearest-rank p50/p95 monotonic-clock latency; and
- the overall case pass ratio.
Empty precision/recall/integrity denominators resolve to 1.0; empty leakage
denominators resolve to 0.0. Threshold comparisons use the underlying values,
not their display rounding.
The typed memzoi-recall-baseline/v1 artifact contains only deterministic
metrics and per-case outcomes. Runtime metadata and observed latency are not
exact-compared. A baseline comparison has status match, changed, or
incompatible: deterministic changes are reported for review but remain
informational, while an incompatible corpus/schema identity fails the report.
Corpus thresholds remain the regression gate. A valid corpus prints its full
report before a threshold or baseline failure returns non-zero; corpus or
fixture validation errors return non-zero without a report.
Capture evaluation
Run the checked-in capture quality gate from isolated temporary projects:
memzoi eval capture \
--corpus evals/capture/corpus.yaml \
--baseline evals/capture/baseline.json
memzoi eval capture \
--corpus evals/capture/corpus.yaml \
--baseline evals/capture/baseline.json \
--json
The strict memzoi-capture-corpus/v1 YAML names every required extractor
profile, explicit source fixture, expected candidate and exact evidence span,
classification, routing action, forbidden candidate, review outcome, and
optional stale-source check. Unknown fields, escaping fixture paths, duplicate
IDs, invalid expectations, and unaccounted profiles are rejected.
The memzoi-capture-report/v1 report contains aggregate and per-profile
candidate precision/recall, evidence validity, destination/sensitivity/action
accuracy, forbidden-hit rate, unsupported-outcome accuracy, review-burden
counts, payload observations, and p50/p95 latency. Its non-waivable hard gates
require deterministic no-write planning, valid evidence from named sources, no
unnamed evidence or undeclared policy reads, no prohibited-content echo,
stale-source identity rejection, and execution of every required profile.
--baseline is optional. When present, capture requires an exact match with the
typed memzoi-capture-baseline/v1 deterministic projection; unlike observed
latency and payload metadata, any changed deterministic metric, profile
fingerprint, hard gate, or case outcome fails. Update an accepted change only
after every gate passes:
memzoi eval capture \
--corpus evals/capture/corpus.yaml \
--baseline evals/capture/baseline.json \
--update-baseline
See the evaluation contributor guide for metric definitions and fixture guidance.
Evidence-backed capture
Capture turns one explicitly named project source into evidence-linked memory
candidates without ambient repository scanning or inference from chat, shell
history, or hidden agent state. The legacy --source shorthand selects the
markdown-deterministic profile; --request-file accepts the complete strict
JSON or YAML request needed by instruction, ADR, and Git-change profiles. Its
three CLI stages keep extraction, human judgment, and writes separate:
memzoi capture plan \
--source notes/session-findings.md \
--source-id session-findings \
--output capture-plan.json \
--json
memzoi capture review \
--plan-file capture-plan.json \
--decisions-file capture-decisions.json \
--reviewed-by zoki \
--reviewed-at 2026-07-10T12:00:00Z \
--output capture-review.json \
--json
memzoi capture apply \
--plan-file capture-plan.json \
--review-file capture-review.json \
--plan-id capture_... \
--review-id review_... \
--actor zoki \
--json
plan and review do not write memory state. --output optionally writes the
complete JSON artifact, while --json prints it; without --json, the command
prints a human-readable view. Request, plan, decision, and review artifacts
must be regular, nonsymlink UTF-8 files no larger than 2 MiB. Artifact output
is installed without replacing an existing path. The artifact's data class
also constrains where it may be saved, as described below.
Deterministic Markdown profile
The markdown-deterministic profile accepts exactly one regular UTF-8 .md file named by a POSIX
project-relative path. Absolute paths, traversal components, backslashes, .memzoi, symbolic
links, non-Markdown files, and files larger than 1 MiB are rejected. The source is read only from
the current project; capture never searches for additional inputs. The profile also caps a plan at
100 candidates, 4,096 Markdown headings, 16 KiB per evidence item, 256 KiB of total evidence, a
bounded 10,000-file/32 MiB duplicate inventory, and a serialized plan just under 2 MiB.
The extractor profile is markdown-deterministic. Plans identify the concrete extractor as
id: memzoi-markdown, together with its version and configuration hash.
Capture file access and private artifact saving currently require Unix handle-relative, no-symlink primitives. Windows builds fail these capture operations closed; the rest of the CLI remains available there.
The extractor recognizes ATX headings outside fenced code blocks. A heading prefix determines the type, lane, destination, and sensitivity of the section that follows it:
| Heading prefix | Type and lane | Planned route |
|---|---|---|
Fact: | fact, semantic | Repo-safe pending proposal |
Decision: | decision, semantic | Repo-safe pending proposal |
Procedure: | procedure, procedural | Repo-safe pending proposal |
Warning: | warning, semantic | Repo-safe pending proposal |
Failed attempt: | failed_attempt, episodic | Repo-safe pending proposal |
Risk: | risk, semantic | Repo-safe pending proposal |
Preference: | preference, semantic | Local-only runtime record |
Episode: | episode, session | Temporary session runtime record |
For example:
## Decision: Verify downloaded release archives
Verify the SHA-256 checksum before extracting a release archive.
Each candidate contains the exact source locator, source and evidence hashes, byte and line
spans, heading kind, extractor identity, and deterministic claim/candidate identities. Planning
also compares candidates with canonical records, pending proposals, active runtime memory, and
earlier candidates in the same source. Exact matches become no-write duplicates; same-scope,
same-title disagreements become conflicts requiring lifecycle resolution. A document without a
recognized typed heading becomes needs_review with unknown sensitivity rather than being
silently routed. In a mixed document, nonempty preamble text and untyped sections produce
identity-covered unsupported_markdown_content diagnostics with their source ID and starting
line, so typed extraction cannot silently hide unsupported regions.
The same source bytes and relevant memory inventory produce the same plan. The plan_id pins the
request, source snapshot, extracted candidates, duplicate/conflict match sets, reserved proposal
IDs, policy/configuration versions, and preconditions. Planning opens existing runtime inventory
read-only and does not create or change .memzoi/, SQLite, proposal, export, or event state.
If runtime inventory is missing or cannot be read safely, affected local/session candidates become
needs_review no-write actions with a stable warning. Unaffected repo-only candidates retain the
same identity they would have against an empty runtime inventory.
Instruction, ADR, and Git-change profiles
Extension profiles use a complete memzoi/capture-request-v1 artifact. For
example, this request captures one explicitly named agent instruction file:
schema: memzoi/capture-request-v1
sources:
- source_id: agent-rules
locator:
kind: project_path
path: AGENTS.md
media_type: text/markdown
extractor:
profile: instruction-deterministic
memzoi capture plan --request-file capture-request.yaml --output capture-plan.json --json
The profiles and accepted source shapes are closed sets:
| Profile | Accepted explicit source | Extraction and routing boundary |
|---|---|---|
instruction-deterministic | One project_path whose basename is AGENTS.md or CLAUDE.md | Preamble and nonempty sections become scoped procedures by default; typed headings retain their typed memory mapping. A nested instruction file scopes candidates to its parent directory. Memzoi-generated marker blocks and whole generated projections are excluded. Temporary, session, WIP, scratch, personal, private, or local-only markers in headings, preambles, or section bodies become needs_review with unknown sensitivity. |
adr-deterministic | One Markdown project_path, or one project_directory with ignore_policy: git-v1 and include: ["*.md"] | Recognizes ADR context, decision, consequences, risk, and supersession fields. Accepted/adopted/approved ADR fields may route repo-safe, except supersession always requires lifecycle review. Draft, rejected, superseded, deprecated, or unknown status remains needs_review. |
git-change-deterministic | One .diff/.patch project_path plus explicit Git context, one supplied_bytes descriptor plus explicit Git context and transport bytes, or one immutable git_range | Parses strict unified Git diffs and extracts typed added Decision, Procedure, Warning, Risk, and Failed attempt sections. Typed deleted guidance is preserved as an old-side needs_review candidate and cannot route directly to repo memory. Evidence records revisions, blobs, old/new paths, change kind, hunk identity, side, and line coordinates. Unsupported additions and rename-only changes produce diagnostics instead of speculative memory. |
ADR directory capture sorts a bounded set of Markdown members, follows the
repository's .gitignore policy, never enters .git or .memzoi, and snapshots
both member content and ignore-policy inputs. Its locator shape is:
locator:
kind: project_directory
path: docs/adr
recursive: true
ignore_policy: git-v1
include: ["*.md"]
Git-change sources never infer revision identity from ambient HEAD. Git range
rendering requires Git 2.43 or newer and is capped at 512 changed files and
4,096 diff hunks. A
project diff names git.repository, git.base, and git.head; a git_range
instead carries repository, full base/head object IDs, merge_parent
(base_to_head or first_parent), rename_detection, and
diff_format: git-unified-v1 inside the locator. The range loader resolves and
pins commit objects, runs a bounded deterministic local Git diff with quoted
paths and attributes pinned, and does not change the worktree, index, refs, or
configuration. The bounded local repository configuration is prohibited-scanned,
rejects external includes, and is identity-covered; inherited Git tracing and
configuration environments are cleared. Applicable .gitignore files are read
only from the explicitly named head tree and are likewise prohibited-scanned and
identity-covered; project and supplied diff sources do not consult ambient
worktree ignore files. Combined and binary diffs, non-regular evidence modes,
unsafe paths, and unsupported diff forms fail closed.
A supplied_bytes request additionally pins a safe display name,
media_type: text/x-diff, exact byte length, and
blake3:<64-lowercase-hex> source content hash. The bytes are transported
separately and are never read from ambient stdin. Pass the same exact bytes at
all three trust boundaries:
memzoi capture plan \
--request-file supplied-diff-request.yaml \
--source-bytes reviewed.diff \
--output capture-plan.json \
--json
memzoi capture review \
--plan-file capture-plan.json \
--decisions-file capture-decisions.json \
--source-bytes reviewed.diff \
--reviewed-by zoki \
--reviewed-at 2026-07-11T12:00:00Z \
--output capture-review.json \
--json
memzoi capture apply \
--plan-file capture-plan.json \
--review-file capture-review.json \
--source-bytes reviewed.diff \
--plan-id capture_... \
--review-id review_... \
--actor zoki \
--json
Use --source-bytes - only to select stdin explicitly. Missing, extra,
changed, oversized, symlinked, or non-regular transport bytes fail before a
review or write. Project-path, directory, and Git-range requests reject
--source-bytes.
Data classes and review
Every plan and review has one conservative data_class:
repo_safemeans every routeable candidate is explicitly repo-safe and repo-bound. The artifact may be saved to a normal review location, but never under.memzoi, the private runtime directory, or generated exports.privatemeans the artifact contains or derives from local/session/private or unresolved material. CLI output may be printed, but--outputis accepted only under the project's private runtime directory, never under the project root or generated exports.blockedmeans a prohibited credential, known secret token, private key, private-personal-data, or raw-transcript pattern was found. The redacted plan omits source snapshots, candidates, and evidence text, reports only safe diagnostics, cannot be reviewed, and may only be emitted to standard output.
The strict review-input artifact must decide every candidate exactly once. This JSON example accepts one candidate:
{
"schema": "memzoi/capture-review-input-v1",
"plan_id": "capture_...",
"decisions": [
{
"candidate_id": "candidate_...",
"outcome": "accept"
}
]
}
Outcomes are accept, reject, edit, and defer. Accept keeps a routeable extracted
candidate. Reject and defer produce no write. Edit requires a complete replacement memory draft
and may request a destination; policy is reapplied to the edited candidate. Duplicates cannot be
accepted as new memory, conflicts require separate lifecycle resolution, and a no-write candidate
must be edited, rejected, or deferred. reviewed_by must be non-empty and reviewed_at must be an
explicit RFC 3339 time. The resulting review_id pins the plan, reviewer, time, complete decision
set, and any reviewed candidate edits.
A later review may replace deferred decisions only. Set prior_review_id in the next
capture-review-input-v1 artifact and pass the complete predecessor with
--prior-review-file <capture-review.json>. Core verifies the prior review identity, requires the
same plan, preserves every terminal decision byte-for-byte after normalization, and binds the new
review ID to its predecessor. Applying that later review also requires the immediate predecessor
through capture apply --prior-review-file; apply repeats the lineage validation at the locked
transaction boundary. The v0.4 profile supports one predecessor hop. A review whose predecessor
already names an earlier review is rejected until a future interface can carry and validate the
complete ancestor chain.
Review recomputes the plan before creating an artifact. Apply validates the supplied plan and review identities, reconstructs the review, and recomputes current source/inventory preconditions again before writing and after acquiring the repo lifecycle lock when needed. A changed source, new duplicate/conflict, consumed proposal ID, altered artifact, or mismatched expected ID is a stale zero-write error.