kagura-memory 0.19.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -17
- package/dist/cli.js +392 -29
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +121 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +219 -10
- package/dist/index.d.ts +219 -10
- package/dist/index.js +121 -12
- package/dist/index.js.map +1 -1
- package/dist-mcp/mcp.cjs +13 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ runtime dependencies — the one optional peer dependency, for
|
|
|
35
35
|
unless you ask for it.
|
|
36
36
|
|
|
37
37
|
Targets memory-cloud **v0.75.0** (`MIN_SERVER_VERSION`) and is checked
|
|
38
|
-
against memory-cloud up to **v0.
|
|
38
|
+
against memory-cloud up to **v0.182.0**; the Python SDK 0.44.0, its
|
|
39
39
|
parity target, is checked up to v0.142.0 (v0.143.0 changes nothing a
|
|
40
40
|
client sees), and its own `MIN_SERVER_VERSION` stays at an advisory
|
|
41
41
|
0.17.1. `checkServerVersion()` warns, and never throws, on an older
|
|
@@ -173,7 +173,7 @@ npx kagura-memory --help
|
|
|
173
173
|
| `resource` | `tokens {list,create,update,revoke}` `list` `setup` `schema` `stats` `indexer-status` `events` `ingest` `ingest-batch` `import` |
|
|
174
174
|
| `secret` | `keygen` `list` `put` `get` `grant` `revoke` `rotate` `delete` `pubkeys` `approve` `audit-verify` `exec` |
|
|
175
175
|
| `setup` | `claude` `codex` `hermes` `openclaw` |
|
|
176
|
-
| `workspace` | `member {list,add,set-role,remove}` `invite {create,list,revoke}` |
|
|
176
|
+
| `workspace` | `list` `member {list,add,set-role,remove}` `invite {create,list,revoke}` |
|
|
177
177
|
| other | `config show` `doctor` |
|
|
178
178
|
|
|
179
179
|
```bash
|
|
@@ -182,6 +182,7 @@ npx kagura-memory recall "OAuth setup" -c dev -k 10
|
|
|
182
182
|
npx kagura-memory recall "dependency injection" --no-rerank # skip reranking; no flag follows the context config (v0.69.0+)
|
|
183
183
|
npx kagura-memory recall "project context" --verbosity full # uncut summaries + tags; compact is the server default (v0.108.0+)
|
|
184
184
|
npx kagura-memory recall "deploy runbook" --full 1 --max-chars 40000 # content on the top hit only (v0.114.0+); reply budget (v0.82.0+)
|
|
185
|
+
npx kagura-memory recall "which day the team meets" --order date # oldest first, each hit dated (v0.182.0+)
|
|
185
186
|
# A server that refuses one of --verbosity/--full/--max-chars (invalid_argument) gets one
|
|
186
187
|
# retry without the ones it names (every one it sent when it names none), with a note on stderr.
|
|
187
188
|
npx kagura-memory remember -s "FastAPI DI" --content "Use Depends()" --tags "python,fastapi"
|
|
@@ -191,6 +192,8 @@ npx kagura-memory update-memory -m MEM_UUID --add-tag status:done --remove-tag s
|
|
|
191
192
|
--details-patch '{"status": "done"}' --expected-version 3 # partial edits (v0.140.0+), guarded (v0.113.0+)
|
|
192
193
|
npx kagura-memory update-memory -m MEM_UUID --accept-supersede-candidate # shadow the suggested older memory (v0.126.0+)
|
|
193
194
|
npx kagura-memory context search-config CTX_UUID --content-chunks --no-llm-selector # owner only (v0.110.0+ / v0.115.0+)
|
|
195
|
+
npx kagura-memory context search-config CTX_UUID --fusion rrf # hybrid fusion: auto, rrf or weighted (v0.178.0+)
|
|
196
|
+
npx kagura-memory workspace list # your workspaces; then context list --workspace-id WS_UUID (v0.177.0+)
|
|
194
197
|
npx kagura-memory bootstrap --since 7d --format index --max-chars 5000 # open a session (v0.93.0+; index/--max-chars < 10000 v0.115.0+)
|
|
195
198
|
npx kagura-memory changes 2026-11-04T09:00:00Z --by-me # what you wrote since then (v0.93.0+; --by-me v0.114.0+)
|
|
196
199
|
npx kagura-memory list --filters '{"type": "task", "details.status": "open"}' --order-by created_at # exact filters, a total, no ranking
|
|
@@ -240,8 +243,23 @@ used contexts; when more follow, its stderr line names the
|
|
|
240
243
|
```bash
|
|
241
244
|
npx kagura-memory context list --limit 50
|
|
242
245
|
npx kagura-memory context list --limit 50 --cursor 50 # the next_cursor of the page before
|
|
246
|
+
npx kagura-memory context list --workspace-id WS_UUID # another workspace of yours (v0.177.0+)
|
|
243
247
|
```
|
|
244
248
|
|
|
249
|
+
**`context list --workspace-id`** (memory-cloud v0.177.0+) lists another
|
|
250
|
+
workspace the account is a member of, an id from **`workspace list`**,
|
|
251
|
+
which calls the MCP tool `list_workspaces` with the usual credential (no
|
|
252
|
+
owner key; a connector key is refused) and prints one row per workspace: `ID`, `NAME`, `ROLE`,
|
|
253
|
+
`CURRENT` (the connection's workspace) and `USABLE` (`yes`, or `no` with
|
|
254
|
+
the reason: `workspace_suspended`, `feature_not_available`), or with
|
|
255
|
+
`--json` the Python SDK model's dump, as the Python CLI 0.49.0 prints both;
|
|
256
|
+
the NAME column is as wide as the longest name (at least the header),
|
|
257
|
+
counting an East Asian wide or fullwidth character (CJK, most emoji) as two
|
|
258
|
+
columns, so no name is cut. `--workspace-id` must be a UUID (exit 2).
|
|
259
|
+
**`context search-config --fusion auto|rrf|weighted`** (v0.178.0+) sets
|
|
260
|
+
how hybrid recall fuses its two legs; any other value is a usage error
|
|
261
|
+
(exit 2).
|
|
262
|
+
|
|
245
263
|
**`update-memory --merge-details`** (and `--details-patch`, a patch you
|
|
246
264
|
write yourself) sends `--details` / `--location` as one `details_patch`
|
|
247
265
|
call, as the Python CLI 0.44.0 does: the server merges their top-level keys
|
|
@@ -400,8 +418,8 @@ URL likewise from `--mcp-url`, else that file's `mcp_url`, else
|
|
|
400
418
|
reads it. It never takes them from `~/.kagura.json`, nor, with
|
|
401
419
|
`--project-dir`, from the current directory's `.kagura.json`: those are
|
|
402
420
|
another project's credentials. `.kagura.json` gets the URL as given; the
|
|
403
|
-
parameters that `--guardrails`, `--tool-profile`, `--add-tools
|
|
404
|
-
`--context` set go on the entry's URL only. A plain-HTTP URL to a host other than localhost is refused,
|
|
421
|
+
parameters that `--guardrails`, `--tool-profile`, `--add-tools`,
|
|
422
|
+
`--context` and `--notices` set go on the entry's URL only. A plain-HTTP URL to a host other than localhost is refused,
|
|
405
423
|
whichever of the three it came from, before anything is written or run
|
|
406
424
|
(exit 1, `Connection failed: MCP URL must use HTTPS for security …`, the
|
|
407
425
|
Python CLI's words, whose connection test refuses it).
|
|
@@ -597,16 +615,24 @@ allowlist already on the URL wins over both, which gets a warning.
|
|
|
597
615
|
`--context CONTEXT_ID` (`setup claude`; v0.114.0+) names the connection's
|
|
598
616
|
default context: context-scoped tools called without `context_id` run in
|
|
599
617
|
it, an explicit `context_id` wins, and the default is checked like one,
|
|
600
|
-
so it never widens access; unlike `--context-id`, it must be a UUID.
|
|
601
|
-
|
|
618
|
+
so it never widens access; unlike `--context-id`, it must be a UUID.
|
|
619
|
+
`--notices off` (every harness; v0.161.0+) puts `?notices=off` on the URL,
|
|
620
|
+
so `bootstrap` replies carry no service notices. Each notice is delivered
|
|
621
|
+
once per person, so only an entry no person reads (a scheduled job, CI)
|
|
622
|
+
should turn them off; setup never writes it unasked. `off` is the only
|
|
623
|
+
value the server reads (any case), and any other is refused (exit 2).
|
|
624
|
+
Unlike a `--guardrails` context it is written for Hermes and OpenClaw too,
|
|
625
|
+
since the notices come in a tool reply; the plugin `server_url` that
|
|
626
|
+
`setup claude` prints never carries it. On
|
|
627
|
+
codex, hermes and openclaw a `?profile=`, `?add_tools=` or `?notices=` already in
|
|
602
628
|
`--mcp-url` is kept when the flag is absent, and Codex's `--guardrails`
|
|
603
629
|
preview repeats the entry's view (`--profile` / `--tools` /
|
|
604
630
|
`--add-tools`), so its truncation note names a tool the entry lists. The
|
|
605
631
|
keys go at the end of the query in Python's order (`guardrails`,
|
|
606
|
-
`profile`, `add_tools`, `context`), replacing any value already there,
|
|
632
|
+
`profile`, `add_tools`, `context`, `notices`), replacing any value already there,
|
|
607
633
|
with commas left literal, as the Python CLI writes them. A `setup claude`
|
|
608
|
-
run that leaves out a `guardrails`, `profile`, `add_tools
|
|
609
|
-
value the entry it replaces had, or its `?tools=` allowlist (which goes
|
|
634
|
+
run that leaves out a `guardrails`, `profile`, `add_tools`, `context` or
|
|
635
|
+
`notices=off` value the entry it replaces had, or its `?tools=` allowlist (which goes
|
|
610
636
|
back on `--mcp-url`), says so in a note, reading the old URL as the
|
|
611
637
|
server does: the first value of each key, trimmed; a blank one, or a
|
|
612
638
|
`?tools=` naming no tool, is left out, as the Python CLI 0.44.0 does.
|
|
@@ -1107,7 +1133,7 @@ when `KAGURA_PROFILE` is set and still overrides the new default; an
|
|
|
1107
1133
|
unknown name exits 1 and lists the stored profiles, and a missing or
|
|
1108
1134
|
extra argument is a usage error (exit 2).
|
|
1109
1135
|
|
|
1110
|
-
**`workspace` and the `auth` key commands** (memory-cloud v0.42.0+)
|
|
1136
|
+
**`workspace member|invite` and the `auth` key commands** (memory-cloud v0.42.0+)
|
|
1111
1137
|
manage a workspace's members, invitations and member API keys:
|
|
1112
1138
|
`workspace member list|add|set-role|remove`, `workspace invite
|
|
1113
1139
|
create|list|revoke`, and `auth create-key|list-keys|revoke-key`, which
|
|
@@ -1549,7 +1575,7 @@ unknown, not that no plan lifts it. That covers an older server, and
|
|
|
1549
1575
|
`createContext`'s own context-limit check, which reads a one-row
|
|
1550
1576
|
`listContexts({ limit: 1 })` page and so fills in only `quotaType`,
|
|
1551
1577
|
`current` and `limit`. When the workspace is full but `count` is below
|
|
1552
|
-
`limit`, `current` is `null
|
|
1578
|
+
`limit`, `current` is `null` and the message, as the Python SDK 0.48.0's, says the workspace is at its limit and that contexts the caller cannot see count toward it. From memory-cloud v0.170.0 a numeric `current`
|
|
1553
1579
|
from the pre-check can be a lower bound because `count` includes only visible
|
|
1554
1580
|
contexts.
|
|
1555
1581
|
|
|
@@ -1600,7 +1626,7 @@ when `undefined`.
|
|
|
1600
1626
|
| Method | What it does |
|
|
1601
1627
|
|--------|--------------|
|
|
1602
1628
|
| `remember` | Store a memory. `details` accepts arbitrary JSON, including `location` (see below) and the reserved `tool_trigger`, which marks a tool guardrail and needs context editor or above on a user (not agent) credential; `supersedes` declares this the newer version of an existing memory, shadowing the old one from default recall without destroying it; `deliveryMode: "always"` pins it. `tags` takes at most 50 tags of at most 100 characters each, the caps memory-cloud v0.82.0+ enforces: more throws before any request, on every server. `toolTrigger` marks the guardrail without writing the key yourself. `observedAt` (v0.127.0+) says when the fact held — a `YYYY-MM-DD` date or an extended ISO 8601 datetime, or a `Date` (sent as its UTC instant), stored as `details.observed_at`; a basic form (`20240307`), a time without seconds, an impossible day or a disagreeing `details.observed_at` throws before any request. `dedupe` (v0.93.0+): `"check"` writes nothing when a near-duplicate exists and returns `{ status: "duplicate_candidate", candidate }` instead of throwing, `"off"` opts the memory out of supersede suggestions for good; `tagsNormalize: true` stores each tag under the context's established spelling; `verbose: true` keeps `persistence.detail`. The reply (`RememberResult`, returned unchecked as Python's dict, so every key is optional) carries `version` (v0.113.0+), `session_id` (v0.113.0+), when a summary over 500 characters was cut, `summary_truncated` / `summary_original_length` (v0.108.0+), and `plan_headroom` (v0.142.0+, read fail-open; see [Plan headroom](#plan-headroom-memory-cloud-v01420)). |
|
|
1603
|
-
| `recall` | Hybrid semantic + keyword search. Takes `filters` (`type`, `scope`, `tags` with `tags_match` and `tags_normalize`, `importance` bounds, created/updated date bounds, `source_uri_prefix`, `source_type`, `trust_tier`, and the `near` / `within` geo filters), `searchMode`, `useRerank`, `includeExploreHints`, `includeSuperseded` (read back what `supersedes` shadowed, annotated with `superseded_by`), and `contextIds` for 2–20-context search. `useRerank` is tri-state (memory-cloud v0.69.0+): omit it to follow the context's search config (the first context's, with `contextIds`), `true` requests reranking where the context allows it, `false` skips it for the call. A tag filter that matches nothing can return `tag_suggestions`. When the semantic half is unavailable, the result is keyword-only and carries `degraded: true` and `degraded_reason` (v0.66.0+) — an empty one then means "search impaired", not "nothing stored". `observedAfter` (inclusive) / `observedBefore` (exclusive) keep the memories whose fact held in that range (`filters.observed_after` / `observed_before`, v0.127.0+; a date is the start of its UTC day, and a memory without `observed_at` never matches); one beside the same key in `filters` throws. `eventAfter` (inclusive) / `eventBefore` (exclusive) do the same for the date of the event a memory describes (`filters.event_after` / `event_before`, v0.152.0+, where the server resolves `details.event_start` / `event_end` from `details.event_phrase`): a memory matches when its event range overlaps the window, a memory without an event date never matches, a datetime `eventAfter` counts as its UTC day and a datetime `eventBefore` past midnight as the day after it; a server before v0.152.0 does not know the keys and filters nothing. Returns a typed `RecallResponse` (`confidence` first: read `confidence.level` before the hits); see [Recall result shape](#recall-result-shape). |
|
|
1629
|
+
| `recall` | Hybrid semantic + keyword search. Takes `filters` (`type`, `scope`, `tags` with `tags_match` and `tags_normalize`, `importance` bounds, created/updated date bounds, `source_uri_prefix`, `source_type`, `trust_tier`, and the `near` / `within` geo filters), `searchMode`, `useRerank`, `includeExploreHints`, `includeSuperseded` (read back what `supersedes` shadowed, annotated with `superseded_by`), `order` (`"date"`: oldest first with a `date` per row, v0.182.0+), and `contextIds` for 2–20-context search. `useRerank` is tri-state (memory-cloud v0.69.0+): omit it to follow the context's search config (the first context's, with `contextIds`), `true` requests reranking where the context allows it, `false` skips it for the call. A tag filter that matches nothing can return `tag_suggestions`. When the semantic half is unavailable, the result is keyword-only and carries `degraded: true` and `degraded_reason` (v0.66.0+) — an empty one then means "search impaired", not "nothing stored". `observedAfter` (inclusive) / `observedBefore` (exclusive) keep the memories whose fact held in that range (`filters.observed_after` / `observed_before`, v0.127.0+; a date is the start of its UTC day, and a memory without `observed_at` never matches); one beside the same key in `filters` throws. `eventAfter` (inclusive) / `eventBefore` (exclusive) do the same for the date of the event a memory describes (`filters.event_after` / `event_before`, v0.152.0+, where the server resolves `details.event_start` / `event_end` from `details.event_phrase`): a memory matches when its event range overlaps the window, a memory without an event date never matches, a datetime `eventAfter` counts as its UTC day and a datetime `eventBefore` past midnight as the day after it; a server before v0.152.0 does not know the keys and filters nothing. Returns a typed `RecallResponse` (`confidence` first: read `confidence.level` before the hits); see [Recall result shape](#recall-result-shape). |
|
|
1604
1630
|
| `reference` | Full detail for one memory, under `result.memory` (`ReferenceResponse`), with its `version` (v0.113.0+) — the `expectedVersion` for `updateMemory` — and `observed_at` (v0.127.0+). Since v0.78.0 the reply is bounded (`maxChars`, 10,000–100,000, default 20,000): cut `content` comes with `content_truncated` / `content_next_offset`, and a `details` / `context` / links field that does not fit is left out with `<field>_omitted` / `<field>_total_chars`. Page the rest with `contentOffset`, `detailsOffset` (`details_json` slices) or `contextOffset` — one per call — and pick fields with `fields` (`content`, `details`, `context`, `links`). `version` (v0.113.0+) reads an earlier version (`historical: true`, `current_version`). A live `supersede_candidate` carries `acceptance` (v0.137.0+; see [Supersede suggestions](#supersede-suggestions)). Every one is checked locally (an integer in range, more than one offset refused first, a known field, an offset's own field listed) before any request. The reply comes back as sent once its `status` (a string) and `memory` (an object) are checked: otherwise `KaguraResponseError` (the CLI's `reference` prints the raw reply, as Python's does). |
|
|
1605
1631
|
| `updateMemory` | Update in place by `memoryId`, or upsert by `externalId`. `details` **replaces** the stored object wholesale — round-trip keys you want to keep; dropping `tool_trigger` turns a guardrail off — and `detailsPatch` (v0.140.0+) merges into it instead: each key replaces the stored one, `null` deletes it, the rest are kept. `tags` replaces the list, with `remember`'s caps; `addTags` / `removeTags` (v0.140.0+) edit it (removals first, each new tag once; `addTags` takes the caps, `removeTags` none). `expectedVersion` (v0.113.0+) applies the edit only while the memory is at that version, else throws `KaguraVersionConflictError` with `currentVersion` and writes nothing. `dismissSupersedeCandidate: true` rejects the server's `supersede_candidate` suggestion; `acceptSupersedeCandidate: true` (v0.126.0+) accepts it — the candidate is shadowed by a `supersedes` edge, named in the reply's `superseded_memory_id`, and a different edge already linking the pair throws `KaguraError` `code` `"edge_exists"`; check the candidate's `acceptance` first ([Supersede suggestions](#supersede-suggestions)). `observedAt`, `toolTrigger` and `verbose` work as on `remember`. The reply (`UpdateMemoryResult`, returned unchecked as Python's dict, so every key is optional) carries `version`, and `plan_headroom` read fail-open as `remember`'s is (v0.142.0+). See [the local rules](#updatememorys-local-rules) below. |
|
|
1606
1632
|
| `forget` | Soft-delete by `memoryId`, by `memoryIds` (1-50 ids in one call, memory-cloud v0.117.0+; returns a `ForgetBatchResult`, see [Session tools](#session-tools-memory-cloud-v0930)) or by `query`. The rows are kept, but not restorable through the API, until the deployment's cleanup window passes (`CLEANUP_DELETED_MEMORIES_RETENTION_DAYS`, default 30 days). For a caller who may write to the workspace, a target it may not delete, or one already gone, is skipped silently — including every guardrail for a caller below context editor or on an agent credential — so `deleted_count` can be 0. A workspace viewer may not delete at all and is refused with `KaguraPermissionError` (`requiredRole: "member"`). |
|
|
@@ -1689,6 +1715,21 @@ opt-in, in place of `explore_hints`. `explore()` itself is unaffected.
|
|
|
1689
1715
|
harness entry, and `kagura-memory-mcp --add-tools explore` sets it on the
|
|
1690
1716
|
proxy's upstream.
|
|
1691
1717
|
|
|
1718
|
+
`order: "date"` (memory-cloud v0.182.0+) answers how something changed over
|
|
1719
|
+
time: the same search, oldest first, each row with `date` (`YYYY-MM-DD`,
|
|
1720
|
+
UTC) and `date_source` (`"event"`, `"observed"` or `"created"`), and
|
|
1721
|
+
`order: "date"` on the reply. Superseded rows are included unless you pass
|
|
1722
|
+
`includeSuperseded: false`. `order` is sent only when set (a server from
|
|
1723
|
+
v0.82.0 that predates it refuses it with `invalid_argument`); without it,
|
|
1724
|
+
or with `"relevance"`, the reply is the one above and has none of these keys.
|
|
1725
|
+
|
|
1726
|
+
```ts
|
|
1727
|
+
const timeline = await client.recall({ contextId, query: "which day the team meets", order: "date", k: 10 });
|
|
1728
|
+
for (const hit of timeline.results) {
|
|
1729
|
+
console.log(hit.date, hit.date_source, hit.summary);
|
|
1730
|
+
}
|
|
1731
|
+
```
|
|
1732
|
+
|
|
1692
1733
|
#### Supersede suggestions
|
|
1693
1734
|
|
|
1694
1735
|
A `supersede_candidate` on a `recall` row or a `reference` memory is a
|
|
@@ -1897,7 +1938,8 @@ delivered as soon as it is placed in a reply, so a reply nobody reads uses it
|
|
|
1897
1938
|
up: it will not come again, here or in the person's MCP client. A caller that
|
|
1898
1939
|
does not show the `bootstrap` reply to a person (a script, a headless agent,
|
|
1899
1940
|
a scheduled job) should add `?notices=off` to its `mcpUrl`, which this SDK
|
|
1900
|
-
sends, query and all, with every MCP request
|
|
1941
|
+
sends, query and all, with every MCP request (`kagura-memory-mcp --notices
|
|
1942
|
+
off` and `kagura-memory setup … --notices off` write it for an MCP host):
|
|
1901
1943
|
|
|
1902
1944
|
```ts
|
|
1903
1945
|
// A script whose replies nobody reads: no notices.
|
|
@@ -1949,13 +1991,14 @@ the counterpart to `recall`'s probabilistic search.
|
|
|
1949
1991
|
|
|
1950
1992
|
| Method | What it does |
|
|
1951
1993
|
|--------|--------------|
|
|
1952
|
-
| `listContexts` | The contexts you can see, most recently used first, as a slim name→id directory (`id`, `name`, `is_private`, `is_locked`, `last_used_at`; server v0.73.0+). `nameContains` filters (server v0.73.0+; older servers ignore it and return every context); `includeSummary` (capped at 300 chars), `includeDetails` (full `summary` + `embedding_model`) and `includeStats` (`memory_count`) add fields. From v0.169.0 the connection selects the workspace by scoped API key, MCP URL, then current workspace. From v0.170.0 `count` is the visible count before filtering, and older servers report quota usage. `total` is the page size. `can_create` and the response `limit` describe workspace-wide capacity. `hint` can explain an empty directory or a full workspace with hidden contexts. From v0.82.0 the directory is paged — 100 contexts a page, 20 with `includeDetails` and no `nameContains` — with `has_more` / `next_cursor`: pass `next_cursor` back as `cursor` for the next page, with the same `nameContains`. `limit` sets the page size, 1-200; more than 20 with `includeDetails` and no non-blank `nameContains` throws before any request, as the server would refuse it. Servers before v0.82.0 ignore `limit` and `cursor` and return every context. `nameContains` is sent trimmed, and not at all when blank. There is no `maxChars`: the page's 20,000-character budget is fixed, and a v0.82.0+ server refuses an argument `list_contexts` does not declare. The envelope's `limit` is the plan's context maximum, not the page size. |
|
|
1994
|
+
| `listContexts` | The contexts you can see, most recently used first, as a slim name→id directory (`id`, `name`, `is_private`, `is_locked`, `last_used_at`; server v0.73.0+). `nameContains` filters (server v0.73.0+; older servers ignore it and return every context); `includeSummary` (capped at 300 chars), `includeDetails` (full `summary` + `embedding_model`) and `includeStats` (`memory_count`) add fields. From v0.169.0 the connection selects the workspace by scoped API key, MCP URL, then current workspace. From v0.170.0 `count` is the visible count before filtering, and older servers report quota usage. `total` is the page size. `can_create` and the response `limit` describe workspace-wide capacity. `hint` can explain an empty directory or a full workspace with hidden contexts. From v0.82.0 the directory is paged — 100 contexts a page, 20 with `includeDetails` and no `nameContains` — with `has_more` / `next_cursor`: pass `next_cursor` back as `cursor` for the next page, with the same `nameContains`. `limit` sets the page size, 1-200; more than 20 with `includeDetails` and no non-blank `nameContains` throws before any request, as the server would refuse it. Servers before v0.82.0 ignore `limit` and `cursor` and return every context. `nameContains` is sent trimmed, and not at all when blank. There is no `maxChars`: the page's 20,000-character budget is fixed, and a v0.82.0+ server refuses an argument `list_contexts` does not declare. The envelope's `limit` is the plan's context maximum, not the page size. `workspaceId` (v0.177.0+, sent only when set) lists another workspace the account is a member of instead of the connection's: then `count` / `total` describe that workspace, `limit` and `can_create` are absent, and an empty listing's `hint` says contexts there are created from a connection to it (`/mcp/w/<id>`). A workspace the caller is not a member of (or, under a workspace-scoped API key, any but the key's) throws `KaguraPermissionError` (`permission_denied`); a suspended one `KaguraError` `workspace_suspended`; one where the account has no seat `KaguraFeatureNotAvailableError`; a non-UUID, or the option on a server from v0.82.0 to v0.176.x, `invalid_argument` (one before v0.82.0 ignores it and lists the connection's workspace); a blank `workspaceId` throws before any request, as the server would read it as none. From v0.177.0 the reply also carries `other_workspaces` (how many other usable workspaces the account has, when there are any; never under a workspace-scoped key) and `workspaces_hint` (left out on the `google` / `microsoft` views). |
|
|
1995
|
+
| `listWorkspaces` | The workspaces the account is a member of (MCP `list_workspaces`, memory-cloud v0.177.0+), typed `AccountWorkspaceList`: `workspaces: [{id, name, role, current, usable, reason?}]` and `total`. `usable` says whether `listContexts({ workspaceId })` lists it now, `reason` why not (`workspace_suspended`, `feature_not_available`). The tool is in the `full` profile only but callable from any URL; a workspace-scoped API key sees only its workspace; it answers while the connection's workspace is suspended and is exempt from the daily MCP call limit. An older server throws `KaguraError` `unknown_tool`; a reply the model cannot read, `KaguraResponseError`. |
|
|
1953
1996
|
| `createContext` | New context. Throws `KaguraQuotaError` when the workspace limit is reached. The SDK checks `can_create` from a one-row `listContexts({ limit: 1 })` page first. When `count` is below the workspace limit, the pre-check error reports the limit and sets `current` to `null`. Its `gate` and plan fields are `null`. Also throws `KaguraFeatureNotAvailableError` for a shared one (`isPrivate: false`) on a plan without shared contexts (server v0.75.0+). `embeddingModel` cannot be changed through the API afterwards (an operator can migrate it server-side, v0.66.0+). `resourceId` is deprecated and no longer sent, since the server ignores it: set it with `updateContext`, or use `setupResource`. |
|
|
1954
|
-
| `getContextInfo` | Metadata plus, by default, a memory-count breakdown. On server v0.74.0+ also a trimmed `guardrails` block: absent when the MCP URL carries `?guardrails=off`, `null` when the server's read failed; its `provenance` (v0.79.0+) labels the items as notes context editors stored, not operator instructions. `search_config` carries `llm_selector_enabled` / `llm_selector_effective` (v0.115.0+). |
|
|
1997
|
+
| `getContextInfo` | Metadata plus, by default, a memory-count breakdown. On server v0.74.0+ also a trimmed `guardrails` block: absent when the MCP URL carries `?guardrails=off`, `null` when the server's read failed; its `provenance` (v0.79.0+) labels the items as notes context editors stored, not operator instructions. `search_config` carries `llm_selector_enabled` / `llm_selector_effective` (v0.115.0+) and `fusion` / `fusion_effective` (v0.178.0+). |
|
|
1955
1998
|
| `updateContext` | Change display name, summary, usage guide, visibility, lock. `isPublic: true` is plan-gated and throws `KaguraFeatureNotAvailableError` on a plan without public contexts. |
|
|
1956
1999
|
| `deleteContext` | Delete by id. Locked contexts are refused. |
|
|
1957
2000
|
| `mergeContexts` | Move memories between contexts. Both must share an embedding model and workspace. |
|
|
1958
|
-
| `updateSearchConfig` | Hybrid-search weights (must sum to 1.0 ±0.01), reranking (`useRerank`, which a `recall` that omits it follows) and the reranker (`voyage`, `cohere` or `self_hosted`), reinforce re-rank (`reinforceEnabled`, `reinforceMaxBoost`, `reinforceRequireHostArbitration`) and query routing (`routingMode`). The weights and reranker settings need context editor or above; a context that does not exist, or that the caller cannot
|
|
2001
|
+
| `updateSearchConfig` | Hybrid-search weights (must sum to 1.0 ±0.01), reranking (`useRerank`, which a `recall` that omits it follows) and the reranker (`voyage`, `cohere` or `self_hosted`), reinforce re-rank (`reinforceEnabled`, `reinforceMaxBoost`, `reinforceRequireHostArbitration`) and query routing (`routingMode`). `fusion` (v0.178.0+, sent only when set, not checked locally) picks how hybrid recall fuses its two legs: `auto` (the default: `weighted` when the weights are not 0.6 / 0.4, else the deployment's `HYBRID_FUSION`), `rrf` (suits conversation and work history) or `weighted` (with a higher `semanticWeight`, suits documents and manuals); the server refuses another value with `invalid_search_config`, a server from v0.82.0 to v0.177.x refuses the argument with `invalid_argument`, and one before v0.82.0 ignores it (success, nothing stored). The weights and reranker settings need context editor or above (`KaguraPermissionError`); a context that does not exist, or that the caller cannot reach, throws `KaguraNotFoundError` (`context_not_found`, v0.126.0+; older servers answered `permission_denied`). Returns the whole updated `config`, the only place the reinforce and routing fields come back; it also carries the content-chunk state (`content_chunks_enabled`, `_effective`, `_supported`, `_can_change`, `_disabled_reason`, `_in_use`, `_limit`, `_backfill_pending`, and `embedding_provider`; v0.110.0–v0.113.0) and the recall LLM selector's (`llm_selector_*`, v0.115.0+) and from v0.178.0 `fusion` with `fusion_effective`, the fusion recall resolves it to (`weighted`, `rrf` or the deployment's `keyword_floor`). `contentChunksEnabled` (v0.110.0+; on, memory content — not only summaries — goes to the embedding and rerank providers) and `llmSelectorEnabled` (v0.115.0+) turn them on or off; both need the context owner or a workspace owner/admin, and where the deployment gates them by plan, the plan's feature and a free slot (`KaguraFeatureNotAvailableError` / `KaguraQuotaError`). Write back the stored `*_enabled` flag and `fusion`, never `*_effective` / `fusion_effective`. |
|
|
1959
2002
|
| `setupResource` | Context + resource entity + ingestion token in one transaction. The returned token is plaintext and shown once. The context is named `name`, or `resourceId` when that is omitted. `summary` is deprecated and no longer sent, since the server ignores it: set it afterwards with `updateContext`. Plan-gated: throws `KaguraFeatureNotAvailableError` on a plan without resources. |
|
|
1960
2003
|
|
|
1961
2004
|
### Agent run-state
|
|
@@ -2523,7 +2566,7 @@ CLI as `kagura-memory`: 23 of the 24 top-level commands of the Python CLI
|
|
|
2523
2566
|
differ.
|
|
2524
2567
|
|
|
2525
2568
|
The parity target is the Python SDK and CLI **0.44.0**, checked against
|
|
2526
|
-
memory-cloud up to **v0.
|
|
2569
|
+
memory-cloud up to **v0.182.0**.
|
|
2527
2570
|
|
|
2528
2571
|
**SDK ↔ memory-cloud compatibility.**
|
|
2529
2572
|
[`docs/compatibility.md`](docs/compatibility.md) records, for each release
|