n8n-nodes-mindrouter 0.5.1 → 0.5.3

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 +43 -15
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -19,36 +19,64 @@ npm install n8n-nodes-mindrouter
19
19
  ## Credentials
20
20
 
21
21
  1. Create an API key in your [MindRouter dashboard](https://mindrouter.io) under **API Keys**.
22
- 2. In n8n, add a **MindRouter API** credential and paste the key.
22
+ 2. In n8n, add a **MindRouter API** credential and paste the key. The credential's test button calls `/models`, so a green check means the key works.
23
23
  3. Leave the base URL as `https://api.mindrouter.io/v1` unless you run a self-hosted gateway.
24
24
 
25
+ One credential serves all four nodes.
26
+
25
27
  ## Nodes
26
28
 
27
- ### MindRouter Chat Model
29
+ ### MindRouter Chat Model — for AI Agents
30
+
31
+ 1. Add an **AI Agent** (or **Basic LLM Chain**) node.
32
+ 2. Click its **Chat Model** socket → pick **MindRouter Chat Model**.
33
+ 3. Choose a model — the dropdown is loaded live from your account, so it always matches your plan.
34
+ 4. Optional: temperature, max output tokens, top-p, penalties, timeout.
35
+
36
+ Every agent call then runs through the gateway: guardrails, spend limits, and usage tracking apply, and each call appears on the canvas and in the Logs panel with token counts.
37
+
38
+ ### MindRouter Embeddings — for Vector Stores
39
+
40
+ 1. On any **Vector Store** node (insert or retrieve), click the **Embeddings** socket.
41
+ 2. Pick **MindRouter Embeddings** and choose an embedding model.
42
+ 3. Optional: batch size, dimension truncation, newline stripping.
43
+
44
+ Your whole RAG pipeline — indexing and retrieval — then runs on the same key and bill as the chat model.
28
45
 
29
- A sub-node for the **AI Agent** and **LLM Chain** nodes: click the **Chat Model** socket and pick *MindRouter Chat Model*. Choose any model from your account (loaded live) and set temperature, max tokens, top-p, penalties, and timeout. Everything the agent does then runs through the MindRouter gateway — guardrails, spend limits, and usage tracking included.
46
+ ### MindRouter PII Guard — sanitize text
30
47
 
31
- ### MindRouter Embeddings
48
+ A regular node (also usable as an AI Agent tool) over MindRouter's PII toolset. Detects Indonesian NIK, NPWP, and phone numbers, credit cards, emails, IBAN, public IPs, API keys and JWTs — and, with **Use NER** enabled, person names and locations in Indonesian and English.
32
49
 
33
- A sub-node for **Vector Store** and retriever nodes: click the **Embeddings** socket and pick *MindRouter Embeddings*. Your whole RAG pipeline — indexing and retrieval included — then runs through the MindRouter gateway on the same key and bill as the chat model. Supports batch size, dimension truncation, and newline stripping.
50
+ | Operation | What it does | Returns |
51
+ |---|---|---|
52
+ | **Mask** | Irreversibly redacts all findings | `text` with `[REDACTED_*]` markers |
53
+ | **Scan** | Detects without changing the text | `pii_counts`, `secret_findings` |
54
+ | **Tokenize** | Replaces values with placeholders | `text` with `[NIK_1]`-style placeholders + `tokens` map |
55
+ | **Restore** | Puts original values back | `text` restored using the `tokens` map |
34
56
 
35
- ### MindRouter PII Guard
57
+ Typical pattern — send sanitized text to an external service, then restore:
36
58
 
37
- Detect, mask, tokenize, or restore PII and credentials in any text — Indonesian NIK/NPWP/phone numbers, credit cards, emails, API keys and JWTs, plus (optionally, via NER) names and locations in Indonesian and English. **Tokenize** replaces values with placeholders and hands you the reversal map, so you can send sanitized text to any external service and restore the original values afterwards. Usable as an AI Agent tool.
59
+ 1. **PII Guard (Tokenize)** on the incoming text: `={{ $json.chatInput }}`
60
+ 2. Call any external service with `={{ $json.text }}` (placeholders only — no raw PII leaves).
61
+ 3. **PII Guard (Restore)** with `Text` = the service's reply and `Tokens Map` = `={{ $('PII Guard').item.json.tokens }}`.
38
62
 
39
- ### MindRouter
63
+ The map is returned to your workflow and never stored server-side. Calls are metered per your MindRouter plan and logged (counts only, never the text) in the dashboard's guardrail history.
40
64
 
41
- A regular node for direct calls.
65
+ **When to use which:**
42
66
 
43
- #### Chat
67
+ - **Tokenize → Restore** — wrap any *external* AI or API call: the service works with placeholders and never sees real values. This is the default whenever text leaves MindRouter.
68
+ - **Mask** — before anything permanent: logs, tickets, spreadsheets, datasets. No later step needs the real values, so keep none.
69
+ - **Scan** — as a gate: branch with an IF node on `pii_counts` to route sensitive messages to approval instead of processing them.
70
+ - Requests through **MindRouter Chat Model** already pass the gateway's server-side guardrails — this node earns its place when text goes anywhere else.
44
71
 
45
- Send a prompt (or a full OpenAI-format `messages` array) to any model your account can use. The model dropdown is loaded live from your account, so it always matches your plan and provider settings. Supports temperature, max output tokens, and a simplified output (`text`, `model`, `usage`) or the raw API response.
72
+ Full guide with example workflows: [mindrouter.io/docs/integrations/n8n](https://mindrouter.io/docs/integrations/n8n).
46
73
 
47
- The node is also usable as a tool by n8n **AI Agent** nodes.
74
+ ### MindRouter — direct calls
48
75
 
49
- #### List Models
76
+ - **Chat**: send a prompt (plus optional system prompt) or a full OpenAI-format `messages` array. Simplified output (`text`, `model`, `usage`) by default; raw API response when *Simplify Output* is off.
77
+ - **List Models**: one item per model your account can use, including pricing metadata.
50
78
 
51
- Returns the models available to your account, including pricing metadata.
79
+ Also usable as a tool by AI Agent nodes.
52
80
 
53
81
  ## Compatibility
54
82
 
@@ -56,7 +84,7 @@ Requires n8n 1.x and Node.js 18.10+.
56
84
 
57
85
  ## Resources
58
86
 
59
- - [MindRouter documentation](https://mindrouter.io/docs)
87
+ - [MindRouter documentation](https://mindrouter.io/docs) — the [integrations page](https://mindrouter.io/docs/integrations) covers this node
60
88
  - [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
61
89
 
62
90
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-mindrouter",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "n8n community node for MindRouter — unified gateway to AI models with Indonesian PII guardrails",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",