Skip to content
LangChain

Memory for LangChain

io.github.modelcontextprotocol/server-memory

Reference knowledge-graph memory server. Persists entities, relations and observations so an agent can remember facts across conversations.

client:LangChain transport:stdio runtime:npm tools:9

Install Memory in LangChain

pip install langchain-mcp-adapters

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
        "server-memory": {
            "transport": "stdio",
            "command": "npx",
            "args": ["-y", "@modelcontextprotocol/server-memory"],
        }
})

tools = await client.get_tools()

get_tools() returns the server's tools as LangChain tools, ready for an agent. LangChain docs

What LangChain can do once it is connected

Memory in other clients