Skip to content

Latest commit

 

History

History
316 lines (226 loc) · 14 KB

File metadata and controls

316 lines (226 loc) · 14 KB

CLI reference

Every command the memini binary accepts. Running memini with no arguments starts the server; everything else is an operational subcommand.

The server is configured entirely through the environment rather than flags, so the flags below belong to the subcommands only. See the configuration reference for the environment.

Commands

Command Does
memini assess Backfill LLM-assessed importance on durable memories, on demand
memini backfill Seed nil confidence on legacy durable memories (pre-0.0.11 recovery)
memini doctor Diagnose namespace mismatches and store health
memini export Export memories to memini's portable JSON (re-importable for backup/migration)
memini forget Bulk-delete memories by tag (e.g. undo a bad import)
memini import Bulk-load an export from another memory system
memini key Manage local API keys (this store's api_keys table only)
memini key add Create an API key, or rotate an existing one's secret
memini key ls List API keys (name, home/default namespace, created, disabled, admin, read-only — never secrets or hashes)
memini key rm Delete an API key
memini link Manage cross-namespace read links (durable-tier recall from another namespace)
memini link add Create or replace a read link from src to dst
memini link ls List read links (every link in the store when src is omitted)
memini link rm Remove a read link
memini mcp Serve MCP tools over stdio
memini migrate One-shot data migrations between memini scope models
memini migrate scopes Merge <tenant>/_shared namespaces into <tenant> (old shared-scope model -> ancestor cascade)
memini namespace Inspect and repair memory namespaces (recovery from botched imports / shared pools)
memini namespace list List namespaces and their memory counts
memini namespace move Move every memory from one namespace to another
memini namespace split Regroup a pooled namespace back into per-source namespaces by metadata
memini reembed Re-embed every memory under the currently configured embedding model
memini version Print version information

memini assess

Send durable (semantic / procedural) memories still sitting at their tier-seed importance to the configured LLM for an intrinsic-importance score, writing the result to assessed_importance.

This is the same pass MEMINI_ASSESS_INTERVAL runs on a timer, exposed as a command so a deployment can populate the column without leaving an hourly LLM job switched on — including deployments that keep MEMINI_ASSESS_INTERVAL=0 permanently and point MEMINI_LLM_BASE_URL at a model for this invocation alone.

Idempotent, and never second-guesses a human: a memory whose importance differs from its tier seed was set deliberately and is skipped. Dry-run by default.

memini assess [flags]
Flag Default Does
--batch 0 memories per LLM call (0 uses MEMINI_ASSESS_BATCH)
--max-per-run 0 cap rows touched by this pass (0 uses MEMINI_ASSESS_MAX_PER_RUN)
--min-age 0s skip memories younger than this (0 uses MEMINI_ASSESS_MIN_AGE)
--yes spend LLM calls and write the assessments (default is a dry-run count)

memini backfill

Walk every namespace and seed ConfidenceSeedImported on durable (semantic / procedural) memories written before the confidence field existed, so they enter the decay + demotion lifecycle. Idempotent.

memini backfill [flags]
Flag Default Does
--yes apply the backfill (default is a dry-run report)

memini doctor

Report how the namespace resolves for writes vs recall, list per-namespace memory counts, and flag the conditions behind 'agents stopped writing' and 'all my memories merged into one pool'. Read-only unless --fix is given.

memini doctor [flags]
Flag Default Does
--fix after diagnosing, remediate: split attributable pools, backfill legacy confidence, purge expired, scrub content junk, demote stale durable debris, dedup
--scrub remove content-level junk only: session-lifecycle markers and exact-duplicate memories (preview unless --yes)
--yes apply --fix/--scrub changes (without it, they only preview)

memini export

Export a namespace's memories to a JSON document re-importable with memini import --source memini. Writes stdout when no path or -o is given. Filter with --tier/--tag/--meta to export a slice.

memini export [file] [flags]
Flag Default Does
--all-namespaces export every namespace (each record keeps its own namespace)
--include-expired include memories past their TTL
--include-superseded include contradiction-tombstoned memories
--meta restrict to memories whose metadata contains each key=value pair (repeatable, AND)
--namespace namespace to export (defaults to the resolved default)
--output write to this file instead of stdout
--pretty indent the JSON output
--tag restrict to memories carrying every listed tag (repeatable, AND)
--tier restrict to these tiers (repeatable; working|episodic|semantic|procedural)

memini forget

Delete every memory in a namespace carrying the given tag. The import command stamps each record with import:<source>:<date>, so a single memini forget --tag import:mem0:2026-06-12 undoes that import.

memini forget [flags]
Flag Default Does
--namespace namespace to delete from (defaults to the resolved default)
--tag delete memories carrying this exact tag (required)

memini import

Bulk-load an export from another memory system (or memini's own format) into the local store or a remote server (--remote). Reads stdin when the path is "-" or omitted.

memini import [file] [flags]
Flag Default Does
--batch 0 records per batch (0 = backend default)
--confidence -1 seed confidence for durable imported facts (0..1); <0 uses the default low import seed so they earn trust on recall
--dedup-similarity 0.85 similarity threshold for the post-import dedup pass
--dry-run parse and report where records would land without writing anything
--extract also distil decisions/preferences/problems from conversations into durable semantic memories (no LLM)
--importance 0.25 importance assigned to records whose source carried none, so bulk imports rank below curated memories (0 = leave at 0)
--merge-into force every record into this one namespace, discarding source namespaces (the original is kept in metadata for namespace split)
--min-importance 0 skip records below this importance (0 = off; note: sources without importance report 0)
--min-length 20 skip records whose trimmed content is shorter than this many bytes (0 = off)
--namespace namespace for records whose source carried none (fallback only; does not override source namespaces)
--no-dedup skip dedup of imported records: both the write-time exact-content skip and the post-import vector-cluster pass
--remote target a running memini server (e.g. https://memini.example.com) instead of the local store
--source memini export format: agentmemory|claude-code|mem0|memini|mnemory
--token bearer token for the remote server (defaults to MEMINI_API_KEY)
--yes skip the confirmation prompt when --merge-into collapses multiple source namespaces

memini key

Manage API keys persisted in this store's api_keys table. This is unrelated to MEMINI_API_KEYS_FILE, a server-boot concept: keys declared there are loaded once when the server starts and cannot be created, rotated, or removed by this command.

memini key

memini key add

Create a new named API key, generating a random secret that is printed exactly once to stdout — it is never stored and cannot be recovered or shown again, so save it now. Re-running with a name that already exists ROTATES that key: a new secret is generated and the old one stops authenticating immediately, while the key's CreatedAt, home/default namespace bindings, disabled state, admin state, and read-only state are all preserved unless the corresponding flag is explicitly passed (an explicit --home "" clears the binding; an explicit --disabled=false re-enables a disabled key — rotation alone never re-enables one; an explicit --admin=false demotes an admin key — rotation alone never demotes one; an explicit --read-only=false lifts the read-only restriction — rotation alone never lifts it).

memini key add <name> [flags]
Flag Default Does
--admin grant the key admin (the /v1/keys and /v1/settings/defaults surfaces, gated at the REST layer)
--default-namespace namespace applied when a request presents this key with no explicit namespace header
--disabled create the key already disabled
--home bind the key to a home namespace (default: unbound)
--read-only make the key read-only: it may read but every mutating request is refused, over both REST and MCP

memini key ls

List API keys (name, home/default namespace, created, disabled, admin, read-only — never secrets or hashes)

memini key ls

memini key rm

Delete an API key

memini key rm <name>

memini link

Manage cross-namespace read links (durable-tier recall from another namespace)

memini link

memini link add

Create or replace a read link: recall scoped to src additionally reads durable (semantic/procedural) memories from dst. Re-running with the same src/dst replaces the tiers/note in place (upsert), never duplicates. dst need not exist yet — namespaces exist implicitly.

memini link add <src> <dst> [flags]
Flag Default Does
--note free-text note explaining why the link exists
--tiers comma-separated tiers this link admits, e.g. semantic,procedural (default: the service's durable default)

memini link ls

List read links (every link in the store when src is omitted)

memini link ls [src]

memini link rm

Remove a read link

memini link rm <src> <dst>

memini mcp

Serve MCP tools over stdio

memini mcp

memini migrate

One-shot data migrations between memini scope models

memini migrate

memini migrate scopes

The old scope model merged a <tenant>/_shared namespace read-only into every sibling under <tenant> (and, separately, a MEMINI_GLOBAL_NAMESPACE merged into every namespace store-wide). The new model has interior namespaces AS the shared layer via the ancestor cascade, so this command folds the old data forward: every namespace literally named "<prefix>/_shared" is moved into "<prefix>" (link endpoints follow along), then a dedup pass runs against the target to collapse any facts the merge just duplicated. A bare "_shared" (no prefix) has no parent to merge into and is left alone, reported as a note. Idempotent: once no "<prefix>/_shared" namespace holds any memories, re-running finds nothing to do.

Defaults to a dry-run report; pass --yes to apply.

memini migrate scopes [flags]
Flag Default Does
--yes apply the migration, including the post-merge dedup pass (default is a dry-run report)

memini namespace

Inspect and repair memory namespaces (recovery from botched imports / shared pools)

memini namespace

memini namespace list

List namespaces and their memory counts

memini namespace list

memini namespace move

Move every memory from one namespace to another

memini namespace move [flags]
Flag Default Does
--dry-run report what would move without writing
--from source namespace (required)
--to destination namespace (required)

memini namespace split

Regroup a namespace by metadata, moving each memory to the namespace named by the first grouping key it carries (default: import_source_namespace, user_id, agent_id, run_id, project). Memories with no grouping key stay put. This recovers a store whose imports collapsed into one pool.

memini namespace split [flags]
Flag Default Does
--by comma-separated metadata keys to group by (default: import_source_namespace,user_id,agent_id,run_id,project)
--dry-run report the split without writing
--from namespace to split (required)

memini reembed

Recompute and rewrite the vector for every stored memory using the model named by MEMINI_EMBED_MODEL, so the store can switch embedding models without being rebuilt from an export. Dimensionality cannot change here (the store is fixed at its original width); to change dims, create a new store and re-import. On success the store's recorded embedding model is updated so the startup guard accepts the new model.

memini reembed [flags]
Flag Default Does
--batch 0 memories embedded per request (0 = default)
--namespace limit to a single namespace (default: every namespace)
--yes apply the re-embedding (default is a dry-run report)

memini version

Print version information

memini version