@mnemoverse/mcp-memory-server 0.8.4 → 0.9.1
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 +2 -5
- package/dist/errors.d.ts +171 -0
- package/dist/errors.js +500 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.js +98 -175
- package/dist/index.js.map +1 -1
- package/dist/names.d.ts +6 -3
- package/dist/names.js +6 -3
- package/dist/names.js.map +1 -1
- package/dist/render.d.ts +6 -6
- package/dist/render.js +6 -6
- package/dist/requests.d.ts +5 -3
- package/dist/requests.js +5 -3
- package/dist/requests.js.map +1 -1
- package/dist/teaching.d.ts +5 -2
- package/dist/teaching.js +5 -2
- package/dist/teaching.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://arxiv.org/abs/2603.08965)
|
|
8
8
|
[](https://glama.ai/mcp/servers/mnemoverse/mcp-memory-server)
|
|
9
9
|
|
|
10
|
-
Hosted memory for AI agents that learns which facts matter. Feedback
|
|
10
|
+
Hosted memory for AI agents that learns which facts matter. Feedback re-ranks recall — a Rescorla-Wagner update on the prediction error, not a similarity score — so what helped rises and what misled sinks, with a bounded recency tie-breaker for fresh memories. The engine also ships consolidation (HDBSCAN clustering, with Von Restorff protection so distinctive memories survive compression). One API key works across Claude, Cursor, VS Code, ChatGPT, and any MCP client.
|
|
11
11
|
|
|
12
12
|
Memory that persists across sessions, projects, and tools — and improves with use. Hosted, so there's no infrastructure to run, and not locked to a single cloud.
|
|
13
13
|
|
|
@@ -203,8 +203,6 @@ If it doesn't remember: check that the client was fully restarted and the config
|
|
|
203
203
|
| `memory_list_recent` | List newest memories first — no query; `since`/`until` bounds (inclusive) + cursor paging |
|
|
204
204
|
| `memory_feedback` | Rate memories as helpful or not (improves future recall) |
|
|
205
205
|
| `memory_stats` | Check how many memories stored, which domains exist |
|
|
206
|
-
| `memory_delete` | Permanently delete a single memory by `atom_id` |
|
|
207
|
-
| `memory_delete_domain` | Wipe an entire domain (requires `confirm: true` safety interlock) |
|
|
208
206
|
| `memory_create_room` | Create a shared memory room; its address works as a `domain` on write/read |
|
|
209
207
|
| `memory_invite_to_room` | Mint a one-time invite (code + link) for a room you own |
|
|
210
208
|
| `memory_join_room` | Join a shared room with an invite code (`mnvr_...`) |
|
|
@@ -277,7 +275,6 @@ What each tool sends:
|
|
|
277
275
|
| `memory_read` | the `query`, plus any filters: `domain`, `since`/`until`, `exclude_author`, `top_k`, `order_by` |
|
|
278
276
|
| `memory_list_recent` | the feed filters: `domain`, `since`/`until`, `exclude_author`, `limit`, `cursor` |
|
|
279
277
|
| `memory_feedback` | the `atom_ids` being rated and the `outcome` score |
|
|
280
|
-
| `memory_delete` / `memory_delete_domain` | the `atom_id` / `domain` being deleted |
|
|
281
278
|
| `memory_create_room` | the room `name` and `description` |
|
|
282
279
|
| `memory_invite_to_room` | the `room_id`, invite `scope`, and expiry |
|
|
283
280
|
| `memory_join_room` | the invite `code` |
|
|
@@ -288,7 +285,7 @@ One thing goes out that you did not explicitly request: since 0.8.1, when a sear
|
|
|
288
285
|
| | |
|
|
289
286
|
|---|---|
|
|
290
287
|
| **Privacy Policy** | <https://mnemoverse.com/privacy> |
|
|
291
|
-
| **Retention & deletion** |
|
|
288
|
+
| **Retention & deletion** | correct a wrong or stale memory by writing a fresh one; deletion is an administrative operation on the REST API, not exposed through this MCP server |
|
|
292
289
|
| **Contact** | hello@mnemoverse.com |
|
|
293
290
|
|
|
294
291
|
## License
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a failed API call TELLS THE AGENT TO DO.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS MODULE EXISTS. Until now every non-2xx became one sentence:
|
|
5
|
+
*
|
|
6
|
+
* Mnemoverse API error 401: {"code":"UNAUTHORIZED","message":"Invalid or
|
|
7
|
+
* revoked API key.","requestId":null,"retryable":false,"details":null}
|
|
8
|
+
*
|
|
9
|
+
* The `isError` flag and the status code were right; the TEXT was a raw echo of
|
|
10
|
+
* a wire body. Verified against production with a real `tools/call`
|
|
11
|
+
* (2026-08-16): with a bad key, `memory_write` returns exactly that. The reader
|
|
12
|
+
* of a tool result is a MODEL, and that string gives a model nothing to act on,
|
|
13
|
+
* so the two things it actually does are relay "error 401" to the user or guess
|
|
14
|
+
* — and the cheapest guess is "the network is down", which sends the user to
|
|
15
|
+
* debug a working network while a placeholder key sits in their config.
|
|
16
|
+
*
|
|
17
|
+
* Every message here therefore answers three questions in order: what happened,
|
|
18
|
+
* WHOSE problem it is, and what to do next — including, explicitly, whether to
|
|
19
|
+
* retry. "Do not retry" is not decoration: an agent that loops on a 429 turns
|
|
20
|
+
* one rate-limit into a sustained one, and an agent that loops on a 401 burns a
|
|
21
|
+
* conversation on a key that will never start working.
|
|
22
|
+
*
|
|
23
|
+
* THE RAW BODY IS NEVER DROPPED. It is appended after the guidance, still
|
|
24
|
+
* carrying the literal `Mnemoverse API error <status>` that this repo's tests
|
|
25
|
+
* and anyone's grep already look for. Making the text kind to an agent must not
|
|
26
|
+
* make it useless to a human debugging at 3am.
|
|
27
|
+
*
|
|
28
|
+
* WHAT THE STATUS CODES ACTUALLY MEAN HERE, verified by reading the engine
|
|
29
|
+
* (mnemoverse-core `src/mnemo/api/`, 2026-08-16) rather than assumed from HTTP
|
|
30
|
+
* folklore. The distinctions below are the entire point of this file:
|
|
31
|
+
*
|
|
32
|
+
* 401 auth.py — "Invalid or revoked API key." / "Missing API key." The key.
|
|
33
|
+
* 403 routes.py, rooms_routes.py, auth.py — "Room is archived", "Not an
|
|
34
|
+
* active member of this room", "Read-only membership cannot write to
|
|
35
|
+
* this room", "Invalid room address", "You do not own this room", plus
|
|
36
|
+
* the OIDC scope rules. NOT a bad key: the caller was identified and
|
|
37
|
+
* then refused. Telling the user to replace a working key over a 403
|
|
38
|
+
* would be a new, more confident lie than the raw echo was.
|
|
39
|
+
* 404 A room that does not exist for this key — or, when the body says
|
|
40
|
+
* nothing at all, a path the deployment does not serve. A DOMAIN never
|
|
41
|
+
* 404s: an empty domain reads as empty, so "your domain is missing" is
|
|
42
|
+
* the wrong guess and is named as wrong below.
|
|
43
|
+
* 429 THREE different causes with opposite advice. rate_limit.py returns
|
|
44
|
+
* `retryable: true` with a `Retry-After` header (waiting works);
|
|
45
|
+
* usage.py (daily quota) and subscription_guard.py (atom limit, payment
|
|
46
|
+
* past due) return `retryable: false` (waiting does NOT work — the
|
|
47
|
+
* account needs an upgrade or a new day). A blanket "wait and retry"
|
|
48
|
+
* would be wrong for two of the three.
|
|
49
|
+
* 5xx auth.py returns 503 `retryable: true` when its DB pool is gone. Ours,
|
|
50
|
+
* not theirs.
|
|
51
|
+
*
|
|
52
|
+
* RELATION TO THE STARTUP PROBE (src/index.ts, `probeApiKeyInBackground`, added
|
|
53
|
+
* in 0.8.4). That probe treats 401 and 403 alike, and is right to: it calls
|
|
54
|
+
* `GET /memory/stats`, which addresses no room, so a 403 there can only come
|
|
55
|
+
* from the auth layer. On a TOOL CALL the same status usually comes from a room
|
|
56
|
+
* the caller named, which is why the two surfaces diverge on 403 and must not be
|
|
57
|
+
* "unified" by a later reader. They agree where it matters: same `Mnemoverse:`
|
|
58
|
+
* opener, same `MNEMOVERSE_API_KEY` variable name, same console origin.
|
|
59
|
+
*/
|
|
60
|
+
/** Everything known about one failed call, at the moment it failed. */
|
|
61
|
+
export interface ApiFailure {
|
|
62
|
+
/** HTTP status. */
|
|
63
|
+
status: number;
|
|
64
|
+
/** Response body, verbatim and unparsed. */
|
|
65
|
+
body: string;
|
|
66
|
+
/** Uppercase HTTP verb. */
|
|
67
|
+
method: string;
|
|
68
|
+
/** Path below the API base, e.g. "/memory/write". Deliberately NOT the full
|
|
69
|
+
* URL: the base can carry credentials, and the path alone is what identifies
|
|
70
|
+
* the operation. */
|
|
71
|
+
path: string;
|
|
72
|
+
/** `Retry-After` header when the response carried one. */
|
|
73
|
+
retryAfter?: string | null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The engine's error envelope, as much of it as survived parsing.
|
|
77
|
+
*
|
|
78
|
+
* Every field is optional because a non-2xx does not have to come from the
|
|
79
|
+
* engine at all: a proxy, a tunnel, or a wrong `MNEMOVERSE_API_URL` answers with
|
|
80
|
+
* HTML, plain text or nothing. A missing field means "the body did not say",
|
|
81
|
+
* never a default — inventing `retryable: false` for an unparseable body would
|
|
82
|
+
* put a retry decision on evidence that does not exist.
|
|
83
|
+
*/
|
|
84
|
+
export interface ErrorEnvelope {
|
|
85
|
+
code?: string;
|
|
86
|
+
message?: string;
|
|
87
|
+
retryable?: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Read the engine's envelope out of a response body.
|
|
91
|
+
*
|
|
92
|
+
* Two shapes are accepted because core produces both: its own middleware writes
|
|
93
|
+
* `{code, message, retryable, details}` at the top level, while anything raised
|
|
94
|
+
* as a FastAPI `HTTPException` arrives wrapped as `{"detail": …}` — where the
|
|
95
|
+
* detail is sometimes a string and sometimes the envelope again. The feed's
|
|
96
|
+
* 404-vs-404 test in this repo pins the nested form, so both are real.
|
|
97
|
+
*/
|
|
98
|
+
export declare function parseErrorEnvelope(body: string): ErrorEnvelope;
|
|
99
|
+
/** `Retry-After` as whole seconds, when it is a plain number. The HTTP-date
|
|
100
|
+
* form is legal too, and is deliberately NOT parsed: an unparsed header
|
|
101
|
+
* degrades into "wait a moment", which is honest, whereas a misparsed date
|
|
102
|
+
* would print a confident and wrong number of seconds. */
|
|
103
|
+
export declare function retryAfterSeconds(header: string | null | undefined): number | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* The agent-facing explanation for one failed call, with the raw body kept
|
|
106
|
+
* after it.
|
|
107
|
+
*
|
|
108
|
+
* Total by construction: every status reaches a sentence, and the fallback says
|
|
109
|
+
* that it has no specific guidance instead of inventing some.
|
|
110
|
+
*/
|
|
111
|
+
export declare function explainApiFailure(f: ApiFailure): string;
|
|
112
|
+
/**
|
|
113
|
+
* The request never got an answer at all: DNS, connectivity, a host that does
|
|
114
|
+
* not listen, or this client's own probe deadline firing.
|
|
115
|
+
*
|
|
116
|
+
* Included even though the brief was about HTTP statuses, because it is the
|
|
117
|
+
* OTHER half of the same defect and the two are easy to confuse. The 401
|
|
118
|
+
* message above tells an agent not to blame the network; this is the case where
|
|
119
|
+
* the network genuinely IS the answer, and `TypeError: fetch failed` — which is
|
|
120
|
+
* all a model saw before — is no more actionable than the raw 401 body was.
|
|
121
|
+
*
|
|
122
|
+
* A timeout is named separately because the advice differs in one word: an
|
|
123
|
+
* unreachable host is unlikely to become reachable in three seconds, whereas a
|
|
124
|
+
* request that ran out of time may well succeed on a second try.
|
|
125
|
+
*/
|
|
126
|
+
export declare function explainNetworkFailure(method: string, path: string, cause: unknown): string;
|
|
127
|
+
/** {@link explainNetworkFailure} as an error, so `instanceof` can tell a
|
|
128
|
+
* transport failure from an HTTP one without reading either message. */
|
|
129
|
+
export declare class NetworkError extends Error {
|
|
130
|
+
readonly method: string;
|
|
131
|
+
readonly path: string;
|
|
132
|
+
constructor(method: string, path: string, cause: unknown);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A failed API call, as an ERROR OBJECT rather than a parsed string.
|
|
136
|
+
*
|
|
137
|
+
* The status and the body are fields because a caller that needs to branch on
|
|
138
|
+
* them must not do it by matching the message. `memory_list_recent` used to
|
|
139
|
+
* decide between "the endpoint is not deployed" and "this room does not exist"
|
|
140
|
+
* with `message.startsWith("Mnemoverse API error 404:")`, which coupled a
|
|
141
|
+
* behavioural branch to the exact prefix of a user-facing sentence — so
|
|
142
|
+
* improving the sentence, which is this change, would have silently flipped
|
|
143
|
+
* that branch. Structured fields make the wording free to change.
|
|
144
|
+
*/
|
|
145
|
+
export declare class ApiError extends Error {
|
|
146
|
+
readonly status: number;
|
|
147
|
+
readonly body: string;
|
|
148
|
+
readonly method: string;
|
|
149
|
+
readonly path: string;
|
|
150
|
+
/** The engine's envelope, already parsed — so a caller never re-parses. */
|
|
151
|
+
readonly envelope: ErrorEnvelope;
|
|
152
|
+
constructor(f: ApiFailure);
|
|
153
|
+
/**
|
|
154
|
+
* A 404 the ENGINE did not answer: silence, or the router's literal
|
|
155
|
+
* defaults. This is what a path the deployment does not serve looks like
|
|
156
|
+
* — the first version of this predicate tested silence alone, mistook the
|
|
157
|
+
* real framework body `{"detail":"Not Found"}` for an engine answer, and
|
|
158
|
+
* un-fired the feed's degrade branch for the exact rollout case it exists
|
|
159
|
+
* for (panel, #93).
|
|
160
|
+
*
|
|
161
|
+
* NAMED FOR WHAT IT TESTS, not for what it implies: a gateway, a proxy or a
|
|
162
|
+
* wrong MNEMOVERSE_API_URL can produce the same shapes and is
|
|
163
|
+
* indistinguishable from here. Known, accepted edge: a foreign API whose
|
|
164
|
+
* 404 nests its error under a key this parser does not read
|
|
165
|
+
* (`{"error":{…}}`) also reads as bare, so the feed degrades to its
|
|
166
|
+
* not-supported notice instead of surfacing the foreign body — bounded
|
|
167
|
+
* harm, since against a wrong base URL the very next call fails with the
|
|
168
|
+
* instructive no-envelope wording.
|
|
169
|
+
*/
|
|
170
|
+
get isBare404(): boolean;
|
|
171
|
+
}
|