optimize.health
Read-only health diagnostic for the workspace memory store. Returns a quality score on a 0–100 scale plus underlying signal counts.
GET /v1/optimize/health
Free diagnostic — does not count against your plan’s memory-write or memory-retrieve quotas. Suspended and limit-reached workspaces can still call this endpoint.
Request
curl https://api.mnemexa.com/v1/optimize/health \
-H "Authorization: Bearer mnx_ws_YOUR_KEY"
No request body. Workspace is derived from the API key.
Response
{
"workspace_id": 42,
"quality_score": 87,
"signals": {
"total_memories": 1240,
"stale_count": 42,
"stale_rate": 0.0339,
"never_retrieved_count": 18,
"never_retrieved_rate": 0.0145,
"duplicate_count": 0,
"duplicate_rate": 0.0,
"overlong_count": 3,
"overlong_rate": 0.0024,
"optimized_count": 91,
"optimized_rate": 0.0734
},
"open_recommendations": 2,
"last_run_at": "2026-05-15T06:00:00Z",
"top_issue_types": [
{"type": "stale", "count": 42},
{"type": "overlong", "count": 3}
],
"window_days": 30
}
Fields
| Field | Type | Description |
|---|---|---|
workspace_id | integer | The workspace being reported on. |
quality_score | integer | Composite health score, 0–100. Higher is better. |
signals.total_memories | integer | Total non-archived memories in the workspace. |
signals.stale_count | integer | Memories not retrieved within window_days and considered candidates for decay. |
signals.stale_rate | number | stale_count / total_memories. |
signals.never_retrieved_count | integer | Memories that have never been retrieved since storage. |
signals.duplicate_count | integer | Near-duplicate clusters detected (post-dedup-pipeline residuals). |
signals.overlong_count | integer | Memories whose text exceeds the recommended length budget. |
signals.optimized_count | integer | Memories that have been auto-improved (compressed, deduplicated, or merged). |
open_recommendations | integer | Pending optimization recommendations (curated via the dashboard). |
last_run_at | string | null | ISO 8601 timestamp of the last optimization sweep. |
top_issue_types | array | Up to three most-frequent signal types currently flagged. |
window_days | integer | Time window used for “stale” / “recent” classification. Default 30. |
See Self-Optimization for what each signal means and how the score is computed.
Errors
| Status | Cause |
|---|---|
| 401 | Missing or invalid Authorization header. |
| 403 | Workspace deleted or client account suspended. |
This endpoint never returns 429 for unit limits, and never 422 — there are no inputs to validate.
SDKs
import mnemexa
client = mnemexa.Client()
health = client.optimize.health()
print(f"Quality: {health.quality_score}/100")
print(f"Stale: {health.signals.stale_count} of {health.signals.total_memories}")
The MCP adapter exposes this as brain.health. See Python SDK and MCP Adapter.