---
title: "Get Memory Stats"
method: GET
path: "/api/v1/memory/stats"
tags: ["memory"]
---

# Get Memory Stats

`GET /api/v1/memory/stats`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/memory/stats`
- Auth: none declared

Get memory statistics for the authenticated user's context.

Issue #82: Now context-scoped - returns stats for specified or current context.

Args:
    user: Authenticated user
    context_id: Optional context ID (defaults to current context)
    memory_service: Memory service instance

Returns:
    Memory statistics for specified or current context including counts, types, and storage

## Query parameters

- `context_id` string, uuid, nullable: Optional context ID (defaults to current context)

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- MemoryStatsResponse: Memory statistics response schema (Issue #84). Used by both MCP get_stats tool and REST API /memory/stats endpoint.
  - `total_count` integer, required: Total number of memories (excluding deleted)
  - `working_count` integer, required: Number of working scope memories
  - `persistent_count` integer, required: Number of persistent scope memories
  - `by_type` object: Memory count breakdown by type
  - `by_importance` object: Memory count breakdown by importance level
  - `recent_activity` integer: Recent memories count (time window varies: 24h for REST, 7d for MCP)

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/aa9df1a21db9?raw)
