Designed for AI agents to read, not just humans to glance at.
Loka's health endpoint produces structured text designed for AI agent consumption. Instead of dashboards with charts, it outputs context-rich text that an agent can read, reason about, and act on:
$ loka health --data my_graph.sdb
Overall: HEALTHY
HNSW Index: :hasEmbedding
Status: HEALTHY
Vectors: 435 (0 deleted, 0.0% tombstone ratio)
Layers: 3 (L0: 435, L1: 28, L2: 3)
Connectivity: avg 12.4, min 4, max 16
Entry points: 3
Pseudo-Tables: 2 discovered
Coverage: 78% of triples in pseudo-tables
Cliff steepness: 8.2 (good schema consistency)
Storage:
Triples: 16,234
Terms: 4,891
Predicates: 47
| Category | Metrics | Why It Matters |
|---|---|---|
| HNSW Health | Tombstone ratio, layer distribution, avg/min/max connectivity, entry point diversity | High tombstone ratio degrades search quality. Low connectivity indicates graph fragmentation. |
| Pseudo-Table Coverage | Coverage ratio, cliff steepness, segment count, tail properties | Low coverage means most queries can't use columnar acceleration. Shallow cliff means messy data. |
| Storage | Triple count, term dictionary size, unique predicates | Baseline metrics for capacity planning and anomaly detection. |
The health report suggests specific actions based on thresholds:
An AI agent can read these recommendations and execute loka health --rebuild-hnsw without human intervention.
| Level | Meaning | Action |
|---|---|---|
| HEALTHY | All metrics within normal range | No action needed |
| WARNING | Some metrics approaching thresholds | Schedule maintenance during next low-usage period |
| CRITICAL | Metrics exceed thresholds, performance impacted | Immediate maintenance recommended |