@stackflo-labs/n8n-nodes-retainr 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/README.md +30 -53
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,11 +8,11 @@ Give your n8n AI agents **long-term memory** that persists across workflow runs.
8
8
 
9
9
  | Operation | Description |
10
10
  |-----------|-------------|
11
- | **Store** | Save a memory with scope, tags, metadata, TTL, and deduplication |
11
+ | **Store** | Save a memory with namespace, tags, metadata, TTL, and deduplication |
12
12
  | **Search** | Semantic similarity search across stored memories |
13
13
  | **Get Context** | Retrieve pre-formatted memory context ready for LLM system prompts |
14
- | **List** | Browse memories with filters (scope, user, session, tags) |
15
- | **Delete** | Remove memories by filter criteria |
14
+ | **List** | Browse memories with filters (namespace, tags) |
15
+ | **Delete** | Remove memories by namespace |
16
16
  | **Get Workspace Info** | View plan usage, API keys, and workspace details |
17
17
 
18
18
  ## Installation
@@ -20,13 +20,23 @@ Give your n8n AI agents **long-term memory** that persists across workflow runs.
20
20
  ### n8n Cloud & Desktop
21
21
 
22
22
  1. Go to **Settings > Community Nodes**
23
- 2. Search for `@stackflo-labs/n8n-nodes-retainr`
23
+ 2. Click **Install**
24
+ 3. Enter the exact package name: `@stackflo-labs/n8n-nodes-retainr`
25
+ 4. Click **Install** and restart if prompted
26
+
27
+ ### Self-hosted n8n (UI)
28
+
29
+ 1. Go to **Settings > Community Nodes > Install**
30
+ 2. Enter `@stackflo-labs/n8n-nodes-retainr`
24
31
  3. Click **Install**
25
32
 
26
- ### Self-hosted n8n
33
+ Requires `N8N_COMMUNITY_PACKAGES_ENABLED=true` in your environment (set by default in Docker).
34
+
35
+ ### Self-hosted n8n (manual / Docker volume)
27
36
 
28
37
  ```bash
29
- cd ~/.n8n
38
+ # If you mount a custom node directory or manage packages directly:
39
+ cd /home/node/.n8n
30
40
  npm install @stackflo-labs/n8n-nodes-retainr
31
41
  ```
32
42
 
@@ -36,9 +46,18 @@ Then restart n8n.
36
46
 
37
47
  1. Sign up at [retainr.dev](https://retainr.dev) and get your API key
38
48
  2. In n8n, go to **Credentials > New > Retainr API**
39
- 3. Paste your API key (`rec_live_...`)
49
+ 3. Paste your API key (`rec_live_...`) — each key is scoped to one workspace
40
50
  4. The default Base URL (`https://api.retainr.dev`) works out of the box
41
51
 
52
+ ## How it works
53
+
54
+ **Workspace → Namespace** hierarchy:
55
+
56
+ - **Workspace**: Your organization, determined by the API key
57
+ - **Namespace**: Groups memories by customer, tenant, or any identifier (e.g., `customer:alice`, `project:onboarding`)
58
+
59
+ Every memory operation accepts a **Namespace** field. Use it to keep each customer's memories separate within your workspace.
60
+
42
61
  ## Usage Examples
43
62
 
44
63
  ### Store a memory after a conversation
@@ -46,69 +65,27 @@ Then restart n8n.
46
65
  1. Add the **Retainr** node after your AI Agent
47
66
  2. Set **Resource** to `Memory`, **Operation** to `Store`
48
67
  3. Map the conversation summary to the **Content** field
49
- 4. Set **Scope** to `User` and provide the **User ID**
68
+ 4. Set **Namespace** to the customer identifier (e.g., `customer:alice`)
50
69
 
51
70
  ### Inject memory context into an LLM prompt
52
71
 
53
72
  1. Add a **Retainr** node before your AI Agent
54
73
  2. Set **Operation** to `Get Context`
55
74
  3. Use the incoming message as the **Query**
56
- 4. Pass the `context` output into your LLM's system prompt
75
+ 4. Set the same **Namespace** to retrieve that customer's memories
76
+ 5. Pass the `context` output into your LLM's system prompt
57
77
 
58
78
  ### Deduplicate similar memories
59
79
 
60
80
  Use the **Dedup Threshold** field (e.g., `0.95`) when storing. If a sufficiently similar memory already exists, it will be updated instead of duplicated.
61
81
 
62
- ## Memory Scopes
63
-
64
- | Scope | Use case |
65
- |-------|----------|
66
- | `session` | Single workflow run — requires `session_id` |
67
- | `user` | Persists across runs for one user — requires `user_id` |
68
- | `agent` | Shared across users for one agent — requires `agent_id` |
69
- | `global` | Shared across the entire workspace |
70
-
71
82
  ## AI Agent Tool
72
83
 
73
84
  This node has `usableAsTool` enabled — you can use it directly as a tool inside n8n's **AI Agent** node, letting the agent decide when to store or recall memories autonomously.
74
85
 
75
- ## Demo Video
76
-
77
- A recorded demo covering all n8n Creator Portal requirements is at:
78
-
79
- ```
80
- products/retainr/web/public/demo/n8n-demo.mp4
81
- ```
82
-
83
- Full disk path (Windows): `D:\dev\datadir\stackflo\products\retainr\web\public\demo\n8n-demo.mp4`
84
-
85
- **To re-record** (e.g. after a node update):
86
-
87
- ```bash
88
- # 1. Start n8n with the node pre-installed
89
- cd packages/n8n-node
90
- docker compose -f e2e/docker-compose.yml up --build -d
91
-
92
- # 2. Record — no API keys needed, the script handles everything
93
- cd ../../products/retainr/web
94
- N8N_BASE_URL=http://127.0.0.1:5678 \
95
- node scripts/record-n8n-demo.mjs
96
- # → public/demo/n8n-demo-raw.webm
97
-
98
- # 3. Post-process to MP4
99
- bash ../../packages/n8n-node/demo/post-process.sh public/demo/n8n-demo-raw.webm
100
- # → public/demo/n8n-demo.mp4
101
-
102
- # 4. Tear down
103
- cd ../../packages/n8n-node
104
- docker compose -f e2e/docker-compose.yml down
105
- ```
106
-
107
- See `demo/README.md` for full details.
108
-
109
86
  ## API Documentation
110
87
 
111
- Full API reference: [retainr.dev/docs/api](https://retainr.dev/docs/api)
88
+ Full API reference: [retainr.dev/docs](https://retainr.dev/docs)
112
89
 
113
90
  ## License
114
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackflo-labs/n8n-nodes-retainr",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/stackflo-labs/n8n-nodes-retainr.git"