Skip to main content
Agent Memory exposes up to 53 tools via the Model Context Protocol. Your AI agent calls these automatically based on context, or you can invoke them directly by name. Use the AGENTMEMORY_TOOLS environment variable to control which tools are visible to your agent.
The @agentmemory/mcp shim exposes the full 53-tool surface only when it can reach a running agentmemory server via AGENTMEMORY_URL. Without a server, it falls back to 7 local tools. If you see fewer tools than expected, make sure npx @agentmemory/agentmemory is running and AGENTMEMORY_URL=http://localhost:3111 is set.

Tool Tiers

Core Mode

Set AGENTMEMORY_TOOLS=core to expose only the 8 essential tools. Recommended for agents with limited context windows that struggle with a large tool list.

All Mode (default)

The default AGENTMEMORY_TOOLS=all exposes all 53 tools across every capability tier: search, orchestration, team sharing, knowledge graph, lessons, and more.
If your agent is hitting context-window limits or behaving erratically with too many tools, set AGENTMEMORY_TOOLS=core in your ~/.agentmemory/.env file and restart the server.

Core Tools

These tools are always available regardless of the AGENTMEMORY_TOOLS setting. They cover the essential read/write/search lifecycle every agent needs.
ToolDescription
memory_recallSearch past session observations by keyword, file name, or concept. Accepts an optional format of full, compact, or narrative and a token_budget to trim results.
memory_saveExplicitly save an insight, decision, or fact to long-term memory. Accepts type (pattern, preference, architecture, bug, workflow, fact), concepts, and files metadata.
memory_smart_searchHybrid BM25 + vector + graph search with progressive disclosure. Pass expandIds to drill into specific results. The most powerful retrieval tool.
memory_file_historyGet all past observations about one or more specific files. Pass a comma-separated list of file paths.
memory_patternsDetect recurring patterns across sessions for a project — frequently touched files, repeated errors, workflow habits.
memory_sessionsList all recorded sessions with their status and observation counts.
memory_timelineReturn chronological observations around a point in time. Pass an ISO date or keyword as the anchor, and control how many items appear before and after it.
memory_profileGet a project profile: top concepts, most-accessed files, learned conventions, and recurring patterns.
memory_exportExport all memory data as a JSON snapshot. Useful for backup or migration.
memory_relationsTraverse the memory relationship graph starting from a memoryId. Controls maxHops (default 2) and minConfidence threshold.
memory_compress_fileCompress a Markdown file to reduce token usage while preserving headings, URLs, and code blocks. Creates a .original.md backup first.
memory_commit_lookupLook up which agent session(s) produced a specific git commit by its full SHA.
memory_commitsList recent git commits linked to agent sessions, optionally filtered by branch or remote URL.
memory_vision_searchCross-modal image search via CLIP embeddings. Requires AGENTMEMORY_IMAGE_EMBEDDINGS=true. See Snapshots, Vision & Integrations for full parameter details.

Essential Tools (the 8-tool core set)

When you set AGENTMEMORY_TOOLS=core, your agent sees only this subset — chosen for maximum utility at minimum context cost:
ToolWhy It’s Essential
memory_saveThe primary write path
memory_recallThe primary read path
memory_consolidateKeeps memory health high
memory_smart_searchBest retrieval for ambiguous queries
memory_sessionsSession situational awareness
memory_diagnoseSelf-service troubleshooting
memory_lesson_saveCaptures confidence-weighted learnings
memory_reflectSynthesizes higher-order insights

Memory Consolidation & Health

ToolDescription
memory_consolidateManually trigger the 4-tier consolidation pipeline (working → episodic → semantic → procedural). Pass an optional tier to target a specific stage. Requires CONSOLIDATION_ENABLED=true.
memory_diagnoseRun self-diagnostics across all subsystems — actions, leases, sentinels, sketches, signals, sessions, memories, and mesh peers. Identifies stuck, orphaned, and inconsistent state.
memory_healAuto-repair all fixable issues found by diagnostics. Unblocks stuck actions, expires stale leases, and cleans up orphaned data. Supports dryRun=true to preview changes first.

Knowledge Graph Tools

These tools require GRAPH_EXTRACTION_ENABLED=true in your config. With graph extraction on, agentmemory automatically builds an entity relationship graph from your session observations.
ToolDescription
memory_graph_queryTraverse the knowledge graph by entity or relationship type. Pass startNodeId for BFS traversal, nodeType to filter, or query to search nodes by name. Supports maxDepth up to 8.

Team & Collaboration Tools

Team tools require TEAM_ID and USER_ID to be set in your configuration. Without them, calls return a prompt to configure team mode.
ToolDescription
memory_team_shareShare a memory or observation with your team. Pass the itemId and itemType (observation, memory, or pattern).
memory_team_feedGet recent memories shared by all team members. Returns up to limit items (default 20).
memory_auditView the full audit trail of memory operations. Filter by operation type and control the number of entries returned.
memory_governance_deleteDelete one or more memories by ID with a mandatory audit trail entry. Pass reason to document why.
memory_mesh_syncSync memories and actions with peer agentmemory instances for multi-agent collaboration. Supports push, pull, or both directions.

Orchestration Tools

Orchestration tools are available in v0.5 and later. They power multi-agent task coordination: creating work items, claiming exclusive leases, sending inter-agent messages, and managing approval gates.
Create and track actionable work items with typed dependency graphs.
ToolDescription
memory_action_createCreate an actionable work item with a title, description, priority (1–10), and optional requires dependencies (comma-separated action IDs). Supports hierarchical parent/child via parentId.
memory_action_updateUpdate an action’s status (pending, active, done, blocked, cancelled), priority, or result. Setting status=done automatically unblocks dependent actions.
memory_frontierGet all currently unblocked actions ranked by priority and urgency — the full set of work your agent can pick up right now.
memory_nextGet the single most important next action. Combines dependency resolution, priority, and recency into one score and returns the winner.
memory_leaseAcquire, release, or renew an exclusive lock on an action. Prevents multiple agents from working on the same item simultaneously. Supports ttlMs up to 1 hour.

Lessons & Insights

These tools implement the confidence-scored learning layer — separate from raw memory, lessons track what your agent has explicitly learned and how certain it is.
ToolDescription
memory_lesson_saveSave a lesson learned from a session. Lessons carry a confidence score (0.0–1.0, default 0.5) that strengthens when reinforced and decays when unused. Duplicate content auto-strengthens the existing lesson instead of creating a duplicate.
memory_lesson_recallSearch lessons by query. Returns results sorted by confidence and recency. Use before making decisions to check what the agent already knows. Supports minConfidence filtering.
memory_reflectTraverse the knowledge graph, group related memories into concept clusters, and synthesize higher-order insights via LLM. Returns new and reinforced insights from up to maxClusters groups (default 10).
memory_insight_listList all synthesized insights — higher-order observations derived from patterns across memories, lessons, and crystallized action chains. Filter by minConfidence.
memory_obsidian_exportExport memories, lessons, and crystals as Obsidian-compatible Markdown files with YAML frontmatter and wikilinks for use in graph view.

Memory Slots

Memory slots require AGENTMEMORY_SLOTS=true in your configuration. Slots are editable, size-limited memory units that persist across sessions and can be injected at session start.
Slots give your agent named, persistent storage units — think of them as structured notepads your agent can read and update in place. Default slot labels include persona, user_preferences, tool_guidelines, project_context, guidance, pending_items, session_patterns, and self_notes.
ToolDescription
memory_slot_listList all memory slots (pinned, project-scoped, and global).
memory_slot_getRead a single slot by label.
memory_slot_createCreate a new slot with a label, optional initial content, sizeLimit (default 2,000 chars, hard cap 20,000), and scope (project or global).
memory_slot_appendAppend text to an existing slot. Returns an error if the append would exceed the slot’s size limit — compact first with memory_slot_replace.
memory_slot_replaceReplace a slot’s full content in place. Fails if the new content exceeds the size limit.
memory_slot_deleteDelete a slot. Default slots can be deleted unless marked readOnly.

Provenance & Tagging

ToolDescription
memory_verifyTrace a memory or observation back through its citation chain to source observations and session context. Returns confidence scores and provenance metadata.
memory_facet_tagAttach a structured dimension:value tag to an action, memory, or observation. Example: priority:urgent or team:backend.
memory_facet_queryQuery targets by facet tags with AND (matchAll) or OR (matchAny) logic. Example: find all actions tagged priority:urgent AND team:backend.

Snapshots, Vision & Integrations

ToolDescription
memory_snapshot_createCreate a git-versioned snapshot of the current memory state with an optional commit message. Requires SNAPSHOT_ENABLED=true.
memory_vision_searchCross-modal image search via CLIP embeddings. Pass queryText to find screenshots matching a description, or queryImageBase64 / queryImageRef to find visually similar images. Requires AGENTMEMORY_IMAGE_EMBEDDINGS=true.
memory_claude_bridge_syncBi-directionally sync memory state with Claude Code’s native MEMORY.md file. Pass direction=read to import from MEMORY.md, or direction=write to export to it. Requires CLAUDE_MEMORY_BRIDGE=true.

MCP Prompts

Agent Memory exposes 3 built-in prompts your agent can reference via the MCP prompts/get protocol. Prompts return pre-built message arrays you can inject directly into a conversation.
PromptRequired ArgumentDescription
recall_contexttask_descriptionSearches past observations and memories for a given task and returns a formatted context block ready to inject into the current session.
session_handoffsession_idProduces a structured handoff summary for a specific session — useful when handing off work to a new agent instance or continuing in a new session.
detect_patternsproject (optional)Analyzes sessions for a project and surfaces recurring patterns as a structured message.

Example: using a prompt in Claude Code

Use the recall_context prompt with task_description="implement JWT refresh token rotation"
Claude will call the prompt, which searches your memory and returns relevant past decisions, file history, and observations — all pre-formatted as context for your task.