Hey. WhatsApp AI Agent for car rental in Mallorca.
Describe the problem/error/question
Hello. # Eagle Rent Chatbot - Car Rental Assistant (Telegram/WhatsApp)
Overview
AI-powered chatbot for car rental business in Mallorca handling reservations, availability checks, and customer support via Telegram (later WhatsApp migration planned).
Current Architecture
Main Workflow: Reservation Management
Telegram Trigger - receives customer messages
Pobierz Historię Rozmów (Google Sheets) - fetches conversation history (last 40 lines/messages)
Description: Full details (name, phone, car segment, dates, flights, hotel, child seats, price)
AI uses phone number to find customer’s reservations
Fleet
4x Renault Clio (Segment C)
2x Citroen C3 Aircross (Segment D)
1x Toyota Proace (9-seater bus) Thats only for now we are going to add many more cars
Current Issues
Token Usage: 4500-5000 tokens/request
System prompt: ~1500 tokens (includes fleet, pricing tables, rental rules)
Context: ~3000 tokens (conversation history + full reservation details for all active reservations)
Model: GPT-4-mini
Cost: ~$0.01 per request . I want my agent to remember the context of the conversation with every customer but without burning milions of tokens and making costs high.
Quality: No loss - all data still accessible via tools
Questions for Community:
Database instead of Google Sheets?
Would PostgreSQL/MySQL/Supabase be better for conversation history?
Concerns: added complexity, hosting costs
Better approaches for context management?
Currently sending full reservation details - is there a smarter pattern?
Token optimization strategies you’d recommend?
Without sacrificing response quality
WhatsApp Cloud API migration tips?
Planning to switch from Telegram - any gotchas?
Tech Stack
N8N (hosted on Railway)
OpenAI GPT-4-mini (LangChain Agent)
Google Calendar API (reservation storage)
Google Sheets (conversation memory)
Telegram Bot API (current)
WhatsApp Cloud API (planned)
And additionally i will be making simple autiomation that will be sending the day before end of the rental to customers istruction which photos to make, how to return the car properly.
@tymekjakis For the database i recommend going with Supabase if you want quick and reliable setup, but if you want a little more complex and DIY setup go with MongoDB these would really work in handling of chat history without increasing costs.
Your approach is pretty scalable and is already really optimized and you really do not need to worry about smarter pattern as your approach is pretty solid!
For token optimization i would recommend if you are giving set of rules about the business in the system prompt and they are pilling up, consider using a vector store for easy Agentic access for the data and set of rules about your business. This would not really effect outcome quality.
For migration whatsapp has a bit more complex structure and extra tech overheads like meta verification and initial business setup but once you are past that setup everything is just like telegram.
Thank You! Im happy to hear that im scared of AI hallucination too. I dont know if 4.1 mini would be enough in high volume. But it is pretty cheap comparing to better versions. I dont know if vector store would be really necessary because there is not much rules. I dont quite know when to choose vector store or when it is not needed. My client already has WhatsApp Business so i think it would be not that hard to setup. And If anybody here made something similar, how would u charge for this type of system? Thank You Anyways!
@tymekjakis GPT 4.1 would be a nice fit for this one as we have less tools but more context, as you have mentioned that you do not have a big series of instructions and examples then Vector DB is not for you as it is for fast retrieval and needed when we have a large amount of documents, it is good but not in your case.
Now for charging the client i would say that it depends are they giving you the tools like APIs & subscriptions then depending on the current case charging 300$-900$ would be viable as you have to put a lot of your time here cause AI Agents in production can be unpredictable sometimes so making this project production grade would cost the client that amount. If they are not providing anything and you are required to get resources yourself then any number over 1700$-2000$ would be right as data bases + LLMs costs and ofcourse your hourly rate included.
With this model you are selling a solution of a problem in a client’s business not just a workflow, so i think those numbers are suitable. Hope this helps.
Okay. Now I have issue. How can i achieve that if for example customer is texting 3 separated messages and my agent will respond once to these 3 messages not 3 times. I wanna add wait for 60 seconds but my agents only see one message
Just add a wait node with a 60s delay after every message is sent that would make sure to not get more messages until one operation is done, this can work in your case.
@tymekjakis understood now, so Instead of calling the AI Agent directly, you will Buffer each incoming WhatsApp message per user (in anything even data tables/excel), reset a short timer (every 7-14 seconds) on every new message, and when the timer expires with no new messages, read and concatenate all buffered messages into one string, send that single combined text to your AI Agent, then clear the buffer. This would be a good approach and is pretty easy to implement.
Hmmm I mean that everytime client text my agent it triggers the workflow. For example he will text separately 3 messages:
1.Okay
2.Hmmm
3.I will think about it
And there is 3 workflow triggers so my agent will respond with 3 messages. I want him to respond once to all the messages. Thats what i meant.
Solid setup for the fleet size you’re working with.
For your token question — your plan to move fleet/pricing into tools is the right move. But the bigger win is how you handle reservations in context. Instead of sending full details for every active reservation, send a minimal list (car, dates, customer name, ID) and let the agent call get_reservation_details only when the customer asks about a specific one. Most conversations are about one booking, not all of them.
Same idea for conversation history — 40 raw messages is a lot of context. Summarize anything older than the last 5-10 messages into a 2-3 sentence recap using a Code node before it hits the agent. Keeps the conversation feeling continuous without burning tokens on messages from 3 days ago.
Sheets vs database — at your scale right now, Sheets is fine. You’ll feel the pain once you’re past a few hundred active customers or if latency starts creeping up. When that happens, Supabase is probably the easiest migration path since it has a REST API and plays nice with n8n. Don’t overcomplicate it until you need to.
For WhatsApp — two things to know early:
24-hour window — after 24h without a customer message you can only send pre-approved template messages, not freeform ones. Your day-before-return reminder will need to be a template. Submit those to Meta early, approval takes a few days.
Noisy webhooks — WhatsApp Cloud API sends delivery/read status updates alongside actual messages. Add a filter node right after your trigger or you’ll be processing a ton of non-message events.
If you have any more questions, feel free to ask! Your project is really cool!
Thank You !! Instead of vector database in this case with not big amount of data i just made code tool with string with all the info so my agent can use it when he dont know the answer. I just migrated everything from Google Sheets to Supabase already! I solved the buffering problem so now the only thing is adding more cars and watching if he is messing up the booking in caledar but overall now he works great. Thanks for mentioning WhatsApp Cloud tips because i wasnt thinking it will be some issues with that. I see thats its not that simple in some cases. Thanks anyway. U guys are very helpful.
Hi, you’re thinking in the right direction. Here’s my answer
1. Database: Moving from Google Sheets to PostgreSQL or Supabase makes sense long term. It improves query speed, indexing, and structured memory, but adds ops complexity. For scale, it’s worth it.
2. Context management: Use summaries + tool-based retrieval (RAG-style). Send only active reservation IDs and fetch details on demand.
3. Token optimization: Compress system prompts, externalize pricing/fleet into tools, and store rolling conversation summaries instead of raw history.
4. WhatsApp migration: With WhatsApp Cloud API, watch template approval, 24-hour session rules, and stricter rate limits compared to Telegram.
Hi i found new issue im not quite sure how it works
One requirement from the client: the business owner wants to be able to take over a conversation manually and reply as a human, while the bot stops responding for that conversation.
I have two questions:
1. Human handoff logic in n8n What’s the cleanest way to implement a per-conversation bot/human mode flag? I’m thinking Google Sheets or Airtable with the customer’s phone number as key — n8n checks the flag at the start of every webhook trigger. Is this how you’re doing it, or is there a better pattern?
2. The interface problem Once a number is migrated to WhatsApp Business API, the WhatsApp Business App stops working. The owner doesn’t want to use a third-party inbox (like Respond.io or Chatwoot) — ideally they’d just reply from the regular WhatsApp app.
For your point #2.
You can use WhatsApp Coexistence. Which is a feature that allows to simultaneously use the WhatsApp Business App and the WhatsApp Business API (via Cloud API) on the same phone number.
is there any tutorial somewhere how to set up the coexistence setting? Do I have to log in in some other software like highlevel etc?
I want client to be able to take over the conversation when chatbot will make a mistake or sht