Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

docs(cli): correct the process_guard inventory of guarded commands

lhzapata51f699caa1df
diff --git a/AGENTS.md b/AGENTS.md
index a6824358..e7fe40a1 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -277,8 +277,11 @@ prior-art bug (see `docs/ARCHITECTURE.md` and `docs/issues-*.md`):
wrapper libraries.
8. **`{provider, model, dim}` denormalized next to every embedding**;
stale vectors are warned about and ignored on config mismatch.
-9. **Live-process check before destructive ops** (`reset`, `backup`,
- `restore` consult `sysinfo`).
+9. **Live-process check before direct-disk lifecycle ops.** `reset`, `restore`,
+ `reindex`, and `uninstall --purge-data` consult `sysinfo`; the uninstall
+ guard is conditional on `--purge-data`. `backup` stays online: its thin HTTP
+ client asks the server to snapshot SQLite with the online backup API while
+ the writer remains live.
10. **Atomic file writes** (tmp + rename + fsync); the watcher ignores
its own writes by filename prefix.
11. **Absolute canonical data dir**, logged loudly at startup.
diff --git a/crates/ai-memory-cli/src/process_guard.rs b/crates/ai-memory-cli/src/process_guard.rs
index ac5232fd..5cc49e0f 100644
--- a/crates/ai-memory-cli/src/process_guard.rs
+++ b/crates/ai-memory-cli/src/process_guard.rs
@@ -1,7 +1,10 @@
//! Shared "is another ai-memory process alive?" check.
//!
-//! Used by every destructive command (`reset`, `backup`, `restore`) so
-//! we never race a live writer (lesson from basic-memory #765).
+//! Used by direct-disk lifecycle operations that must not race a live writer:
+//! `reset`, `restore`, `reindex`, and `uninstall` when `--purge-data` is set
+//! (lesson from basic-memory #765). `backup` is intentionally excluded: it is a
+//! thin HTTP client, and the server snapshots SQLite through its online backup
+//! API while the writer stays live.
use std::ffi::OsStr;
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index a3ee3c55..82c59233 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -511,8 +511,11 @@ that touch the relevant area.
8. **`{provider, model, dim}` denormalised next to every embedding.**
Warn and ignore stale vectors on mismatch until re-embedding completes.
(agentmemory #469.)
-9. **Live-process check before destructive ops.** `ai-memory reset`,
- `backup`, `restore` all consult `sysinfo`. (basic-memory #765.)
+9. **Live-process check before direct-disk lifecycle ops.** `ai-memory reset`,
+ `restore`, `reindex`, and `uninstall --purge-data` consult `sysinfo`; the
+ uninstall guard is conditional on `--purge-data`. `backup` is a thin HTTP
+ client instead: the server snapshots SQLite with its online backup API while
+ the writer remains live. (basic-memory #765.)
10. **Atomic file writes** (tmp + rename + fsync). Watcher ignores
own writes by filename prefix.
11. **Absolute canonical data dir** default; logged loudly on