Do memory cli ops

From d-o-hub/rust-self-learning-memory · View interactive version

Do memory cli ops is an AI agent skill from the GitHub repository d-o-hub/rust-self-learning-memory. Execute and troubleshoot do-memory-cli commands for episode management, pattern analysis, and storage operations. Use this skill when running CLI commands, debugging CLI issues, explaining command usage, or guiding users through CLI workflows.

How to use this skill

Skill file

Memory CLI Operations

Execute and troubleshoot the do-memory-cli for the self-learning memory system.

Quick Reference

When to Use

CLI Overview

Location: ./target/release/do-memory-cli

Output Formats: human (default), json, yaml

Global Options

do-memory-cli [OPTIONS] <COMMAND>

Options:
  -c, --config <FILE>         Configuration file path
  -f, --format <FORMAT>       Output format (human|json|yaml)
  -v, --verbose               Enable verbose output
  --dry-run                   Show what would be done
  --storage-mode <MODE>       Storage mode: remote | local | memory
                              (env: MEMORY_STORAGE_MODE)
  --db-path <PATH>            Project-local DB path (env: MEMORY_DB_PATH)

Flag placement & logs (verified against release v0.1.38):

Note: an empty RUST_LOG also silences logs — prefer an explicit RUST_LOG=off.

Storage / DB path notes (issues #830, #832)

| Flag / env | Effect |

|------------|--------|

| --storage-mode / MEMORY_STORAGE_MODE | Sets [database].storage_mode (remote, local, memory) |

| --db-path / MEMORY_DB_PATH | Always sets redb_path (and db_path) to the given path. Local default backend when no Turso URL is set. |

Config placement for storage_mode:

# Project-local redb (recommended for multi-process CLI smoke)
do-memory-cli --storage-mode local --db-path ./data/memory.redb episode list
# Or:
MEMORY_DB_PATH=./data/memory.redb MEMORY_STORAGE_MODE=local do-memory-cli episode list

Verifying Turso/SQLite entries

With the turso feature, --db-path x.redb opens two sibling files: the

Turso/SQLite database at x.db (durable) and the redb cache at x.redb.

Inspect the SQLite side directly (no sqlite3 CLI needed — python3 ships sqlite3):

python3 - <<'PY'
import sqlite3
con = sqlite3.connect("data/cache.db")   # sibling of data/cache.redb
cur = con.cursor()
print([t[0] for t in cur.execute("SELECT name FROM sqlite_master WHERE type='table'")])
print("episodes:", cur.execute("SELECT COUNT(*) FROM episodes").fetchone()[0])
print(cur.execute("SELECT episode_id, substr(task_description,1,40) FROM episodes").fetchall())
PY

Notes:

Config discovery (issue #829)

# Print a full TOML template to stdout
do-memory-cli config show-template

# Write a starter config (default: do-memory-cli.toml)
do-memory-cli config init
do-memory-cli config init --path ./my-project.toml

# Inspect / validate resolved config
do-memory-cli config show
do-memory-cli config validate

Partial TOML is valid — missing sections use defaults. Minimal local example:

[database]
redb_path = "./.do-memory-cli/cache/memory.redb"
storage_mode = "local"

Cross-process pattern workflow (issue #831)

Each CLI invocation is a separate process. Patterns must be durable (postcard + redb/Turso), not only in-memory.

DB=./data/memory.redb
CLI="do-memory-cli --storage-mode local --db-path $DB"

# 1. Create (--format is a top-level flag: place it BEFORE the subcommand)
ID=$($CLI --format json episode create -t "Implement auth" | jq -r .episode_id)

# 2. Log steps (use --success for tool-sequence patterns)
$CLI episode log-step "$ID" --tool compiler --action "build" --success
$CLI episode log-step "$ID" --tool test --action "run tests" --success

# 3. Complete (triggers pattern extraction + durable cache)
$CLI episode complete "$ID" success

# 4. List in a fresh process (must be > 0)
$CLI pattern list
$CLI pattern search auth

Pattern-type warning:

Commands Overview

| Command | Alias | Purpose |

|---------|-------|---------|

| episode | ep | Episode management (create, list, view, log-step, complete, bulk, search) |

| pattern | pat | Pattern analysis (list, view, analyze, effectiveness, extract, decay) |

| storage | st | Storage operations (stats, sync, vacuum, health, connections) |

| config | cfg | Configuration (init, show-template, show, validate) |

| health | hp | Health monitoring (check, status, monitor) |

| backup | bak | Backup/restore (create, list, restore, verify) |

| monitor | mon | Metrics (status, export) |

| logs | log | Log analysis (analyze, search, export, stats) |

| eval | ev | Evaluation & calibration (stats, calibration) |

| embedding | emb | Embedding providers (list, test, configure) |

| tag | tg | Episode tags (add, remove, set, get, search) |

| relationship | rel | Episode relationships (DAG + info) |

| playbook | pb | Playbook recommendations & management |

| feedback | fb | Recommendation feedback tracking |

| external-signal | sig | External signal provider management |

| completion | comp | Shell completions (bash, zsh, fish, …) |

Subcommand help is authoritative: do-memory-cli <cmd> --help. Some leaf commands

(backup create, logs export, monitor export) accept a local --format;

all others use the top-level flag only.

See commands.md for detailed command documentation and examples.md for common workflows.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.