n8n-io/n8n

Ollama node working error when using AI Agent

MorrisLu-Taipei opened this issue · 3 comments

Bug Description

n8n version: 1.36.4/1.37.4/1.39.1/1.40.0 (yep I tried to find a workaround version, but all the same issue)
Database (default: SQLite): SQLite
n8n EXECUTIONS_PROCESS setting (default: own, main): default
Running n8n via (Docker, npm, n8n cloud, desktop app): npm
Operating system: Linux apline / ubuntu 22.04

To Reproduce

ISSUE Processes
1.add AI Agents node from defualt "+"
2.under model link , select Ollama chat model and set up as http://localhost:11434/ , then saved
3.connection sucessfully, can select models from dropdowns menu
4.when click chat button and starting chat never response.
5.Failed to parse. Text: "I apologize for the mistake earlier! Here's another attempt: Output a JSON markdown code come to a close. Thanks for the fantastic chat, and I look forward to chatting with you again in the future!". Error: SyntaxError: Unexpected token I in JSON at position 0

Validation : works fine under the same setting w/ ollama chat model

  1. Basic LLM Chain node > works fine in chat.

Expected behavior

AI Agent node should work properly like Basic LLM Chain node
both nodes are so similarly with same functions.
also works with the same ollama chat model

BUT AI agent fail to work with ollama, so sad
Pls help to fix or provide workable solution. thx so much.

Operating System

Ubuntu 22.04

n8n Version

1.36.4/1.37.4/1.39.1/1.40.0

Node.js Version

18.20.4

Database

SQLite (default)

Execution mode

main (default)

Hey @MorrisLu-Taipei,

Which model are you using? I just tried with llama3:latest but I have been told that the conversational agents need a lot of intelligence from the LLM and an 8B model might not be enough.

thanks you are definite right, llama3 is working fine, but other models like model fine tune by Chinese not working properly.
our testing like https://ollama.com/ycchen/breeze-7b-instruct-v1_0

Hey @MorrisLu-Taipei,

Looks like that model just isn't smart enough to be used as a chat option so it doesn't know how to use the options passed to it.

I would recommend using a smarter model, or using a different agent like like ReAcT which will perform better with smaller models.

For now as this isn't a bug with n8n and is down to the intelligence in the model I am going to mark this as closed.