Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "name": "Obsidian Notes Ollama Agent",
- "nodes": [
- {
- "parameters": {
- "interval": 3600
- },
- "name": "Schedule Trigger",
- "type": "n8n-nodes-base.scheduleTrigger",
- "typeVersion": 1,
- "position": [250, 300]
- },
- {
- "parameters": {
- "operation": "readFile",
- "path": "/path/to/obsidian/vault/*.md"
- },
- "name": "Read Obsidian Notes",
- "type": "n8n-nodes-base.readWriteFile",
- "typeVersion": 1,
- "position": [450, 300]
- },
- {
- "parameters": {
- "values": {
- "string": [
- {
- "name": "content",
- "value": "={{$node['Read Obsidian Notes'].json['content']}}"
- },
- {
- "name": "fileName",
- "value": "={{$node['Read Obsidian Notes'].json['fileName']}}"
- }
- ]
- }
- },
- "name": "Parse Content",
- "type": "n8n-nodes-base.set",
- "typeVersion": 1,
- "position": [650, 300]
- },
- {
- "parameters": {
- "method": "POST",
- "url": "http://localhost:11434/api/generate",
- "headers": {
- "Content-Type": "application/json"
- },
- "body": {
- "model": "llama3",
- "prompt": "Analyze the following Obsidian note content: {{$node['Parse Content'].json['content']}}. Identify customer-related information (e.g., names, tasks, dates). Make inferences about potential customer needs or actions. Generate 2-3 clarifying questions for ambiguous or incomplete data. Suggest specific follow-up actions for customers (e.g., email, call). Return the response in JSON format with fields: inferences, questions, suggestions.",
- "stream": false
- }
- },
- "name": "Ollama Analysis",
- "type": "n8n-nodes-base.httpRequest",
- "typeVersion": 1,
- "position": [850, 300]
- },
- {
- "parameters": {
- "values": {
- "string": [
- {
- "name": "inferences",
- "value": "={{$node['Ollama Analysis'].json['response']['inferences']}}"
- },
- {
- "name": "questions",
- "value": "={{$node['Ollama Analysis'].json['response']['questions']}}"
- },
- {
- "name": "suggestions",
- "value": "={{$node['Ollama Analysis'].json['response']['suggestions']}}"
- }
- ]
- }
- },
- "name": "Extract Ollama Response",
- "type": "n8n-nodes-base.set",
- "typeVersion": 1,
- "position": [1050, 300]
- },
- {
- "parameters": {
- "operation": "writeFile",
- "filePath": "/path/to/obsidian/vault/output/customer_followups_{{$node['Parse Content'].json['fileName']}}.md",
- "fileContent": "# Customer Follow-up Suggestions\n\n**File**: {{$node['Parse Content'].json['fileName']}}\n\n**Inferences**:\n{{$node['Extract Ollama Response'].json['inferences']}}\n\n**Clarifying Questions**:\n{{$node['Extract Ollama Response'].json['questions']}}\n\n**Follow-up Suggestions**:\n{{$node['Extract Ollama Response'].json['suggestions']}}"
- },
- "name": "Save Suggestions",
- "type": "n8n-nodes-base.readWriteFile",
- "typeVersion": 1,
- "position": [1250, 300]
- }
- ],
- "connections": {
- "Schedule Trigger": {
- "main": [
- [
- {
- "node": "Read Obsidian Notes",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Read Obsidian Notes": {
- "main": [
- [
- {
- "node": "Parse Content",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Parse Content": {
- "main": [
- [
- {
- "node": "Ollama Analysis",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Ollama Analysis": {
- "main": [
- [
- {
- "node": "Extract Ollama Response",
- "type": "main",
- "index": 0
- }
- ]
- ]
- },
- "Extract Ollama Response": {
- "main": [
- [
- {
- "node": "Save Suggestions",
- "type": "main",
- "index": 0
- }
- ]
- ]
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement