n8n

Node.js UI .. luv it ..

n8n is an open-source workflow automation platform that enables users to connect different services and applications through a visual, node-based interface. It allows both technical and non-technical users to create automated workflows without writing code, thanks to its intuitive drag-and-drop editor.

n8n stands out for its flexibility, offering both cloud-hosted and self-hosted options, and it can run on-premises to keep sensitive data within your infrastructure. The platform supports hundreds of integrations with popular services and applications, includes customizable error handling, and allows for the creation of custom nodes when needed.

Unlike many competitors, n8n uses a fair-code license model, making it more accessible while still supporting sustainable development.

Simple Research Agent

Link to n8n

Link to Automation Workflows

Build a simple Research Agent ..

  1. Log into n8n.

Link to n8n
  1. To create a new workflow, click on either 'Create Workflow' button located top right or + icon next to n8n icon in right had menu bar.

Create a Workflow
  1. Our first step is to add a Chat Message - prompt input. Click on Add first step.

Add Chat message
  1. Click on Test chat.

Test Chat
  1. Enter a message in the prompt.

Enter Chat message
  1. Next add Advanced AI > AI Agent node

Add AI Agent
  1. The AI Agent is going to use a local model loaded from Ollama. Keep the default settings and click on Chat Model.

Pass the Chat message to AI Agent
  1. Select Ollama Chat Model. Once selected your canvas displays the 'nodes'.

Add Ollama
  1. Double-click on: Ollama Chat Model node. Select: Create new credential

Define connection to Ollama
  1. Edit the URL to the Ollama server to connect with Docker container name - ollama.

Ollama connection

The docker-compose also deploys: llama3.1:latest model for testing.

Select Model
  1. Click on: 'Back to Canvas' link in top left. You can test the Agent.

Test Chat
  1. The first time .. it will take a moment to first load the model.


Memory

This is where the fun begins .. I informed the model that my dog is called Ruby. I then asked what is the name of my dog? - no clue .. so

No memory..!
  1. Keep it simple and add some memory - windows buffer that will hold the last - default: 5 inputs.

Add memory
  1. The buffer kicks in and can now access previous chats.


Tools

  1. Lets ask for the latest BTC price.

Add Tools
  1. A quick search points to SerpAI. Sign up for a free account and create an API key

Link to SerpAI
SerpAI API key
  1. Again configure the Credentials - connection.

Configure Credentials
  1. Reset and input the question. The AI agent will access the internet and perform a Google search for the price.

Tool - SerpAI
Google search

Last updated