Please create an execution algorithm for the agent to be more deterministic and for such complex workflows you should consider using more than one agent on make.
If I understand you well, the agent on make is just here to help that whatsapp agent (not on make) to generate a quote that the whatsapp agent will use. The whatsapp agent on the other hand gathers the required input variables from the potential client and then sends them to make.com for the agent to use Google maps and other info from spreadsheets etc. to generate a quote.
Though you’ve given little context, I think your token usage will be ridiculous. Let your whatsapp agent hand over a form with input validation to clients who agree to get a quick quote. Send the data to make.com use google’s routes api if you need turn by turn distance and use distance matrix api if you need city to city. This keeps you off ai tokens and you already have the most important thing “distance”. For your use cases I believe city to city works best.
BAD ADVICE Hack: This shortcut works for me but don’t use it if stakes are too high. For city to city distance make.com websearch tool will kill that with a 100% accuracy. Test it 10 times with your real validated distance input data. 10 times, if it works then it’s reliable in your use case because it grabs data directly from Google searches and others, and Google searches have solid distance calculations capabilities that will wow you. You can use a formula to grab the distance from the research response or get a json response.
Next, add the distance to the form input data that you feed to the AI agent. At this point the execution algorithm shines. Detail the steps that the AI must use. Now imagine you were the one to create a quote for that client, you’re holding a pen and paper right now. Where will you start and where will you end with the quote? An answer to this question gives you the execution algorithm instead of letting the agent run on free mode or a vague instruction.
Give the agent structure on how to start which tool to use before which and when to use, what success looks like at every stage. Etc.
DON’T FETCH ENTIRE SPREADSHEETS​
. Use smart search to pull only required data and if I were you I would use low level, low token determined ministeps to generate different parts of the quote and then append them somewhere.
Personally I LOVE JSONs. I would get the agent to produce a quote json format. Make.com AI agents absolutely love this and I bet your out of make AI powered whatsapp agent can use both a json parser and renderer to give your client a solid quote pdf if your whatsapp agent had pdf tools and a template that it feeds the json from the make.com agent to generate a unique and neat quote pdf for that specific client.
Another importance of handing your clients using a form is the fact that input validations can give you uniform data and you’ll have little processing to do because different clients will explain their needs to the whatsapp agent in different ways. The only bottleneck here is that you need to know which whatsapp ID has which input. You can explicitly add a whatsapp number field to the form but that can give room for errors so if I were you I would use whatsapp flows.
If you can setup a whatsapp business cloud api for your agent then it’s feasible to set whatsapp flows so that the agent gets users to fill the form right within whatsapp with the perfect input validation and then hands that over to your make scenario to generate the quote json. This can add the user’s whatsapp ID which can still be included in the json so long as the whatsapp agent understands the structure and key pairs.
Another BAD ADVICE that works for me: if your spreadsheet isn’t huge like you don’t have hundreds of car types and thousands of pricing variations you can carefully place your spreadsheet data into rag because once your user input data contains words present in the rag the make AI agent will pull it as input context which is even sweeter for json generation and grossly reduces the agent steps and tokens.
To update pricing per mile and per car? Just update your rag. Even the data pulled from the spreadsheet is still injected as part of the input context and still goes through tokenization, self attention and softmax.
All these can shrink your 19,000 credits to maybe less than a hundred credits per quote which will make your automation profitable.
Unconventional takes I’d say but I hope this helps a little.