MCP database server to manage state within agent workflow

Not sure if this is total nonstarter. But is it worth it thinking of e.g giving a pedantic ai agent access to a mcp server which interacts with a database in order to manage state within multi agents and or even between runs? So to instruct the agent on each iteration to update the database (maybe with defined output schema) after each run or before each handoff. Could this take over e.g. the state management which is currently done by langgraph? Or is there an obvious reason this concept is nonsense which I did not see (I am not a coder - this could explain if missed a bold show stopper…)

1 Like

This could definitely work! Though could you elaborate more why you wouldn’t want to do this? I’m curious what you think the advantage is over just storing the state in LangGraph, since you can set up LangGraph to also store the state in a database for persistence.

You are right - I do not see a real use case which could not be handled by langgraph. I was asking more out of interest of what can be achieved with MCP servers in general. Writing this I get the nebular idea of combining this with some kind of separate storing of messages (by the same tool) to create a persistent (custom) memory. Kind of integrating what mem0 does now. But I did not really wrap my head around this. If possible to have the state and memory manager as an individual tool available as MCP server so it’s portable and re-usable. But I am just babbling currently…I will think about it and ask again if I come up with something more thought through.

And thanks for your reply to the initial message in the first place.

1 Like

Yeah you bet! And I see what you mean now. There is actually an MCP server for Mem0 (albeit still early stages), so essentially you could just use that for what you’re looking to do here!

1 Like