@slashml/memory 1.0.13 → 1.0.15
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 +29 -1
- package/bin/cli.js +881 -113
- package/dist/index.d.ts +188 -6
- package/dist/index.js +439 -76
- package/dist/index.mjs +1 -0
- package/package.json +2 -2
- package/src/index.ts +727 -89
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ npm install @slashml/memory
|
|
|
11
11
|
Configure your API key in the environment:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
export SLASHML_API_KEY="
|
|
14
|
+
export SLASHML_API_KEY="sml_live_..."
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Quickstart (Mem0 Drop-in Replacement)
|
|
@@ -90,6 +90,34 @@ const decision = await client.intervene("aws ec2 run-instances --placement Avail
|
|
|
90
90
|
});
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
## Inline Redaction & Per-Agent Read/Write Access Control
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { Memory } from "@slashml/memory";
|
|
97
|
+
|
|
98
|
+
const admin = new Memory({ apiKey: process.env.SLASHML_API_KEY });
|
|
99
|
+
|
|
100
|
+
// Set workspace redaction defaults & configure a read-only agent policy
|
|
101
|
+
await admin.setRedactionPolicy({
|
|
102
|
+
redactPolicy: "tier1_secrets",
|
|
103
|
+
redactScope: "recall_only",
|
|
104
|
+
accessMode: "read_write",
|
|
105
|
+
});
|
|
106
|
+
await admin.agents.set("support_triage_bot", {
|
|
107
|
+
accessMode: "read_only",
|
|
108
|
+
redactPolicy: "gdpr",
|
|
109
|
+
redactScope: "recall_only",
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// Scoped agent client attaches X-SlashML-Agent-Id automatically
|
|
113
|
+
const triage = new Memory({
|
|
114
|
+
apiKey: process.env.SLASHML_API_KEY,
|
|
115
|
+
agentId: "support_triage_bot",
|
|
116
|
+
});
|
|
117
|
+
const masked = await triage.redact({ text: "Contact alice@acme.io for billing" });
|
|
118
|
+
const hits = await triage.search("Who handles billing?", { userId: "alice" });
|
|
119
|
+
```
|
|
120
|
+
|
|
93
121
|
---
|
|
94
122
|
|
|
95
123
|
## License
|