How to properly reset AI Agent memory and handle different customer personalities?

Hi everyone,

I’m a beginner but really eager to learn more about AI agents and automation. I’m currently building a Telegram bot using n8n that acts as an AI agent to test sales knowledge. The bot is trained with product knowledge (e.g., Fast Track) and plays the role of a customer, responding to sales reps’ messages.

I’ve implemented a basic version using a conversational AI with buffer memory. It works, but I’m facing these challenges:

  1. The AI responds properly when sales reps send messages.
  2. However, I don’t know how to reset the AI’s memory so that each new conversation starts fresh. Right now, it keeps remembering past interactions, which is not ideal.
  3. When I try to simulate different customer personalities (e.g., difficult customers, rude customers, etc.), the bot fails to stay in character or behaves unpredictably.

I would love to know:

  • What’s the best way to reset AI memory in n8n after a conversation ends?
  • Are there any best practices or templates for handling different customer types properly?
  • Should I use a different memory system or approach to make the AI more consistent?

I really appreciate any guidance, and thanks in advance for helping a newbie like me! :blush:

1 Like

Overall, how can I create Telegram bots like A, B, C,…?

A is a product, for example, Fast Track – and the bot can have multiple customer variations. Each time someone chats, it represents a different person, and after the chat session ends, it resets to act as a new person for the next user.

This is my goal. I know the logic is simple, but I have been struggling for over seven days. It seems like my skill level is limited, so I haven’t figured it out yet. I would really appreciate everyone’s help.

To clean the memory you can use this:

Put the correct chat session in there and it will reset.

Bu ideally, you should generate a new session ID.
The session ID can be anything—a username, a phone number, or a randomly generated UUID.

One approach is to set sessions to expire after a period of inactivity. This way, you wouldn’t reuse the same session ID. Instead, you would either generate a new one or update the existing ID when the session is renewed.

If my reply answers your question, please remember to mark it as a solution.

1 Like

Thanks a lot! I really appreciate your help! I’ve been struggling with this for over a week, and your explanation makes things much clearer. I’ll definitely implement this logic and see how it works.

By the way, I’m also thinking about building an AI agent that acts as a customer to help interns practice sales skills. The idea is that AI would take on different customer personas and reset after each session, just like you described. Does this approach make sense?

Again, huge thanks! You guys are awesome! :blush:

Yeah, it does make sense!

For this specific case I think it would work very well.

But for other scenarios, sometimes I think it’s better to build separate agents, depending on the prompt, so the AI doesn’t mix things up.

To achieve that you could have a “master” agent that would decide to which AI agent it is going to assign the task.

It would be as easy as appending one “Call workflow” tool for each separate agent.

1 Like

If you consider this topic as solved, please choose a reply as the solution so we can close it.

1 Like

Yes it done by you. But i try to find a button “solve” :(((, and i just see :heart:

Hm… weird. There should be a “Solution” button right next to the heart.


You can see

1 Like

No problem!

I guess it’s because this is not a "Questions.
It’s a “Help me build” topic.

But don’t worry! I’m glad you solved it :muscle:

@Jon would it be possible to change the topic after it’s already posted?

1 Like