The memory-mcp platform is currently in development. The Self-hosted Community Edition is available now!

memory_stats

Looks like a counter. Works like an audit tool. The real power is in what it returns alongside the count — a full list of matched labels or sources, not just a number.

Parameters #

ParameterTypeRequiredDescription
labelsstringNoLabel filter (substring-matched, supports ! exclusion)
sourcestringNoSource filter (substring-matched, supports ! exclusion)

With no parameters, returns the total memory count for the namespace.


Response #

FieldDescription
totalTotal memories in the namespace
matchingMemories matching the filter
ratioe.g. "25/994"
percentagee.g. "2%"
labels_matchedFull list of distinct labels matched (when filtering by labels)
sources_matchedFull list of distinct sources matched (when filtering by source)

Examples #

# Total count only
memory_stats()

# How many memories on a topic — plus every label variant that matched
memory_stats(labels: "mcp")

# Count memories from a specific agent
memory_stats(source: "agent:sonnet:main")

# Check unprocessed backlog (nonce label)
memory_stats(labels: "52868312778495")

Power Combinations #

Label discovery — use a broad token to find every label variant the enrichment cron has generated. Surfaces naming patterns, inconsistencies, and unexpected topics:

memory_stats(labels: "memory")
→ labels_matched: ["memory-system", "memory-architecture", "memory-mcp-ce", ...]
# Use this to refine retrieve_memories label queries

Source audit — use "/" to list every structured source in the namespace:

memory_stats(source: "/")
→ sources_matched: ["agent:sonnet:main", "agent:main:main", "anthropic/claude-sonnet-4.6", ...]

Enrichment backlog check — query the nonce label to see how many memories are still awaiting enrichment:

memory_stats(labels: "52868312778495")
→ matching: 0   # cron has caught up
→ matching: 47  # backlog still processing

Namespace health check — combine total with a label filter to understand signal density:

memory_stats()           → total: 994
memory_stats(labels: "architecture")  → matching: 38, ~4% of total
?

AI Assistant

0/500