Skip to main content

Overview

The /health endpoint provides a lightweight health check for the LongMem daemon. It returns daemon uptime and operational status without requiring authentication.

Authentication

This endpoint is publicly accessible and does not require an authentication token.

Request

GET /health
No parameters required.

Response

status
string
required
Health status of the daemon. Always returns "ok" if the daemon is running.
uptime
number
required
Daemon uptime in seconds since the process started.
pending
number
required
Number of pending compression jobs in the worker queue.
circuit_open
boolean
required
Whether the compression circuit breaker is open (paused). true means compression is paused due to errors.
idle_ms
number
required
Time in milliseconds since the last activity was recorded by the idle detector.

Example

curl http://localhost:3000/health
Response:
{
  "status": "ok",
  "uptime": 3847,
  "pending": 2,
  "circuit_open": false,
  "idle_ms": 45230
}

Status Codes

  • 200 OK: Daemon is healthy and operational
  • 500 Internal Server Error: Unexpected server error

Use Cases

  • Monitor daemon availability for health checks
  • Verify daemon is running before sending requests
  • Check compression queue status
  • Monitor idle time for auto-shutdown logic

Build docs developers (and LLMs) love