Skip to content
docsGitHub ↗
Documentation

Search the docs

Loading search…

    On this page

    HTTP API#

    The local HTTP API is the shared backend for MCP, CLI and Pi. Use these routes for a custom integration; the graph is an HTML application at /, while /ui/* serves data.

    Base URL#

    Default: http://127.0.0.1:8787. Host/port come from Configuration. The running FastAPI service also exposes its generated /openapi.json and /docs API explorer. Those local paths are separate from this website.

    Agent routes#

    Most memory operations return {"text": "…", "node_id": null} (with a node ID where applicable). Client/setup/history/maintenance routes return their own structured objects/lists. Do not assume every response is a text envelope.

    Method and path Request / result
    POST /agent/remember JSON content required; optional type, tier, source, space, tags, connections, title, about_self, confidence. Query default_space fills a falsy creation space. Returns text and ID.
    POST /agent/recall JSON query required; limit 1–100 (10), types, tiers, spaces, tags, created_after, created_before, session_id. Query default_space prioritizes. Returns formatted text.
    GET /agent/recall/{node_id} Optional query session_id; full formatted node/connections, or 404.
    POST /agent/outdated/{node_id} Optional JSON reason; text or 404.
    POST /agent/feedback JSON node_id, signal (1 or -1); optional source (explicit/implicit, default explicit) and exact integer whisper_log_id.
    POST /agent/whisper JSON prompt, space, session_id; returns text, possibly empty. The integrator must inject it before the answer.
    POST /agent/update/{node_id} Partial update: content/type/tier/title/space/tags/confidence/valid_until/add_connections. Omitted or null fields leave existing values unchanged; space: null does not clear scope.
    DELETE /agent/recall/{node_id} Delete a memory; text or 404.
    POST /agent/connect JSON source_id, target_id, optional edge (related_to) and weight (0.5, 0–1).
    GET /agent/clients Supported client detection/wiring/platform status.
    POST /agent/setup Wire all detected clients; changes local configuration.
    POST /agent/setup/{agent_id} Wire one client: claude_code, codex, claude_desktop, pi.
    DELETE /agent/setup/{agent_id} Remove that client's Ormah integration.

    Tool links is translated to HTTP connections, and tool recall_node, mark_outdated, submit_feedback and run_maintenance do not map to same-named HTTP paths. Custom dispatch.

    Example: store a memory#

    curl -fsS http://127.0.0.1:8787/agent/remember \
      -H 'Content-Type: application/json' \
      -d '{"content":"Checkout retries must reuse the same idempotency key.","title":"Checkout retries","type":"decision","space":"ormah-demo"}'
    

    Inspect the successful result's node_id. For global creation, send space: null without a default_space parameter. Never substitute a fictional success result when checking a write.

    Example: recall#

    curl -fsS http://127.0.0.1:8787/agent/recall \
      -H 'Content-Type: application/json' \
      -d '{"query":"checkout retries","spaces":["ormah-demo"],"limit":5,"session_id":"synthetic-check-1"}'
    

    A spaces array is a filter; default_space is a ranking preference. The response's formatted text is not the same shape as UI search's structured node array.

    Maintenance and review#

    POST /agent/maintenance with {} starts phase-one batch generation. It returns a job object and may be 202. Poll GET /agent/maintenance?job_id=... until status="awaiting_results" and batches are available. Analyze those batches, then POST {"job_id":"…","results":{…}} and poll until completed with apply_summary. Handle failed, 404 and 409; a request timeout does not cancel the job.

    Method and path Use
    GET /agent/insights Belief evolution/conflict data
    GET /agent/proposals Pending proposals with node details
    POST /agent/proposals/{proposal_id} JSON action: approved or rejected; review can apply a mutation
    GET /agent/merges Optional limit (20); merge history
    GET /agent/audit Optional limit (20), node_id, operation
    POST /agent/merges/{merge_id}/undo Undo a merge; text response

    The MCP maintenance contract explains the analysis step and adapter polling.

    Ingest routes#

    Method and path Input / response
    POST /ingest/conversation JSON content, optional agent_id; query default_space, dry_run, extra_tags (comma-separated).
    POST /ingest/file Multipart file; 10 MiB upload limit, 413 if exceeded.

    Successful extraction returns status, extracted and memories. An extraction/provider error can be represented by status="error" and result inside HTTP 200: check both the HTTP status and payload. A dry run still invokes extraction. These routes ingest raw text; capture prerequisites apply.

    Admin routes#

    Method and path Use
    GET /admin/health Service health and configuration/store information
    GET /admin/maintenance-status Maintenance status
    GET /admin/backup Local backup configuration and latest metadata
    POST /admin/backup/create Create a source snapshot
    POST /admin/backup/settings JSON backup_dir (nonempty), retention_count (≥1); persist settings
    GET /admin/cloud-status Per-store cloud and restore-verification health
    POST /admin/rebuild Rebuild indexes
    GET /admin/tasks Registered tasks and scheduling information
    POST /admin/tasks/{task_id}/pause Pause one scheduled task
    POST /admin/tasks/{task_id}/resume Resume one task
    POST /admin/tasks/{task_id}/run Trigger one task
    POST /admin/tasks/pause-all Pause tasks
    POST /admin/tasks/resume-all Resume tasks
    POST /admin/tasks/run-all Run the defined maintenance cycle

    These local admin routes are not all protected by account authentication. Do not expose them as a hosted public API.

    UI routes#

    Method and path Shape
    GET /ui/graph nodes, edges, user_node_id
    GET /ui/graph/node/{node_id} Node, edges, neighbors and tags; a missing node can return an error object
    GET /ui/search?q=...&limit=20 Structured node array with _score; empty query gives an empty list
    GET /ui/insights Belief evolution/tension data
    WS /ui/ws Graph-update channel
    GET /stats Canonical statistics; optional days 1–365, otherwise current calendar week (Mon–Sun UTC)

    To open the graph in a browser, use http://localhost:8787/, not /ui or /ui/graph.

    Account and protection routes#

    Sensitive local routes under /admin/account/* and /admin/cloud/protection* require the local capability and loopback checks described below. They are native/account integration surfaces, not general memory tools. Their models and orchestration are defined in account routes and protection routes.

    Method and path Contract / source responsibility
    POST /admin/account/request-code account request code
    POST /admin/account/verify account verify code
    GET /admin/account/status account status
    POST /admin/account/logout account logout
    GET /admin/account/offer Return the hosted plan offer for the signed-in account.
    POST /admin/account/checkout Create a hosted Checkout handoff for one protection intent.
    POST /admin/account/portal Create a hosted billing-portal handoff for the signed-in account.
    GET /admin/cloud/protection Return durable, token-free protection state for this memory.
    GET /admin/cloud/protection/remote Describe the newest cloud backup, including one uploaded by another device.
    POST /admin/cloud/protection/intents Record explicit upload consent and create or resume a protection intent.
    POST /admin/cloud/protection/intents/{intent_id}/bind Bind an existing protection intent to the currently authenticated account.
    POST /admin/cloud/protection/intents/{intent_id}/cancel Cancel a protection intent that has not crossed the upload boundary.
    POST /admin/cloud/protection/intents/{intent_id}/enable Start immediate upload and verification without holding the request open.
    POST /admin/cloud/protection/disable Stop future uploads while preserving retained recovery points.
    POST /admin/cloud/protection/backup Create a recovery point and restore-test that exact snapshot.
    POST /admin/cloud/protection/verify Start a full scratch restore verification for one recovery point.
    POST /admin/cloud/protection/restore/prepare Find and fully verify the newest locally restorable recovery point.
    POST /admin/cloud/protection/restore/{preparation_operation_id}/confirm Consume one verified preparation and replace live memory once.
    POST /admin/cloud/protection/restore/{preparation_operation_id}/cancel Consume and delete one unneeded verified preparation.
    POST /admin/cloud/protection/recovery-kit/prepare Ensure the canonical kit matches current keys before native save.
    POST /admin/cloud/protection/recovery-kit/confirm Confirm only the digest produced after the native destination was reopened.
    GET /admin/cloud/protection/operations/{operation_id} Poll one process-local invocation; durable protection status is separate.

    Use the detailed cloud recovery reference for the state machine. This route inventory is not an untested cloud-restore recipe. An upload, a verified snapshot, a prepared restore and a confirmed replacement are distinct operations.

    Authentication and errors#

    The default service binds to loopback. CORS permits loopback origins; it is not open wildcard CORS, and it does not authenticate non-browser callers. General agent/admin routes do not inherit a blanket account-token requirement.

    Sensitive account/protection routes require a loopback peer and X-Ormah-Local-Token, validated against the installation's owner-only local capability. The native bridge handles that boundary. Do not paste that token into documentation, browser code or bug reports. A non-loopback peer receives 403; a missing/incorrect capability receives 401.

    Typed FastAPI requests normally return 422 for validation errors; unknown memory/job references can return 404, conflicting maintenance state 409. Some manually parsed or operation-specific endpoints return their own error objects. Inspect each response body as well as status and preserve errors in a custom tool loop. Binding/forwarding the port to other machines does not create a secure remote service.