Memory Node Customization When working with AI Agent Node

I was wondering if there is a way to add a custom node to the memory of an AI agent.
Currently the available options are: postgress, redis, motorhead and some other.
What if i want to use my own database to store and retrieve memory for example a Mongo db, or a database that’s behind an API(can not be exposed) or in a private subnet.
Is there anyway i can solve this?

I know there is a node called Chat Memory Manager node but i don’t think it’s possible to use it with the AI agent node with the tool capability which i need.

2 Likes

Hey Leykun, great question!

Yeah, the built-in memory options for the AI Agent node (like Redis, Postgres, Motorhead, etc.) are kinda fixed… for now. But there are a few ways to work around that if you want to plug in a custom memory backend like MongoDB or even an API behind a private subnet.

Here’s a thought:

1. Use a custom node or HTTp Request node (middleware-style):
You can set up a logic block before or after the AI Agent node that handles memory separately — something like:

Store messages and metadata in your own DB (e.g. Mongo)
Then inject previous context manually into the prompt of the AI Agent using an Edit Fields node or custom merge step.

Not plug-and-play like the built-in memory, but totally doable.

2. Tool workaround:
If you really need to use tools inside the AI Agent, you can wrap your custom memory logic into an external tool the agent can call. For example, you expose your DB via a controlled internal API (even locally, inside the Docker network) and define a tool in the agent that calls it.

3. Chat Memory Manager:
You’re right it doesn’t play directly with the Agent + tools setup. But you could still use it as a sidecar logic to manage memory and pipe that context into the agent as needed. Bit hacky, but works.

Let me know how locked-down your infra is (e.g. if you can expose anything internally via Docker), and I can suggest something more tailored

Cheers,
Dandy

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