---
title: "Get Memory Usage Stats"
method: GET
path: "/api/v1/contexts/{context_id}/memory-stats"
tags: ["contexts"]
---

# Get Memory Usage Stats

`GET /api/v1/contexts/{context_id}/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/contexts/{context_id}/memory-stats`
- Auth: none declared

Get per-memory recall statistics for a context.

Issue #83: Memory usage stats for context cleanup workflows.
Supports sorting by access_count, reference_count, importance, created_at,
last_used_at (issue #1046 replaced the dead ``use_count`` sort with the
adoption-signal ``reference_count``; default sort moved to ``access_count``).

## Path parameters

- `context_id` string, uuid, required

## Query parameters

- `sort_by` string: Sort field
- `sort_order` string: Sort order: asc or desc
- `limit` integer
- `offset` integer

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- MemoryUsageStatsResponse: Response for per-memory stats endpoint.
  - `memories` MemoryStatItem[], required
    - `id` string, required
    - `summary` string, required
    - `type` string, required
    - `importance` number, required
    - `scope` string, required
    - `access_count` integer, required
    - `reference_count` integer, required
    - `last_used_at` string, nullable, required
    - `embedding_status` string, required
    - `created_at` string, required
  - `total` integer, required
  - `sort_by` string, required
  - `sort_order` string, required

## 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)
