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

FieldTypeDescription
workspace_idintegerThe workspace being reported on.
quality_scoreintegerComposite health score, 0–100. Higher is better.
signals.total_memoriesintegerTotal non-archived memories in the workspace.
signals.stale_countintegerMemories not retrieved within window_days and considered candidates for decay.
signals.stale_ratenumberstale_count / total_memories.
signals.never_retrieved_countintegerMemories that have never been retrieved since storage.
signals.duplicate_countintegerNear-duplicate clusters detected (post-dedup-pipeline residuals).
signals.overlong_countintegerMemories whose text exceeds the recommended length budget.
signals.optimized_countintegerMemories that have been auto-improved (compressed, deduplicated, or merged).
open_recommendationsintegerPending optimization recommendations (curated via the dashboard).
last_run_atstring | nullISO 8601 timestamp of the last optimization sweep.
top_issue_typesarrayUp to three most-frequent signal types currently flagged.
window_daysintegerTime window used for “stale” / “recent” classification. Default 30.

See Self-Optimization for what each signal means and how the score is computed.

Errors

StatusCause
401Missing or invalid Authorization header.
403Workspace 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.