Skip to main content
Every 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 a Memory() 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 core Memory 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

Pass user_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.
Per-user isolation — tag on write, filter on read.
Wipe memory between demos — reset the whole store in one call.
clear is irreversible and resets both short-term and long-term memory (Memory.reset_all()). Reserve it for demo resets, not per-session cleanup.

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

Without it, show and search see everyone’s memories. Pass user_id on both add (inside metadata) and search/show to keep people isolated.
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 calls Memory.reset_all(), wiping both stores. Reserve it for demo resets, not per-session cleanup.
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.

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.