Help Needed: AI Automation in n8n Not Responding Accurately.

I’m really struggling to build an automation in n8n that acts as an AI consulting a helpdesk. I’m using Olama with the models Qwen-2.5 14B and Qwen-3.0 14B, but it’s just not working—responses are inaccurate, and it fails to answer the questions. I’ve tried adding a bank dictionary, vectorizing the data, and using Qdrant, but I’m still stuck. I would really appreciate any kind advice or best practices. I’m honestly feeling a bit lost here, so any help would mean a lot.

Hi @Igor4 Welcome!!
I think (1) prompts, (2) few-shot examples, and (3) sampling settings like temperature, top_p definitely matter, but they usually do not fix the core problem by themselves.

For helpdesk-style RAG, the bigger issue is often retrieval quality and workflow design:
chunking
metadata
grounding
making sure the right context is passed in before the model answers.
In n8n, RAG is really about retrieving the right documents from a vector store first, then using the LLM on top of that.

So yes, I would look at prompt tuning and model parameters too, but I would focus first on the architecture and the quality of the retrieved context.
Read articles in:

for example:

2 個讚

1 個讚

Hi @Igor4 ,我很高興我之前的回覆有助於澄清事情,而這是一個非常好的後續問題。


是的,你使用 SQL 檢視表 的想法是一個強有力的方案。它為 AI 提供了一個更受控且結構化的真實數據源,而不是暴露整個資料庫。在許多服務台風格的使用情境(客戶、工單、服務)中,與廣泛的資料庫存取或僅依賴文件上的 RAG 相比,這可以提高準確性和安全性。

從架構的角度來看,這取決於你的系統是如何設計的:

  • 如果所需的資料是 確定性的,你已經知道要取什麼,先呼叫資料庫然後將乾淨的資料傳遞給 AI 通常更好。它 (1) 減少工具呼叫次數,(2) 改進延遲和成本,(3) 限制幻覺的可能性。
  • 如果系統需要 動態決定 要檢索什麼資料,那麼讓 AI Agent 查詢這些受控檢視表是一個好的模式,但準確性將取決於 (1) 提示設計、(2) 工具描述和 (3) 模型行為。

我將 SQL 檢視表和 RAG 視為互補的:檢視表用於結構化運營資料,RAG 用於非結構化知識。

在更複雜的情況下,先規劃的模式(如分離推理與工具執行),ReWOO(「無觀察推理」的簡稱)可能會有幫助,但通常只有在工作流變得更具代理性時才需要。

總的來說,你的方法是穩健的,與構建可靠系統保持一致。


如需進一步閱讀,IBM 有一份有用的 :backhand_index_pointing_right: 代理架構:backhand_index_pointing_right: ReWOO 概述。


祝工作流建置愉快 :clap:

1 個讚

準確性問題通常歸結於系統提示詞沒有給模型足夠的結構。以下幾點對我有所幫助:首先,將你的指示分解成有序的步驟,而不是一個段落,模型更可靠地遵循有序指示。其次,在系統提示詞的末尾添加一個明確的輸出格式部分,讓模型確切知道回應應該是什麼樣子。第三,如果你需要一致的結構化輸出,將溫度降低到 0。你目前的系統提示詞是什麼樣的?

1 個讚