praisonai-mcp host exposes four memory tools your MCP client can call directly — no PraisonAI code required on the client side.
Quick Start
1
Serve
Start the host over STDIO and point your MCP client at it.The host registers the four memory tools at startup — see the praisonai-mcp Package guide.
2
Call praisonai.memory.add
Store a fact from your MCP client with a JSON args payload.
3
Call praisonai.memory.search
Retrieve it later by meaning, not exact text.
How It Works
Each tool call spins up aMemory() instance, runs one core method, and returns a string result.
Memory is process-local and shared across all four tools — each call constructs a single Memory() instance against the same store.
Tools Reference
Four tools, mapped one-to-one onto the coreMemory API.
Every tool imports
praisonaiagents.memory.Memory lazily and returns "Error: Memory module not available" when the core package is missing, or "Error: <exc>" on any other failure.
user_id Filtering
Passuser_id to keep each person’s memories separate; omit it for a shared global store.
add stashes user_id inside the JSON metadata, while search and show read it back through the metadata filter.
Common Patterns
Three workflows, shown as the JSON args your MCP client sends. Persist a preference across chats — save once, recall in any later session.Migration (Breaking Rename)
PraisonAI PR #3531 rebound the adapter to the real core API, renaming the tools your MCP client sees.The old tool names were always broken — they bound to methods that never existed on core, so every call returned an
"Error: …" string. The rename fixes them rather than removing working surface.Best Practices
metadata is a JSON string, not a dict
metadata is a JSON string, not a dict
The
add tool signature takes metadata: str — a JSON string, not an object. Encode it with JSON.stringify on the client side before sending.clear resets short-term AND long-term
clear resets short-term AND long-term
clear calls Memory.reset_all(), wiping both stores. Reserve it for demo resets, not per-session cleanup.Errors are strings, not raises
Errors are strings, not raises
Every tool returns
"Error: …" on failure, so your MCP client sees a normal tool-result envelope. Check the string prefix — don’t rely on an exception.Related
praisonai-mcp Package
The host that serves these tools.
Serve Agents
Expose agents over MCP alongside memory.
Memory
Give agents persistent memory across sessions.
The Three MCP Layers
Client vs light server vs heavy host.

