Skip to content

CLI Reference

Complete reference for all Cerememory CLI commands and flags.

Global Flags

FlagTypeDefaultDescription
--data-dirpath./dataData directory for persistent storage
--configpathNonePath to TOML configuration file

serve

Start the HTTP server and, optionally, the gRPC server.

bash
cerememory serve [OPTIONS]
FlagTypeDefaultDescription
--portu168420HTTP port
--grpc-portu16NoneEnable gRPC on this port
Example: Start HTTP and gRPC together
bash
cerememory serve --port 8420 --grpc-port 8421 --config ./cerememory.toml

The server provides:

  • GET /health and GET /readiness
  • Optional /metrics when http.metrics_enabled = true
  • Request IDs, auth, and rate limiting according to config
  • Background decay ticks on the configured interval

consolidate

Consolidate mature episodic memories into semantic memory.

bash
cerememory consolidate [OPTIONS]
FlagTypeDefaultDescription
--strategystringincrementalincremental, full, or selective
--min-age-hoursu320Minimum record age before consolidation
--min-access-countu320Minimum access count before consolidation
--dry-runboolfalsePreview work without mutating data
Example: Preview a selective consolidation run
bash
cerememory consolidate \
  --strategy selective \
  --min-age-hours 24 \
  --min-access-count 3 \
  --dry-run

set-mode

Change the recall mode used by stateful operations.

bash
cerememory set-mode <MODE> [OPTIONS]
FlagTypeDefaultDescription
<MODE>string--Required. human or perfect
--scopestringNoneOptional comma-separated store filter
Example: Set perfect mode for semantic memory
bash
cerememory set-mode perfect --scope semantic

store

Store a new text memory record.

bash
cerememory store <TEXT> [OPTIONS]
FlagTypeDefaultDescription
<TEXT>string--Required. Text content to store
--storestringepisodicTarget store
--embeddingstringNoneComma-separated embedding vector
--meta-jsonJSON stringNoneStructured MetaMemory with intent, rationale, evidence, and decision context
Example: Store a semantic memory
bash
cerememory store "The user prefers dark mode" --store semantic

store-raw

Store a verbatim raw journal entry.

bash
cerememory store-raw <TEXT> [OPTIONS]
FlagTypeDefaultDescription
<TEXT>string--Required. Text content to preserve
--session-idstring--Required. Session identifier
--topic-idstringNoneTopic identifier for dream grouping
--sourcestringconversationconversation, tool_io, scratchpad, summary, or imported
--speakerstringuseruser, assistant, system, or tool
--visibilitystringnormalnormal, private_scratch, or sealed
--secrecy-levelstringpublicpublic, sensitive, or secret
--meta-jsonJSON stringNoneStructured MetaMemory describing why the raw entry is preserved
Example: Store a conversation turn
bash
cerememory store-raw "I prefer using Neovim for all my coding" \
  --session-id sess-001 \
  --source conversation \
  --speaker user

recall

Recall memories by text query.

bash
cerememory recall <QUERY> [OPTIONS]
FlagTypeDefaultDescription
<QUERY>string--Required. Text query
--limitu3210Maximum number of results
--modestringhumanhuman or perfect
Example: Recall with perfect mode
bash
cerememory recall "user preferences" --limit 5 --mode perfect

recall-raw

Query the raw journal for verbatim entries.

bash
cerememory recall-raw [QUERY] [OPTIONS]
FlagTypeDefaultDescription
[QUERY]stringNoneOptional full-text search query
--session-idstringNoneFilter by session
--limitu3210Maximum number of results
--include-private-scratchboolfalseInclude private_scratch entries
--include-sealedboolfalseInclude sealed entries
--secrecy-levelsstringAllComma-separated public, sensitive, secret
Example: Search raw journal by session
bash
cerememory recall-raw "editor preference" --session-id sess-001

inspect

Inspect a specific record as pretty-printed JSON.

bash
cerememory inspect <RECORD_ID>
FlagTypeDescription
<RECORD_ID>UUIDRequired. Record UUID

The output includes fidelity state, emotion vector, associations, metadata, meta-memory, and version.


stats

Show system-wide statistics.

bash
cerememory stats

The response includes total records, per-store counts, total associations, average fidelity, background decay status, and evolution_metrics when available.


decay-tick

Run a manual decay cycle.

bash
cerememory decay-tick [OPTIONS]
FlagTypeDefaultDescription
--durationu323600Simulated duration in seconds
Example: Advance decay by two hours
bash
cerememory decay-tick --duration 7200

dream-tick

Run dream processing to summarize raw journal entries into curated episodic and semantic memories.

bash
cerememory dream-tick [OPTIONS]
FlagTypeDefaultDescription
--session-idstringNoneProcess only entries from this session
--dry-runboolfalsePreview without creating records
--max-groupsu3210Maximum topic groups to process per call
--include-private-scratchboolfalseInclude private_scratch entries
--include-sealedboolfalseInclude sealed entries
--promote-semanticbooltruePromote factual content to the semantic store
--secrecy-levelsstringAllComma-separated public, sensitive, secret
Example: Dream-process a specific session
bash
cerememory dream-tick --session-id sess-001 --dry-run

forget

Permanently delete a memory record.

bash
cerememory forget <RECORD_ID> [OPTIONS]
FlagTypeDefaultDescription
<RECORD_ID>UUID--Required. Target record
--cascadeboolfalseAlso delete associated records
--confirmboolfalseRequired confirmation flag

export

Export records to a CMA archive file.

bash
cerememory export [OPTIONS]
FlagTypeDefaultDescription
--outputpath./backup.cmaOutput file path
--formatstringcmaArchive format (cma or jsonl; the latter is an alias)
--storesstringNoneComma-separated store filter
--include-raw-journalboolfalseInclude raw journal entries in the archive
--encryptboolfalseEncrypt the archive
--encryption-keystringNoneArchive passphrase
--encryption-key-stdinboolfalseRead the archive passphrase from stdin
Example: Export selected stores with encryption
bash
cerememory export \
  --output ./memories-backup.cma \
  --stores episodic,semantic \
  --encrypt \
  --encryption-key-stdin

import

Import records from a CMA archive file.

bash
cerememory import <PATH> [OPTIONS]
FlagTypeDefaultDescription
<PATH>path--Required. CMA archive path
--strategystringmergemerge or replace
--decryption-keystringNoneDecryption passphrase for encrypted archives
--decryption-key-stdinboolfalseRead the decryption passphrase from stdin
--conflict-resolutionstringkeep_newerkeep_existing, keep_imported, or keep_newer
Example: Import an encrypted archive
bash
cerememory import ./memories-backup.cma \
  --decryption-key-stdin \
  --conflict-resolution keep_newer

migrate-store-encryption

Rewrite existing plaintext persistent redb payloads using the configured store encryption passphrase. Existing plaintext records remain readable until they are migrated, so the engine can keep running during migration.

bash
cerememory migrate-store-encryption --confirm
FlagTypeDefaultDescription
--confirmboolfalseRequired confirmation flag for non-interactive use

The command requires security.store_encryption_passphrase (or the CEREMEMORY_SECURITY__STORE_ENCRYPTION_PASSPHRASE env var) to be set. It reports per-store record counts: total, migrated, already_encrypted across raw_journal, episodic, semantic, procedural, emotional, and the vector index.


audit-verify

Verify the tamper-evident audit log hash chain. Useful for incident response and routine integrity checks.

bash
cerememory audit-verify [--path <PATH>]
FlagTypeDefaultDescription
--pathpathsecurity.audit_log_path or <data_dir>/audit.jsonlAudit log file to verify

The audit log is enabled by default. The command reports the path it verified, the total entry count, and the result (ok or the index of the first broken link in the chain).


healthcheck

Lightweight HTTP health probe for container health checks.

bash
cerememory healthcheck [OPTIONS]
FlagTypeDefaultDescription
--portu168420HTTP port to check

Returns exit code 0 when healthy and non-zero otherwise.


mcp

Start a stdio MCP proxy that forwards tool calls to an existing long-lived cerememory serve process. --server-url is requiredcerememory mcp is a proxy only; there is no embedded-store MCP mode.

bash
cerememory serve --data-dir ~/.cerememory/data
cerememory mcp --server-url http://127.0.0.1:8420
FlagEnv VarRequiredDescription
--server-urlYesURL of the shared cerememory serve process (e.g., http://127.0.0.1:8420)
--server-api-keyCEREMEMORY_SERVER_API_KEYWhen upstream auth is enabledBearer token for the upstream Cerememory HTTP server
--server-timeout-secsNoOptional per-request upstream timeout in seconds; omit to disable per-request timeout

The MCP server exposes these tools:

ToolDescription
storeStore a new memory record; accepts optional meta_json
updateUpdate an existing record's content, emotion, or meta_json
batch_storeStore multiple memories at once with inferred associations
store_rawStore a verbatim raw journal entry; accepts optional meta_json
batch_store_rawStore multiple raw journal entries; each entry may include meta_json
recallQuery memories, or list recent ones when query is omitted
recall_rawForensic query over the raw journal
timelineRetrieve memories in time buckets
associateTraverse the association graph from a record
inspectInspect a specific record
forgetPermanently delete records by UUID
dream_tickSummarize raw journal into curated memory
consolidateTrigger episodic-to-semantic consolidation
statsView system statistics
exportExport curated memories and the raw journal to a CMA archive at an explicit output path

Next Steps

API Endpoints

HTTP REST endpoint reference

LLM Adapters

Configure Claude, GPT, and Gemini