kagura-memory 0.19.1 → 0.20.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 +43 -16
- package/dist/cli.js +367 -25
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +112 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +167 -10
- package/dist/index.d.ts +167 -10
- package/dist/index.js +112 -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.178.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
|
|
@@ -191,6 +191,8 @@ npx kagura-memory update-memory -m MEM_UUID --add-tag status:done --remove-tag s
|
|
|
191
191
|
--details-patch '{"status": "done"}' --expected-version 3 # partial edits (v0.140.0+), guarded (v0.113.0+)
|
|
192
192
|
npx kagura-memory update-memory -m MEM_UUID --accept-supersede-candidate # shadow the suggested older memory (v0.126.0+)
|
|
193
193
|
npx kagura-memory context search-config CTX_UUID --content-chunks --no-llm-selector # owner only (v0.110.0+ / v0.115.0+)
|
|
194
|
+
npx kagura-memory context search-config CTX_UUID --fusion rrf # hybrid fusion: auto, rrf or weighted (v0.178.0+)
|
|
195
|
+
npx kagura-memory workspace list # your workspaces; then context list --workspace-id WS_UUID (v0.177.0+)
|
|
194
196
|
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
197
|
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
198
|
npx kagura-memory list --filters '{"type": "task", "details.status": "open"}' --order-by created_at # exact filters, a total, no ranking
|
|
@@ -240,8 +242,23 @@ used contexts; when more follow, its stderr line names the
|
|
|
240
242
|
```bash
|
|
241
243
|
npx kagura-memory context list --limit 50
|
|
242
244
|
npx kagura-memory context list --limit 50 --cursor 50 # the next_cursor of the page before
|
|
245
|
+
npx kagura-memory context list --workspace-id WS_UUID # another workspace of yours (v0.177.0+)
|
|
243
246
|
```
|
|
244
247
|
|
|
248
|
+
**`context list --workspace-id`** (memory-cloud v0.177.0+) lists another
|
|
249
|
+
workspace the account is a member of, an id from **`workspace list`**,
|
|
250
|
+
which calls the MCP tool `list_workspaces` with the usual credential (no
|
|
251
|
+
owner key; a connector key is refused) and prints one row per workspace: `ID`, `NAME`, `ROLE`,
|
|
252
|
+
`CURRENT` (the connection's workspace) and `USABLE` (`yes`, or `no` with
|
|
253
|
+
the reason: `workspace_suspended`, `feature_not_available`), or with
|
|
254
|
+
`--json` the Python SDK model's dump, as the Python CLI 0.49.0 prints both;
|
|
255
|
+
the NAME column is as wide as the longest name (at least the header),
|
|
256
|
+
counting an East Asian wide or fullwidth character (CJK, most emoji) as two
|
|
257
|
+
columns, so no name is cut. `--workspace-id` must be a UUID (exit 2).
|
|
258
|
+
**`context search-config --fusion auto|rrf|weighted`** (v0.178.0+) sets
|
|
259
|
+
how hybrid recall fuses its two legs; any other value is a usage error
|
|
260
|
+
(exit 2).
|
|
261
|
+
|
|
245
262
|
**`update-memory --merge-details`** (and `--details-patch`, a patch you
|
|
246
263
|
write yourself) sends `--details` / `--location` as one `details_patch`
|
|
247
264
|
call, as the Python CLI 0.44.0 does: the server merges their top-level keys
|
|
@@ -400,8 +417,8 @@ URL likewise from `--mcp-url`, else that file's `mcp_url`, else
|
|
|
400
417
|
reads it. It never takes them from `~/.kagura.json`, nor, with
|
|
401
418
|
`--project-dir`, from the current directory's `.kagura.json`: those are
|
|
402
419
|
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,
|
|
420
|
+
parameters that `--guardrails`, `--tool-profile`, `--add-tools`,
|
|
421
|
+
`--context` and `--notices` set go on the entry's URL only. A plain-HTTP URL to a host other than localhost is refused,
|
|
405
422
|
whichever of the three it came from, before anything is written or run
|
|
406
423
|
(exit 1, `Connection failed: MCP URL must use HTTPS for security …`, the
|
|
407
424
|
Python CLI's words, whose connection test refuses it).
|
|
@@ -597,16 +614,24 @@ allowlist already on the URL wins over both, which gets a warning.
|
|
|
597
614
|
`--context CONTEXT_ID` (`setup claude`; v0.114.0+) names the connection's
|
|
598
615
|
default context: context-scoped tools called without `context_id` run in
|
|
599
616
|
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
|
-
|
|
617
|
+
so it never widens access; unlike `--context-id`, it must be a UUID.
|
|
618
|
+
`--notices off` (every harness; v0.161.0+) puts `?notices=off` on the URL,
|
|
619
|
+
so `bootstrap` replies carry no service notices. Each notice is delivered
|
|
620
|
+
once per person, so only an entry no person reads (a scheduled job, CI)
|
|
621
|
+
should turn them off; setup never writes it unasked. `off` is the only
|
|
622
|
+
value the server reads (any case), and any other is refused (exit 2).
|
|
623
|
+
Unlike a `--guardrails` context it is written for Hermes and OpenClaw too,
|
|
624
|
+
since the notices come in a tool reply; the plugin `server_url` that
|
|
625
|
+
`setup claude` prints never carries it. On
|
|
626
|
+
codex, hermes and openclaw a `?profile=`, `?add_tools=` or `?notices=` already in
|
|
602
627
|
`--mcp-url` is kept when the flag is absent, and Codex's `--guardrails`
|
|
603
628
|
preview repeats the entry's view (`--profile` / `--tools` /
|
|
604
629
|
`--add-tools`), so its truncation note names a tool the entry lists. The
|
|
605
630
|
keys go at the end of the query in Python's order (`guardrails`,
|
|
606
|
-
`profile`, `add_tools`, `context`), replacing any value already there,
|
|
631
|
+
`profile`, `add_tools`, `context`, `notices`), replacing any value already there,
|
|
607
632
|
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
|
|
633
|
+
run that leaves out a `guardrails`, `profile`, `add_tools`, `context` or
|
|
634
|
+
`notices=off` value the entry it replaces had, or its `?tools=` allowlist (which goes
|
|
610
635
|
back on `--mcp-url`), says so in a note, reading the old URL as the
|
|
611
636
|
server does: the first value of each key, trimmed; a blank one, or a
|
|
612
637
|
`?tools=` naming no tool, is left out, as the Python CLI 0.44.0 does.
|
|
@@ -1107,7 +1132,7 @@ when `KAGURA_PROFILE` is set and still overrides the new default; an
|
|
|
1107
1132
|
unknown name exits 1 and lists the stored profiles, and a missing or
|
|
1108
1133
|
extra argument is a usage error (exit 2).
|
|
1109
1134
|
|
|
1110
|
-
**`workspace` and the `auth` key commands** (memory-cloud v0.42.0+)
|
|
1135
|
+
**`workspace member|invite` and the `auth` key commands** (memory-cloud v0.42.0+)
|
|
1111
1136
|
manage a workspace's members, invitations and member API keys:
|
|
1112
1137
|
`workspace member list|add|set-role|remove`, `workspace invite
|
|
1113
1138
|
create|list|revoke`, and `auth create-key|list-keys|revoke-key`, which
|
|
@@ -1549,7 +1574,7 @@ unknown, not that no plan lifts it. That covers an older server, and
|
|
|
1549
1574
|
`createContext`'s own context-limit check, which reads a one-row
|
|
1550
1575
|
`listContexts({ limit: 1 })` page and so fills in only `quotaType`,
|
|
1551
1576
|
`current` and `limit`. When the workspace is full but `count` is below
|
|
1552
|
-
`limit`, `current` is `null
|
|
1577
|
+
`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
1578
|
from the pre-check can be a lower bound because `count` includes only visible
|
|
1554
1579
|
contexts.
|
|
1555
1580
|
|
|
@@ -1897,7 +1922,8 @@ delivered as soon as it is placed in a reply, so a reply nobody reads uses it
|
|
|
1897
1922
|
up: it will not come again, here or in the person's MCP client. A caller that
|
|
1898
1923
|
does not show the `bootstrap` reply to a person (a script, a headless agent,
|
|
1899
1924
|
a scheduled job) should add `?notices=off` to its `mcpUrl`, which this SDK
|
|
1900
|
-
sends, query and all, with every MCP request
|
|
1925
|
+
sends, query and all, with every MCP request (`kagura-memory-mcp --notices
|
|
1926
|
+
off` and `kagura-memory setup … --notices off` write it for an MCP host):
|
|
1901
1927
|
|
|
1902
1928
|
```ts
|
|
1903
1929
|
// A script whose replies nobody reads: no notices.
|
|
@@ -1949,13 +1975,14 @@ the counterpart to `recall`'s probabilistic search.
|
|
|
1949
1975
|
|
|
1950
1976
|
| Method | What it does |
|
|
1951
1977
|
|--------|--------------|
|
|
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. |
|
|
1978
|
+
| `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). |
|
|
1979
|
+
| `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
1980
|
| `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+). |
|
|
1981
|
+
| `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
1982
|
| `updateContext` | Change display name, summary, usage guide, visibility, lock. `isPublic: true` is plan-gated and throws `KaguraFeatureNotAvailableError` on a plan without public contexts. |
|
|
1956
1983
|
| `deleteContext` | Delete by id. Locked contexts are refused. |
|
|
1957
1984
|
| `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
|
|
1985
|
+
| `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
1986
|
| `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
1987
|
|
|
1961
1988
|
### Agent run-state
|
|
@@ -2523,7 +2550,7 @@ CLI as `kagura-memory`: 23 of the 24 top-level commands of the Python CLI
|
|
|
2523
2550
|
differ.
|
|
2524
2551
|
|
|
2525
2552
|
The parity target is the Python SDK and CLI **0.44.0**, checked against
|
|
2526
|
-
memory-cloud up to **v0.
|
|
2553
|
+
memory-cloud up to **v0.178.0**.
|
|
2527
2554
|
|
|
2528
2555
|
**SDK ↔ memory-cloud compatibility.**
|
|
2529
2556
|
[`docs/compatibility.md`](docs/compatibility.md) records, for each release
|