@melra/memory 0.3.0-alpha.3 → 0.3.0-alpha.5
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 +44 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @melra/memory
|
|
2
|
+
|
|
3
|
+
Scoped, redacted local memory for [MELRA](https://github.com/XAGI-Lab/melra):
|
|
4
|
+
put, search, list, delete, and clear, backed by the same SQLite database as
|
|
5
|
+
tasks and workflows.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @melra/memory
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { MemoryOperationSchema } from "@melra/protocol";
|
|
13
|
+
import { LocalMemory, rankMemories } from "@melra/memory";
|
|
14
|
+
|
|
15
|
+
const memory = new LocalMemory(store);
|
|
16
|
+
memory.execute(
|
|
17
|
+
MemoryOperationSchema.parse({
|
|
18
|
+
kind: "memory",
|
|
19
|
+
action: "put",
|
|
20
|
+
key: "deploy-owner",
|
|
21
|
+
value: "platform team",
|
|
22
|
+
}),
|
|
23
|
+
);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`MemoryOperation` is the post-defaults shape, so parse the operation through the
|
|
27
|
+
schema rather than hand-filling `scope`, `confidence`, `tags`, `limit`, and
|
|
28
|
+
`includeSuperseded`.
|
|
29
|
+
|
|
30
|
+
Search is lexical, not embedded — tokenised, ranked by term overlap with exact
|
|
31
|
+
phrase matches promoted. That is a deliberate ceiling: it is deterministic,
|
|
32
|
+
needs no model call, and never sends anything anywhere. `rankMemories` and
|
|
33
|
+
`tokenize` are exported if you want the ranking without the store.
|
|
34
|
+
|
|
35
|
+
Every value passes through `redactMemoryValue` before it is written, so a token
|
|
36
|
+
pasted into a memory entry is not preserved in the database.
|
|
37
|
+
|
|
38
|
+
Reads and deletes are scope-aware: a scope only sees its own entries, so one
|
|
39
|
+
task cannot read what another stored by guessing a key.
|
|
40
|
+
|
|
41
|
+
Requires Node.js 22 or newer. Full documentation:
|
|
42
|
+
[github.com/XAGI-Lab/melra](https://github.com/XAGI-Lab/melra)
|
|
43
|
+
|
|
44
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melra/memory",
|
|
3
|
-
"version": "0.3.0-alpha.
|
|
3
|
+
"version": "0.3.0-alpha.5",
|
|
4
4
|
"description": "Scoped and redacted local memory layer for MELRA.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@melra/protocol": "0.3.0-alpha.
|
|
25
|
-
"@melra/storage-sqlite": "0.3.0-alpha.
|
|
24
|
+
"@melra/protocol": "0.3.0-alpha.5",
|
|
25
|
+
"@melra/storage-sqlite": "0.3.0-alpha.5"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsc -p tsconfig.json",
|