Skip to content

memory.dashboard.backend.main

memory.dashboard.backend.main

FastAPI backend for the Memory Dashboard.

Serves the REST API for the memory graph visualizer. Run with: uvicorn memory.dashboard.backend.main:app --reload --port 8744

health

health() -> dict

Liveness + identity + build probe the launcher uses to manage this backend.

The service is workspace-scoped (memory-dashboard@<instance>) so a health-confirmed port skip distinguishes this workspace's backend not just from unrelated processes but also from a sibling angelo checkout's dashboard holding the same port. build (and version) let a launcher detect a backend running stale code (old build after an upgrade or source edit) and recycle it instead of skipping it.

Source code in memory/dashboard/backend/main.py
@app.get("/api/health")
def health() -> dict:
    """Liveness + identity + build probe the launcher uses to manage this backend.

    The ``service`` is workspace-scoped (``memory-dashboard@<instance>``) so a
    health-confirmed port skip distinguishes *this* workspace's backend not just
    from unrelated processes but also from a sibling angelo checkout's dashboard
    holding the same port. ``build`` (and ``version``) let a launcher detect a
    backend running *stale* code (old build after an upgrade or source edit) and
    recycle it instead of skipping it.
    """
    from memory.dashboard.launcher_core import (
        build_id,
        current_instance_id,
        package_version,
    )

    instance = current_instance_id()
    return {
        "status": "ok",
        "service": f"memory-dashboard@{instance}",
        "instance": instance,
        "version": package_version(),
        "build": build_id(),
        "pid": os.getpid(),
        "started_at": _STARTED_AT,
    }