Portable agent memory and workflow runbook system, exposed through the mem CLI.
For agents working in this repository, read docs/agent-reference.md before making changes. AGENTS.md is only a platform entrypoint; docs/agent-reference.md is the canonical agent guidance.
mnemark is a Rust single-binary CLI for durable agent memory. It stores memory in a private/local SQLite knowledge store, maintains a rebuildable Tantivy search index, validates workflow runbooks, and packages portable artifacts and bundles.
- Keep agent memory portable across platforms instead of tying it to one vendor.
- Save and query user preferences, project context, references, and workflow runbooks from the terminal.
- Use SQLite as the runtime source of truth and Tantivy for multilingual full-text search.
- Move reusable helper files with
manifest.toml,artifacts/, and first-class store bundles. - Give agents deterministic CLI operations while leaving judgment, retrospectives, and workflow execution to the agent.
Installer script for macOS / Linux:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/NeoHsu/mnemark/releases/latest/download/mnemark-installer.sh | shWindows PowerShell:
powershell -ExecutionPolicy Bypass -c "irm https://github.com/NeoHsu/mnemark/releases/latest/download/mnemark-installer.ps1 | iex"Direct release downloads:
| Platform | Asset |
|---|---|
| Apple Silicon macOS | mnemark-aarch64-apple-darwin.tar.xz |
| Intel macOS | mnemark-x86_64-apple-darwin.tar.xz |
| ARM64 Linux | mnemark-aarch64-unknown-linux-gnu.tar.xz |
| x64 Linux | mnemark-x86_64-unknown-linux-gnu.tar.xz |
| x64 Windows | mnemark-x86_64-pc-windows-msvc.zip |
Checksums are published next to the release assets. See the latest release.
mem init
mem config show
mem save --type feedback --name no_emoji --scope global --source manual --tags '["style"]' --content "不要使用 emoji"
mem query "emoji"
mem query "name:no_emoji" --raw-query --no-touch
mem setup agent-policy
mem save --type workflow --name release_runbook --scope global --source manual --tags '["workflow:release","intent:release","risk:high"]' --content-file templates/workflow.yaml
mem workflow find release --scope auto
mem workflow validate release_runbook
mem artifact check
mem bundle export mnemark-store.tgz
mem retro daily| File | Description |
|---|---|
| Getting Started | Install, initialize, first save/query, and mnemark skill install |
| Workflows | Workflow memories, artifacts, bundles, import/export, merge, and retrospectives |
| Runtime Model | Store discovery, config priority, runtime files, artifact layout, and index behavior |
| mnemark Skill CLI Guide | Complete current mem CLI command reference |
| Workflow Rules | How agents should interpret and safely execute workflow memory runbooks |
| Agent Reference | Canonical instructions for agents changing this repo: safety rules, repo map, task routing, validation |
| Development | Local setup, source commands, validation, release smoke tests, developer notes |
Install the bundled AI agent skill to enable mem-aware assistance — durable memory save/query, workflow runbook lookup, retrospective flows, merge/audit/bundle commands, and safety rules.
npx skills add https://github.com/NeoHsu/mnemark/tree/main/skills/mnemarkFor a local checkout during development:
npx skills add ./skills/mnemark| Area | Feature | Commands / Files |
|---|---|---|
| Memory | Save, query, update, supersede, delete | mem save, query, update, supersede, delete |
| Memory types | User, feedback, project, reference, preference, workflow | `--type user |
| Search | Multilingual Tantivy search, fuzzy matching, raw query syntax | mem query, --fuzzy, --raw-query, --no-touch |
| Scope | Global and project-aware context | mem context --detect, --scope auto |
| Lifecycle | Soft delete, protected manual memories, version conflicts | valid_until, protected, --expected-version |
| History | Changelog and stats | mem history, mem stats |
| Health | Audit and garbage collection | mem audit, mem audit --fix, mem gc |
| Workflow | Store recurring runbooks as validated memory | `mem workflow list |
| Artifacts | Portable helper file metadata and safety checks | `mem artifact list |
| Bundles | Portable store export/import/inspect | `mem bundle export |
| Migration | JSON/Markdown import, JSON/Markdown export, DB merge | mem import, mem export, mem merge |
| Retrospective | Daily/weekly orchestration bundles for agents | `mem retro daily |
| Agent setup | Coding-agent entrypoint memory policy | mem setup agent-policy |
| Agent skill | Project-shipped mnemark skill | skills/mnemark |
memory.db is the runtime source of truth for an individual knowledge store, but it is not tracked in this project. Keep real memory databases in a private data repo, a local MNEMARK_HOME, or a knowledge_home configured in ~/.config/mnemark/config.toml.
Runtime stores can include config.toml, manifest.toml, artifacts/, and rebuildable index/. See Runtime Model for details.
mise install
env -u CC -u CXX cargo test --workspace --lockedFor source-only CLI runs:
cargo run -p mnemark --bin mem -- <args>Release build and smoke test:
scripts/build-release.sh
scripts/smoke-release.sh