I need help looking for a workflow with AI agent and memory storing

Hi guys,
I have found a workflow

which is similar to the one that I am planning to create, but it only uses the normal memory storage for sessions. I have done some researches using AI, and it has suggested me the use of Redis or Postgres for memory storage. Do you have any ideas or a template that uses AI Agent and Redis or Postgres or any other way of memory storage?

1 Like

Hey welcome! You don’t even need to do anything fancy, n8n already has built-in Postgres Chat Memory and Redis Chat Memory sub-nodes that you just plug directly into the AI Agent node’s memory connector slot — no custom code required. If you’re already running Postgres for n8n’s backend database you might as well use that for chat memory too. There’s actually a template that’s pretty much exactly what you’re looking for: 🤖🧠 AI agent chatbot + LONG TERM memory + note storage + Telegram | n8n workflow template — it’s a Telegram bot with long-term memory storage, should give you a solid starting point to build from.

Hi @ben54 Welcome!
Go with this flow:

The reason is that it shows a concept which is hard to implement when creating logic/workflow like that, and also it shows how the data is being stored.

AND

You will be using supabase to store everything, it is free and gives 3 projects and a lot of computation for free, also it is easy to implement and extremely very beginner friendly.

Now your goal defines a lot about how you want to create data tables, just make sure you are using AI agents LESS to make your workflow less error prone in production scale, and when dealing with application like telegram the workflow i have shared solves a very good problem you would encounter in the next phases of your flow.

So cheers!