Simple Memory node unexpectedly clears out?

I’m using the Simple Memory node in an AI workflow that is non-conversational. I’m using it to “remember” what happened in a previous run of the workflow, which is scheduled. In a nutshell, the workflow runs an AI agent task to summarize some data, that summarization is passed to another AI agent node (with memory) and it determines if there’s any meaningful change and acts on that.

Arbitrarily, it seems that memory is just … gone? When I look at the node’s logs, the loadMemoryVariables returns an empty array for chatHistory. I assume simple memory is volatile, that is, if the process running n8n restarts, then it will be gone, but it doesn’t look like anything is restarting. This is in n8n self-hosted, running in Docker. Other than confirming that the docker container isn’t restarting, not sure what else to validate. I don’t think I’m running in queue mode, either - I assume I would have had to knowingly set that up, which I didn’t.

What scenarios would cause simple memory to lose its memory?

Thanks!

1 Like

Hey,

Normally it stores it based off sessionId, my guess maybe this isn’t the same each time, or maybe it’s just kept as execution data so isn’t persisted across runs (not 100 percent sure maybe I guess)

Is the sessionID the same?

Best regards,

Samuel

Yeah, using a static session ID for this use case. And it is persisted between runs because the flow generally works as expected.

1 Like

Hello,

I’m experiencing the same issue, both with n8n self-hosted and the deployed version.

I’m also using a static ID, and based on some tests, it seems that the simple memory retains data for around 30 minutes to an hour. I’m not entirely sure why this happens, but I hope this information is helpful.

I’ll try switching to PostgreSQL memory next, as I’ve read it’s more stable and less volatile.

1 Like

@juanaperaita Yes that is the best option basic memory isn’t recommended in production either. :slight_smile:

1 Like