Skip to content

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

Rust

docs(scope): name the isolation modes that keep a per-key map

Felipe Neves Ricardo030a6520dcd2
diff --git a/crates/ai-memory-core/src/active_project.rs b/crates/ai-memory-core/src/active_project.rs
index c70a7fd9..36a6f6e2 100644
--- a/crates/ai-memory-core/src/active_project.rs
+++ b/crates/ai-memory-core/src/active_project.rs
@@ -72,7 +72,8 @@ use serde::{Deserialize, Serialize};
use crate::ids::{ProjectId, WorkspaceId};
-/// Default TTL for per-key entries in the opt-in isolation modes.
+/// Default TTL for per-key entries in the `PerActor` and `PerSession`
+/// isolation modes.
pub const DEFAULT_PER_KEY_TTL: Duration = Duration::from_secs(60 * 60);
/// Default upper bound on per-key entries, to keep memory finite on shared
/// installs where many short-lived sessions may come and go.
diff --git a/crates/ai-memory-mcp/src/server.rs b/crates/ai-memory-mcp/src/server.rs
index 92150de5..a926f0e6 100644
--- a/crates/ai-memory-mcp/src/server.rs
+++ b/crates/ai-memory-mcp/src/server.rs
@@ -1875,8 +1875,8 @@ impl AiMemoryServer {
/// when hooks have published one (for THIS actor),
/// 2. that same explicit `project` in the server's baked workspace,
/// 3. the hook-published [`ActiveProject`] (the cwd the agent is
- /// currently working in, keyed by `actor` in opt-in isolation
- /// modes),
+ /// currently working in, keyed by `actor` in the `per_actor` and
+ /// `per_session` isolation modes),
/// 4. the server's baked-in `--project` default.
///
/// `actor` is built by [`Self::actor_key_from_parts`]; pass
diff --git a/docs/auto-scope.md b/docs/auto-scope.md
index f2a8641c..0ba7ee59 100644
--- a/docs/auto-scope.md
+++ b/docs/auto-scope.md
@@ -32,9 +32,10 @@ The `[auto_scope]` config block still selects the mode explicitly, including
| `per_session` | `session_id` | Session-aware clients/bridges that forward the hook session id on every MCP request. |
| `per_actor` | `(qualified identity, session_id)`, with an identity-only no-session slot | **Default.** Isolates parallel harnesses and separate operators. Falls back to the shared slot for a caller with no coordinate, and for an install where nothing has ever been keyed (no lifecycle hooks); fails closed on a genuine session mismatch. |
-Both opt-in modes still publish foreground activity to the single slot in
-parallel, so a caller with no actor identity (anonymous probe, legacy code
-path) sees the most recently active project rather than an empty pointer.
+The `per_actor` and `per_session` isolation modes still publish foreground
+activity to the single slot in parallel, so a caller with no actor identity
+(anonymous probe, legacy code path) sees the most recently active project
+rather than an empty pointer.
Non-foreground events refresh only their exact keyed entry when one exists.
That preserves legacy behavior without letting a delayed tail take over, but
it is not per-session isolation; use explicit `workspace` + `project`