AI Agent Prompting Issue

Hi, I’m having an issue with a client who runs a Padel equipment store. We’re setting up an AI agent that answers questions about product availability, store policies, etc. The setup is already connected to our product database in Google Sheets, and the bot queries that sheet whenever someone asks a question.
The problem is that some racket names are extremely similar. For example, we have Pala Nox AT10 Luxury Genius 18K Alum 2026 by Agustín Tapia and Pala Nox AT10 Genius Attack 18K Alum 2026 by Agustín Tapia. Even for a human it’s tricky to spot the small differences in the names.
The bot doesn’t catch those distinctions. We’ve tried all kinds of prompt engineering, but nothing seems to work: it will show a couple of options but then tell the customer that the others “are not available,” even though they’re right there in the database it’s using.
Has anyone dealt with something like this, or know how we could solve it?

@rondar Have you got a SKU/ID column in your Google Sheet, or is it just the product names right now?

Yeah I’ve got SKU and ID columns. I have the products imported from Shopify to a google sheets that updates every hour.

Nice, since you’ve already got SKUs and IDs in place, the next thing I’d check is how you’re mapping the customer’s wording to those SKUs. If you can share a quick screenshot of that part of your workflow, it’ll be easier to see where it’s tripping up.

As of now I have a simple llm chain that determines if the message should be answered by a human (got the wrong order/ lost package, etc) or by the agent itself (product availability/ policies, etc.) the client wants to have both the human and the bot to be able to respond through the same whatsapp number (we already have that part figured out, just haven’t implemented yet). The agent itself doesn’t check the SKU depending of the client’s wording. I think I understand what you mean, we need to have the agent to get all the products’ SKUs that match what the client said, so if it reffers to a product the client didn’t want, it would still have the rest of the SKUs saved so no product will get lost, right?

@rondar The fix is just to change where the lookup happens. Right now, your “Product Data” node is feeding the whole sheet straight into the AI, which forces the model to eyeball names — that’s why it’s mixing up “Luxury Genius” vs “Genius Attack.” Keep your “Customer Message” node (good for cleaning input), then add a fuzzy/compare step (or a Function node with Fuse.js) right after it. Use that to map the customer’s text to SKU, then query the sheet by SKU and pass only that single row into the AI. That way, the LLM just phrases the answer instead of deciding which product is which.

The Google Sheet node should NOT be under the AI agent/tools anymore. Instead, it goes after the Function node .

1 Like

Thanks a lot for your help! I’ll get on it, I really like your solution. I’ll keep you guys updated when I solve it!

You are welcome @rondar kindly mark as the solution if you find it helpful.

2 Likes

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