Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(memory): document the org:<id> root and legacy user segment

Steven Enamakel5af2fe46bcd7
diff --git a/crates/openhuman-core/src/memory/layout_migration/mod.rs b/crates/openhuman-core/src/memory/layout_migration/mod.rs
index f5747f1f9a..d39d8a0b1b 100644
--- a/crates/openhuman-core/src/memory/layout_migration/mod.rs
+++ b/crates/openhuman-core/src/memory/layout_migration/mod.rs
@@ -1,7 +1,7 @@
//! Moving memory from the legacy CortexDB tree into the per-user tree.
//!
//! Memory written before layout v3 lives under `app:tinymemory/…`; layout v3
-//! keeps each person's memory below `user:<id>`. Items are moved by being
+//! keeps each person's memory below `org:<id>`. Items are moved by being
//! stored again ([`copy`]) rather than by copying events, because an item's
//! namespace is part of its identity and its placement changes
//! ([`map`]). Progress is saved after every page ([`state`]), so the move
diff --git a/crates/openhuman-core/src/memory/ops.rs b/crates/openhuman-core/src/memory/ops.rs
index d63062dc02..e796b05cc9 100644
--- a/crates/openhuman-core/src/memory/ops.rs
+++ b/crates/openhuman-core/src/memory/ops.rs
@@ -379,8 +379,8 @@ pub async fn forget(config: &Config, params: ForgetParams) -> MemoryResult<Forge
/// On the hosted engine this is one `DELETE /memory`, which erases the
/// caller's entire hosted memory (every scope under their tenant, the
/// pre-v3 layout's included). On CortexDB reached directly it erases every
-/// kind scope of the bound layout (the person's `user:<id>` subtree under
-/// layout v3); a legacy tree is left alone, because on a self-hosted CortexDB
+/// kind scope of the bound layout (the person's `org:<id>` subtree under
+/// layout v3, and the retired `user:<id>` one while it is still read); a legacy tree is left alone, because on a self-hosted CortexDB
/// other accounts may share it (see `layout_migration`). An engine that
/// cannot erase answers `UNSUPPORTED`.
pub async fn erase_all(config: &Config, params: EraseAllParams) -> MemoryResult<EraseAllView> {
diff --git a/docs/specs/memory-v2.md b/docs/specs/memory-v2.md
index b47f48e389..16ee440205 100644
--- a/docs/specs/memory-v2.md
+++ b/docs/specs/memory-v2.md
@@ -260,12 +260,24 @@ memory.
**Moving into the per-user layout.** Memory written before layout v3 lives
under `app:tinymemory/…`. `memory_migration_*` stores each item again below
-the person's `user:<id>` root, verifies it, switches the layout once every
+the person's `org:<id>` root, verifies it, switches the layout once every
item is copied, copies what arrived meanwhile, then removes the legacy copies
it verified. Progress is saved after every page in
`<workspace>/memory/layout_migration.json`, so the move resumes where it
stopped. The memory background job runs it on its own only while moving is
free (always off the hosted engine); `memory_migration_start` runs it now.
+
+**The `org:<id>` root.** One root per person, `org:<id>`, with no `user:`
+segment below it: chats at `org:<id>/ws:main/app:conversations`, the brain
+at `org:<id>/app:brain/source:<src>`, learnings at `org:<id>/app:learnings`.
+On a direct CortexDB the engine is rooted at `org:<id>` and owned by the
+actor `user:<id>`; on the hosted engine it sends paths relative to the
+tenant root memory-api pins (`org:<id>`). Earlier v3 clients rooted at
+`user:<id>` (hosted: `org:<id>/user:<id>/…`). While `[memory]
+legacy_user_segment_read` is on (the default), reads and forgets cover that
+path too, merged by item id, and writes go only to `org:<id>`. cortexdb-saas
+`reroot-user-segment` moves the hosted data; the flag is turned off once that
+is verified.
On a self-hosted CortexDB every account on the machine shares the legacy
tree: it moves only with `takeover: true`, and the first account to take it
claims it in `<app>/memory/legacy_claims/`; other accounts have nothing
diff --git a/gitbooks/features/privacy-and-security.md b/gitbooks/features/privacy-and-security.md
index 00192cf601..0c95444e04 100644
--- a/gitbooks/features/privacy-and-security.md
+++ b/gitbooks/features/privacy-and-security.md
@@ -43,7 +43,7 @@ Memory items are your brain documents, logged conversation turns, learnings, and
| **TinyHumans** (hosted) | The core sends each request over TLS to the TinyHumans backend's `/memory/*` routes, authenticated with your session or TinyHumans API key. The backend applies a per-user rate limit and billing, then forwards to a CortexDB proxy that places every scope under your own tenant root. | Only your account. The proxy derives the tenant from your credential, not from the request, so one user cannot read or write another's memory. TinyHumans operates the service. |
| **CortexDB** (direct) | The core calls CortexDB itself (`api-v1.cortexdb.ai`, or a self-hosted endpoint) with your own CortexDB API key, kept in the OS keychain. It does not go through the TinyHumans backend. | Whoever holds that key, and the operator of that endpoint. |
-Inside either engine, memory is kept below a root derived from the active config identity (`user:<id>` for a TinyHumans account, `user:local-<digest>` for a local identity), so it can be listed, confined and erased as one tree. Learnings and the brain are shared by your agents; each agent's conversations are tagged with that agent.
+Inside either engine, memory is kept below a root derived from the active config identity (`org:<id>` for a TinyHumans account, `org:local-<digest>` for a local identity; on hosted memory this is the tenant root the backend pins, so paths read `org:<id>/ws:main/…`), so it can be listed, confined and erased as one tree. Learnings and the brain are shared by your agents; each agent's conversations are tagged with that agent.
We make no claim beyond TLS in transit and per-user tenant isolation for hosted memory. In particular, these docs do not promise end-to-end or client-side encryption: the hosted service can read what it stores, which is how it answers recall.
@@ -51,7 +51,7 @@ We make no claim beyond TLS in transit and per-user tenant isolation for hosted
- **One item:** **Forget** in the Memory page's **Explorer**, on a memory chip under an answer, on the **Learnings** tab, or through the agent's `memory` tool (`forget`).
- **One source:** **Forget source** on the **Brain** tab, or tick **Also delete memory from this source** when disconnecting an integration.
-- **Everything:** the `openhuman.memory_erase_all` RPC (`{"confirm": true}`) erases all memory the selected engine holds, for good. On hosted memory it calls the backend's `DELETE /memory`, which erases your whole tenant. On a direct CortexDB it erases your own `user:<id>` tree; memory written there before the per-user layout, which other accounts on a self-hosted CortexDB may share, is left for you to delete with your CortexDB account or endpoint. The **Settings** tab of the Memory page has an **Erase memory** card that calls the same RPC after you confirm.
+- **Everything:** the `openhuman.memory_erase_all` RPC (`{"confirm": true}`) erases all memory the selected engine holds, for good. On hosted memory it calls the backend's `DELETE /memory`, which erases your whole tenant. On a direct CortexDB it erases your own `org:<id>` tree (and the earlier `user:<id>` tree while it is still read); memory written there before the per-user layout, which other accounts on a self-hosted CortexDB may share, is left for you to delete with your CortexDB account or endpoint. The **Settings** tab of the Memory page has an **Erase memory** card that calls the same RPC after you confirm.
Signing out does **not** delete stored memory, and neither does disconnecting an integration unless you tick that box.