Chatbot using AI Agent node

I am building a chatbot to answer the questions from clients. I used a GoogleSheet file as a database.

I expect that the chatbot can look for and retrieve the information from the GoogleSheet file to answer the questions.

My question is: are there any required format for the GoogleSheet file?

1 Like

Hey @TrungAI hope all is good.

If your sheet is large, this may not be the best solution, as the response will get back to LLM and LLMn needs to process this, if the requests are frequent and the sheet is large, this will pile up and these tokens cost moneys. If the requests are not frequent or the sheet is rather small it can be ok. You decide, just wanted to get this out of the way.

Now, no specific format is needed, just a sheet with header and the rows, each row will come out as a bunch of key:value pairs for the header name and the value if the corresponding cell.

If the sheet is large, maybe using it as a database is not the best fit and you should look into having a real database. You could also look into building a RAG for information retrieval. Check out this video if you want to know more.

Thanks so much for your very quick reply. Does it mean that

  • I can use a GoogleSheet file containing only one column
  • OR using a GoogleDoc file.

you can most definitely use a google sheet with only one column

if your data is tabular, I think it might be easier to go with sheets.

Let me show you.

Imagine you have a sheet called Names with this column:

Names
Alexander
Olivia
Ethan
Sophia
Liam
Isabella
Noah
Charlotte
James
Amelia
Benjamin
Ava
Lucas
Emma
Henry
Grace
Samuel
Lily
Chloe
William

Here is what we can do to check if the name is in the table:

Then here is my chat with the assistant:

Human: Is Emma in the database?
AI:    Yes, Emma is in the database. She is in row number 15.
Human: Is Nathan in the database?
AI:    Nathan wasn't found in the database.
1 Like

Thank you so much for the very detailed explanation!!! Let me try it.

Sure, please let us know how it goes

@jabbson It worked well. Now, I am considering RAG because the database is becoming large gradually. There are 2 approaches for database.

  1. GoogleSheet + Supabase (as vector database)
  2. Notion database

It seems that Notion supports searching mechanism well. If using Notion, I do not need to manage another vector database. Have you had any experience in this topic?

Hi @TrungAI there isn’t a strict “required” format for Google Sheets — it really depends on how your workflow/chatbot is set up. In most cases, a clean table format with headers in the first row (like “Question” | “Answer”) works best so you can reference columns easily in n8n / your LLM prompt.

If you want more complex data (multiple columns, categories, etc.), just make sure your workflow knows which column to search against and which one to return as the response.

@Aashu_Rajput Thanks for your reply! If using GoogleSheet, the sheet will be piled up every request and sent to LLM model. If the file is large, this solution will not be a good choice.

→ that is why I am thinking about another solution such as using Notion.

Hey @TrungAI hope all is good.

Depending on what it is you are doing with Google Sheets exactly, whether it grows, whether you need to pull it often… you could use multiple techniques.

First you can search/filter the database rows to pull

If this is something you can do - this will obviously be better than pulling the entire database. If the flow logic requires you to pull ALL the data, than this isn’t really scalable to begin with, no matter where you are pulling this from - sheets, notion or a real database. Which brings me to my last point - if you are storing lots of data, where you periodically need to pull, sort, filter or aggregate, using a full blown real database is something you should probably consider.

@jabbson Thank you so much! Have you had experience in working with Notion?

Yes, I had a few battles with Notion.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.