getmnemo 0.1.1 → 0.1.2
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 +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# getmnemo
|
|
2
2
|
|
|
3
|
-
Official TypeScript / JavaScript SDK for [
|
|
3
|
+
Official TypeScript / JavaScript SDK for [Mnemo Memory](https://mnemohq.com) — long-term memory infrastructure for AI agents.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install
|
|
6
|
+
npm install getmnemo
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Zero runtime dependencies. Works in Node 18+, Bun, Deno, browsers, Cloudflare Workers, and any other modern JS runtime with `fetch`.
|
|
@@ -11,11 +11,11 @@ Zero runtime dependencies. Works in Node 18+, Bun, Deno, browsers, Cloudflare Wo
|
|
|
11
11
|
## Quickstart
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
import {
|
|
14
|
+
import { Mnemo } from 'getmnemo'
|
|
15
15
|
|
|
16
|
-
const memory = new
|
|
17
|
-
apiKey: process.env.
|
|
18
|
-
workspaceId: process.env.
|
|
16
|
+
const memory = new Mnemo({
|
|
17
|
+
apiKey: process.env.GETMNEMO_API_KEY!,
|
|
18
|
+
workspaceId: process.env.GETMNEMO_WORKSPACE_ID!,
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
// Store an atomic fact
|
|
@@ -40,15 +40,15 @@ for (const hit of hits) {
|
|
|
40
40
|
|
|
41
41
|
## Errors
|
|
42
42
|
|
|
43
|
-
All HTTP failures throw `
|
|
43
|
+
All HTTP failures throw `MnemoHTTPError` with `.status` and `.body`. Aborted requests throw `MnemoTimeoutError`. Both inherit from `MnemoError`.
|
|
44
44
|
|
|
45
45
|
```ts
|
|
46
|
-
import {
|
|
46
|
+
import { Mnemo, MnemoHTTPError } from 'getmnemo'
|
|
47
47
|
|
|
48
48
|
try {
|
|
49
49
|
await memory.search({ query: 'rice' })
|
|
50
50
|
} catch (err) {
|
|
51
|
-
if (err instanceof
|
|
51
|
+
if (err instanceof MnemoHTTPError && err.status === 401) {
|
|
52
52
|
console.error('API key rejected:', err.body)
|
|
53
53
|
} else {
|
|
54
54
|
throw err
|
|
@@ -60,10 +60,10 @@ try {
|
|
|
60
60
|
|
|
61
61
|
| Option | Default | Notes |
|
|
62
62
|
|---|---|---|
|
|
63
|
-
| `apiKey` | (required) | from <https://app.
|
|
63
|
+
| `apiKey` | (required) | from <https://app.mnemohq.com/settings/api-keys> |
|
|
64
64
|
| `workspaceId` | (required) | from the dashboard URL |
|
|
65
65
|
| `actorId` | none | optional default actor scope |
|
|
66
|
-
| `baseUrl` | `https://api.
|
|
66
|
+
| `baseUrl` | `https://api.mnemohq.com` | override for self-hosted |
|
|
67
67
|
| `timeoutMs` | `30000` | per-request abort timeout |
|
|
68
68
|
| `fetch` | global `fetch` | inject for testing or proxying |
|
|
69
69
|
|