memorio 5.1.0 → 5.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 +38 -6
- package/global.cjs +1 -1
- package/global.js +1 -1
- package/index.cjs +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/types/bun-sqlite.d.ts +14 -0
- package/types/encryption.d.ts +2 -2
- package/vsix/memorio.vsix +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# 🧠 memorio
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/memorio)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
[](https://bundlephobia.com/package/memorio)
|
|
8
|
+
[](https://socket.dev/npm/package/memorio)
|
|
9
|
+
[](https://snyk.io/test/npm/memorio)
|
|
10
|
+
[](#security)
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+
[](#license)
|
|
18
|
+
|
|
19
|
+
<!--
|
|
20
|
+
[](https://github.com/GITHUB_ORG/GITHUB_REPO/actions)
|
|
21
|
+
-->
|
|
22
|
+
|
|
3
23
|
**The memory layer for AI agents and apps — owned by the user, not the vendor.**
|
|
4
24
|
|
|
5
25
|
```ts
|
|
@@ -19,9 +39,9 @@ Just data, available where your application needs it.
|
|
|
19
39
|
|
|
20
40
|
## Why memorio
|
|
21
41
|
|
|
22
|
-
|
|
42
|
+
That's the whole API for the simple case. No provider tree, no boilerplate.
|
|
23
43
|
|
|
24
|
-
Usually that means a different library — and a different mental model — for each. Memorio gives them one consistent runtime, without making the simple case complicated:
|
|
44
|
+
But real apps grow. Most AI-powered apps (and most apps in general) eventually need more than "just state" — persistence, session data, caches, structured browser storage, local SQL, application memory, history, optional sync. Usually that means pulling in a different library — and a different mental model — for each. Memorio gives them one consistent runtime, without making the simple case complicated:
|
|
25
45
|
|
|
26
46
|
```ts
|
|
27
47
|
state.value = 42
|
|
@@ -64,15 +84,15 @@ observer('state.user', user => {
|
|
|
64
84
|
And this is what makes memorio a *memory* layer, not just a state manager - structured, inspectable facts about a user or agent, not just ephemeral UI state:
|
|
65
85
|
|
|
66
86
|
```ts
|
|
67
|
-
import {
|
|
87
|
+
import { memory } from 'memorio'
|
|
68
88
|
|
|
69
|
-
await
|
|
89
|
+
await memory.remember('user.language', 'Italian', {
|
|
70
90
|
type: 'preference',
|
|
71
91
|
confidence: 0.92,
|
|
72
92
|
source: 'conversation'
|
|
73
93
|
})
|
|
74
94
|
|
|
75
|
-
const language = await
|
|
95
|
+
const language = await memory.recall('user.language')
|
|
76
96
|
// { value: 'Italian', confidence: 0.92, source: 'conversation', ... }
|
|
77
97
|
```
|
|
78
98
|
|
|
@@ -134,6 +154,18 @@ For most apps, that's enough. Everything below is an optional capability you can
|
|
|
134
154
|
|
|
135
155
|
---
|
|
136
156
|
|
|
157
|
+
## Honest limitations
|
|
158
|
+
|
|
159
|
+
Memorio is upfront about what it doesn't do, so you don't find out the hard way:
|
|
160
|
+
|
|
161
|
+
- **No encryption by default.** Data is stored in plain text unless you explicitly turn on `memorio.encryption` or pass an `encryptionKey`. See [`SECURITY.md`](./SECURITY.md).
|
|
162
|
+
- **Namespaces/contexts aren't a security boundary.** `memorio.isolate()` gives you logical separation between tenants or sessions, not authorization or access control — enforce that at your application layer.
|
|
163
|
+
- **SQLite persistence (`sql.js` backend) isn't incremental.** Each write exports and re-saves the whole database, which gets costly as data grows. The `bun:sqlite` backend avoids this cost but doesn't support `export()` at all — see [`markdown/SQLITE.md`](./markdown/SQLITE.md).
|
|
164
|
+
- **`memory.context()` is rule-based, not embedding-based.** It ranks structured entries by recency, confidence, and type — it does not do semantic similarity search. Pair it with a vector store if your agent needs "find things like this."
|
|
165
|
+
- **Key management is your responsibility.** Memorio's encryption is client-side; it doesn't manage, rotate, or store keys for you.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
137
169
|
## When to use something else
|
|
138
170
|
|
|
139
171
|
- **A strict Redux-style architecture** - when you need action pipelines, extensive middleware, event-sourcing, or mature time-travel tooling. Memorio can integrate rather than replace - see [`markdown/REDUX.md`](./markdown/REDUX.md).
|
|
@@ -152,7 +184,7 @@ For most apps, that's enough. Everything below is an optional capability you can
|
|
|
152
184
|
5. **Memory has meaning** - confidence, source, type, scope, TTL, tags, history, status: more than "just a value."
|
|
153
185
|
6. **Memory belongs to whoever it's about** - structured and inspectable by default, encryptable with a key the vendor doesn't have to hold.
|
|
154
186
|
7. **Global access is explicit** - opt in with `import 'memorio/global'`, or keep it explicit with named imports.
|
|
155
|
-
8. **Tell the truth about boundaries** - encryption is opt-in (not default), contexts aren't authorization, and there's no embedding search unless paired with one.
|
|
187
|
+
8. **Tell the truth about boundaries** - encryption is opt-in (not default), contexts aren't authorization, and there's no embedding search unless paired with one. (See [Honest limitations](#honest-limitations) above.)
|
|
156
188
|
9. **Keep the common case tiny** - `state.value = 42` is a complete, valid program.
|
|
157
189
|
|
|
158
190
|
---
|
package/global.cjs
CHANGED
package/global.js
CHANGED
package/index.cjs
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module 'bun:sqlite' {
|
|
2
|
+
export class Database {
|
|
3
|
+
constructor(path: string)
|
|
4
|
+
run(sql: string, ...params: any[]): any
|
|
5
|
+
query(sql: string): { all(...params: any[]): any[]; get(...params: any[]): any }
|
|
6
|
+
close(): void
|
|
7
|
+
prepare(sql: string): { all(...params: any[]): any[]; get(...params: any[]): any }
|
|
8
|
+
}
|
|
9
|
+
export class Statement {
|
|
10
|
+
all(...params: any[]): any[]
|
|
11
|
+
get(...params: any[]): any
|
|
12
|
+
run(...params: any[]): any
|
|
13
|
+
}
|
|
14
|
+
}
|
package/types/encryption.d.ts
CHANGED
package/vsix/memorio.vsix
CHANGED
|
Binary file
|