Hello, greetings.
It’s a pleasure to greet you and hope you are all well.
I would like to know your opinion on something that occasionally happens with AI Agents and the Chat Model.
I created a small workflow based on WhatsApp queries to a Google Sheet with 1,000 rows of 18 columns of data. However, when I ask the Agent to search for information with certain filters, it doesn’t find the information even though there is a record with the exact data. The worst part is that sometimes it invents data that isn’t actually associated with the record. This is a concern. It has always been known that AI can sometimes return data that isn’t correct and it invents it. How can this be fixed?
Describe the problem/error/question
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
Hi there!
Sometimes, AI cannot ‘translate’ all of your Google Sheet rows. It may happen when some data missing in a column.
You can try to move the Google Sheet data to Vector Database, and use Embedding AI like OpenAI or Gemini etc. It will make your AI ‘map’ all of your data.
1 Like
Hello
I still think the AI’s response should be to report that it didn’t find the information, since it even invented data that isn’t in any record in the sheet. In other cases, the filter is accurate to several of the data and doesn’t find the record.
I’ll move the information from the sheet to a vector database and run tests to see if the AI’s search behavior is correct.
Thanks! 
Vector is the best option.
Lemme know if it works, and please mark it as solutions:)
1 Like
It’ll take me a while to implement it due to my heavy workload, but I’ll mark it as a solution.
Last consultation:
Which vector database would you recommend for use in the workflow?
Thanks!
I recommend using pinecone, mongodb was fine too if you want!
1 Like
Hi,
Are you using the system prompt in the ai agent node? That way you can train/restrict and even add fallbacks when it didn’t find the information.
Hi
Yes, but transferring all the data to a vector database is the most appropriate way to avoid hallucinations.
Yes that works, but I have also built ai chatbots that interact with customers and the thing I do to avoid hallucinations is that system prompt part.
Yes, you can, but with a long system prompt, AI still had a medium chance to get hallucinations, maybe it will be starting hallucinations when you already work with more big data.
That’s the thing because one current system prompt for one of my agent is approx 32 pages in docs. I think that if we do good prompt engineering to get a shorter prompt that is effective+ a vector database, that will do the job for us