New to Claude Skills? Learn how to install them →

mem0ai on GitHub

Mem0 Stats

Free

Monitor memory usage and performance metrics for your projects.

by mem0ai63k stars on mem0ai/mem0
1 views
Updated Aug 7, 2026
Get this skill

Free · Opens the source repo

What Mem0 Stats does

Mem0 Stats is a utility designed for developers and designers who need to monitor memory usage and performance metrics in their projects. This skill provides a comprehensive overview of session and lifetime memory statistics, including counts by category, age distribution of memories, and API latency. By utilizing this skill, users can effectively audit memory distribution across categories, review session activity, and check the number of memories that exist within a project.

The execution of Mem0 Stats involves a straightforward process. First, it gathers session statistics by running a local script that reports current session data without clearing the stats file. Next, it fetches lifetime statistics from the API, grouping memories by categories and types, while also analyzing the age of memories. The results are displayed in a clean, minimalistic dashboard that provides essential insights without unnecessary clutter. This makes it easy for users to understand their memory usage at a glance.

Mem0 Stats is particularly useful for developers and designers who are working on projects that involve memory-intensive operations or require detailed oversight of memory management. It is an ideal tool for those who want to optimize their projects by understanding how memories are distributed and how they age over time. Additionally, the weekly digest feature allows users to track recent activity and highlights significant changes in memory usage, making it easier to identify trends and patterns.

However, while Mem0 Stats offers valuable insights into memory usage, it may not be suitable for users who require real-time monitoring or advanced analytics features. Its focus is primarily on providing a snapshot of memory statistics rather than continuous tracking or complex data analysis. Therefore, users looking for more dynamic monitoring solutions may need to explore additional tools.

When to use it

Use Mem0 Stats when you need to audit memory distribution, review session activity, or check memory counts in your projects.

When not to use it

Avoid using this skill for real-time memory monitoring or if you need advanced analytics beyond basic statistics.

What you can build with it

Project Audit

Use Mem0 Stats to review memory distribution across categories in your project, helping identify areas for optimization.

Session Activity Review

Check session statistics to understand how many memories were written and searched during a specific session.

Weekly Performance Tracking

Leverage the weekly digest feature to track memory usage trends and significant activities over the past week.

How to install Mem0 Stats

View source

1. Install with the skills CLI

npx skills add mem0ai/mem0/stats --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mem0ai

Mem0 Stats

Show session and lifetime memory statistics.

Execution

Step 1: Gather session stats

Run the session stats reporter:

SCRIPT_DIR="${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CURSOR_PLUGIN_ROOT:-}}}/scripts"
python3 "$SCRIPT_DIR/session_stats.py" peek 2>/dev/null || echo "{}"

The peek command returns JSON without clearing the stats file (unlike report).

If the script returns empty or errors, note "No session data available" and continue.

Step 2: Fetch lifetime and session stats from API

Lifetime stats: Call get_memories to fetch all memories for this project:

filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<active_project_id>"}]}, page_size=100

Group by:

  1. categories[0] (platform-assigned) — primary grouping
  2. metadata.type (agent-assigned) — secondary if no categories
  3. created_at date — for age analysis

Category normalization: Merge auto_capture and uncategorized into a single uncategorized row. These are memories where the platform didn't assign a meaningful content category. Do NOT show auto_capture as its own row in the table.

Session stats (local only): Session stats come from the local stats file read in Step 1. Do NOT query the API with run_id or metadata.session_id filters — these return unreliable results because memories are stored without run_id and metadata filters on session_id are inconsistent.

The local stats file tracks adds and searches for the current session accurately.

Also run a search_memories MCP tool call with query="project", filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<active_project_id>"}]}, top_k=1 to measure round-trip latency. Note the time before and after the MCP call — do NOT attempt raw HTTP calls to the API.

Step 3: Display

Print a minimal dashboard. No ASCII bar charts — use a clean table layout:

## mem0 stats

**Session** (<session_id, first 12 chars>) — 3 written, 5 searches, categories: decision, convention

**Project: my-project** — 55 memories, API: 84ms

| Category             | Count |
|----------------------|-------|
| decision             |    24 |
| convention           |    15 |
| anti_pattern         |     6 |
| task_learning        |     5 |
| user_preference      |     3 |
| session_state        |     2 |

**Age** — oldest: 2026-02-15, newest: 2026-05-23
  < 7 days: 5 · 7–30d: 12 · 30–90d: 10 · > 90d: 8

**Identity** — user: kartik · project: my-project · branch: main

Display rules:

  • Category table: sort by count descending, omit categories with 0 memories
  • Age: single line with dot-separated buckets, computed from created_at
  • Session line: skip if no session data available
  • If only 1-2 total memories, skip the category table — just show the count
  • Keep everything compact — no decorative borders or filler

Weekly digest mode

When invoked with --weekly (e.g., /mem0:stats --weekly), append a weekly activity digest after the standard stats dashboard:

W1: Fetch recent memories

Call search_memories in parallel with time-scoped queries:

  1. query="decisions made this week", filters={"AND": [{"user_id": "<id>"}, {"app_id": "<pid>"}, {"created_at": {"gte": "<7 days ago YYYY-MM-DD>"}}]}, top_k=20
  2. query="bugs errors fixes", same time filter, top_k=20
  3. query="patterns conventions learnings", same time filter, top_k=20

W2: Analyze

Merge by ID. Group into "New this week" by categories[0] or metadata.type. Calculate: memories added last 7 days, most active categories, most active day.

W3: Display

Append after the standard stats:

### This week (May 16 – May 23)

+12 memories — most active: Wednesday (5)

| Category      | New |
|---------------|-----|
| decision      |   5 |
| task_learning |   4 |
| bug_fix       |   3 |

**Highlights**
- <2-3 sentence summary of most important decisions/learnings this week>

W4: Write digest file

Write to ~/.mem0/weekly-digest.md (overwrite). Append one-line to ~/.mem0/digest-history.log:

<YYYY-MM-DD> | <project_id> | +<new_count> memories | top: <top_category>

W5: Empty state

If no new memories in 7 days:

No new memories in the past week. Total: <N> memories in <project_id>.

Frequently asked questions about Mem0 Stats

Similar skills