Make.com Agents with WebHooks

:bullseye: What is your goal?

Create an AI Agent that keeps user thread with WebHooks

:thinking: What is the problem?

I have built Agent and a WebHook that takes input from a webpage and passes back answers from my Agent. The problem is there is no thread kempt i.e. it forgets the last quetions and only works on the next? Is there a simple way to keep the thread ona conversation going?

:camera_with_flash: Screenshots: scenario setup, module configuration, errors

1 Like

AI agents invoked by webhook are stateless. Every webhook call is a new run with no built in memory of previous requests.

If you want a chat style conversation, you need to store the past messages yourself (for example in a database) and send the relevant history or a summary along with each new webhook request.

I hope this makes sense for you!

Hello @Chris_Indge,

You may check out the Upsert Agent Context module of the Make AI Agents app.

Here you can add context to your agent. Please read more here.

Welcome to the Make community!

Your webpage has to send a unique ID for that user (for example, you can ask the user for their email address, or generate a UUID using JavaScript). If that needs to be used across browser sessions, then you’ll need to use JavaScript to store it in a cookie or localStorage, so that you can fetch and reuse it when the user visits the page again.

Alternatively, if you don’t require the thread to be saved across sessions, you could calculate a unique hash for each user based on details sent through the webhook (turn on the webhook headers to get more detailed information about the request).

Then, use that unique identifier in the Thread ID field for the “Run an Agent” module:

As stated in the description below the Thread ID field, if you leave it BLANK, a new thread will be started each time it runs.

For more information, see:

— @samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

2 Likes

Thanks Donald I will take a look

Many Thanks I will take a look

Thanks

This seemed to work…

1 Like

Won’t the message change every new message, and the datetime variable now change based on the time the scenario runs? This means a new thread will be created for every new message even from the same user.

You should just use a single identifier to identify the user, like email address or phone, or constant variables that won’t change for the user’s session (like IP address).

— @samliew

1 Like