wontopos 2.2.4 → 2.2.6
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 +26 -1
- package/dist/wontopos.d.ts +2 -1
- package/dist/wontopos.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,32 @@ const ctx = await mem.recall("what does alice drink?", "alice");
|
|
|
24
24
|
|
|
25
25
|
`add` · `addTurn` · `addBulk` · `update` · `search` · `recall` · `history` · `stats` · `delete` · `deleteAll`
|
|
26
26
|
|
|
27
|
-
All methods take `{ userId }
|
|
27
|
+
All methods take `{ userId }` — it names the **store**: one isolated memory space per end-user, agent, or topic, then per account. WHO said each memory inside a store is the `speaker` tag below — storing the assistant's own words never needs a separate id.
|
|
28
|
+
|
|
29
|
+
## Who said it (speakers)
|
|
30
|
+
|
|
31
|
+
Every memory can carry a speaker: `"me"` for the assistant's own words, or a
|
|
32
|
+
person's name. Search accepts a speaker too, to recall one person's words only.
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
await mem.add("I promised to send the report on Friday", "alice", { speaker: "me" });
|
|
36
|
+
await mem.add("Bob said the deadline moved to Tuesday", "alice", { speaker: "Bob" });
|
|
37
|
+
await mem.search("what did Bob say about deadlines?", "alice", 10, { speaker: "Bob" });
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
A store remembers up to 50 people to start (a limit we plan to raise);
|
|
41
|
+
`"me"` never counts against it.
|
|
42
|
+
|
|
43
|
+
## Recall caching
|
|
44
|
+
|
|
45
|
+
Opt in per search and repeated or extended queries reuse the previous result
|
|
46
|
+
at 10% of the normal rate (Tablet and Scroll models):
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
const hits = await mem.search("...the conversation so far...", "alice", 10,
|
|
50
|
+
{ cache_control: { ttl: "5m" } }); // or "1h"
|
|
51
|
+
```
|
|
52
|
+
|
|
28
53
|
|
|
29
54
|
## Errors
|
|
30
55
|
|
package/dist/wontopos.d.ts
CHANGED
|
@@ -86,7 +86,8 @@ export declare class Client {
|
|
|
86
86
|
withModel(model: string): Client;
|
|
87
87
|
/** A client bound to `userId` as its default store (everything else kept). */
|
|
88
88
|
withUser(userId: string): Client;
|
|
89
|
-
/** Store one memory. `metadata` optional (e.g. { event_date: "2026-03-01" }).
|
|
89
|
+
/** Store one memory. `metadata` optional (e.g. { event_date: "2026-03-01" }).
|
|
90
|
+
* `metadata.speaker`: "me" = the assistant's own words, or a person's name (up to 50 per store). */
|
|
90
91
|
add(content: string, userId?: string, metadata?: Record<string, unknown>): Promise<any>;
|
|
91
92
|
/** Alias of `add` — store one memory. Same surface as the Python SDK's `store`. */
|
|
92
93
|
store(content: string, userId?: string, metadata?: Record<string, unknown>): Promise<any>;
|
package/dist/wontopos.js
CHANGED
|
@@ -73,7 +73,8 @@ export class Client {
|
|
|
73
73
|
// ----- write -----
|
|
74
74
|
// `userId` is optional in every call below - omit it to use the client's default
|
|
75
75
|
// store (set via `new Client({ apiKey, userId })` or `withUser`).
|
|
76
|
-
/** Store one memory. `metadata` optional (e.g. { event_date: "2026-03-01" }).
|
|
76
|
+
/** Store one memory. `metadata` optional (e.g. { event_date: "2026-03-01" }).
|
|
77
|
+
* `metadata.speaker`: "me" = the assistant's own words, or a person's name (up to 50 per store). */
|
|
77
78
|
add(content, userId, metadata = {}) {
|
|
78
79
|
return this.post("/api/v1/memory/store", { user_id: this.uid(userId), content, metadata });
|
|
79
80
|
}
|
package/package.json
CHANGED