Repository navigation
Expand file tree
/
Copy pathKnowledgeAgent.json
More file actions
226 lines (226 loc) · 6.3 KB
/
Copy pathKnowledgeAgent.json
File metadata and controls
226 lines (226 loc) · 6.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
{
"name": "Knowledge Agent",
"nodes": [
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
-320,
-112
],
"id": "2bc4fa8f-6526-4f1d-bb1e-e0e8bb550e59",
"name": "When chat message received",
"webhookId": "54c06650-0fd8-4e59-a880-112b522b2e93"
},
{
"parameters": {
"options": {
"systemMessage": "You are a retrieval-augmented assistant for NovaCart.\n\nYOU MUST FOLLOW THIS PROCEDURE FOR EVERY NON-GREETING USER MESSAGE:\n\nStep 1) ALWAYS call the tool \"Nova Pinecone Vector Index\" exactly once before answering.\n- The tool input must be a short search query derived from the user’s question (5–12 words).\n- Do NOT answer yet.\n\nStep 2) Read the tool result.\n- If the result is empty OR does not contain the requested metric/timeframe, you MUST reply EXACTLY:\n\"I’m sorry, I don’t have that information in my knowledge base. Please try asking a different question.\"\n- You are NOT allowed to respond with anything else in this case.\n\nStep 3) If the tool result contains relevant information:\n- Answer using ONLY the retrieved text.\n- Keep the answer short and sweet. \n\nSometimes you might be asked to do comparison with other products from other vendors. In those cases use the built in Web Search Tool to accomplish that.\n\nOUTPUT RULES (final response):\n- Output ONLY the user-facing answer text.\n-always use bullet points\n- NEVER mention tools, retrieval, search, “used tools”, logs, inputs, outputs, metadata, or reasoning.\n- You are forbidden from printing anything like: [Used tools: ...].\n\nEXCEPTION:\n- If the user message is only a greeting/small talk (e.g., “hi”, “hello”, “how are you”), do not call the tool; respond politely.\n"
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"position": [
-64,
-112
],
"id": "5e85516c-8843-431a-b4bc-09080b60d8e9",
"name": "AI Agent"
},
{
"parameters": {
"model": {
"__rl": true,
"value": "gpt-4.1-mini",
"mode": "list",
"cachedResultName": "gpt-4.1-mini"
},
"builtInTools": {},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.3,
"position": [
-192,
160
],
"id": "46b4320b-87d0-4813-bfeb-141c0d359953",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"id": "l6rO6JWGfbCiIEsm",
"name": "OpenAI account 3"
}
}
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.4,
"position": [
-64,
96
],
"id": "6f5418f4-d08d-4c17-b6b4-d2b1f3475c99",
"name": "Simple Memory"
},
{
"parameters": {
"mode": "retrieve-as-tool",
"toolDescription": "Always use this tool FIRST for any business metrics question (targets, margins, revenue, YoY, 2024/2025). Return the most relevant metric chunks.",
"pineconeIndex": {
"__rl": true,
"value": "projectrag",
"mode": "list",
"cachedResultName": "projectrag"
},
"topK": 10,
"useReranker": true,
"options": {
"pineconeNamespace": "prod"
}
},
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"typeVersion": 1.3,
"position": [
304,
128
],
"id": "3aaf78c5-ab60-422a-9c36-9a42415c8dd0",
"name": "Pinecone Vector Store",
"credentials": {
"pineconeApi": {
"id": "xTBUZswVkqZRsoLt",
"name": "Pinecone account 3"
}
}
},
{
"parameters": {
"model": "text-embedding-3-large",
"options": {
"dimensions": 1024
}
},
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"typeVersion": 1.2,
"position": [
192,
320
],
"id": "b4cb12ba-4a7e-4129-a4bb-27614ac4fba8",
"name": "Embeddings OpenAI",
"credentials": {
"openAiApi": {
"id": "l6rO6JWGfbCiIEsm",
"name": "OpenAI account 3"
}
}
},
{
"parameters": {
"topN": 5
},
"type": "@n8n/n8n-nodes-langchain.rerankerCohere",
"typeVersion": 1,
"position": [
448,
336
],
"id": "a9f2d722-bff2-4e16-8a5e-0d8293a069b6",
"name": "Reranker Cohere",
"credentials": {
"cohereApi": {
"id": "1xf9cF4NFYFc3Wy5",
"name": "Cohere account"
}
}
}
],
"pinData": {},
"connections": {
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Pinecone Vector Store": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Reranker Cohere": {
"ai_reranker": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_reranker",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"binaryMode": "separate",
"availableInMCP": false
},
"versionId": "d14a694c-b34b-4db9-8e1c-cbd50b413b58",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "8c8201cb0dc83b4713a4dd42454ec696b963b61f56691c5da1d3d62640d43aca"
},
"nodeGroups": [],
"id": "K2guLikmwQ9nZAqR",
"tags": []
}