Banks

Get statistics for memory bank

Changed on

Get statistics about nodes and links for a specific agent

get/v1/default/banks/{bank_id}/stats

Request

Path parameters

bank_idstring required

Query parameters

refreshboolean

Force a fresh recompute, bypassing the cached value (and refreshing the cache).

Headers

authorizationstring nullable

Response

Successful Response

bank_idstring required
total_nodesinteger required
total_linksinteger required
total_documentsinteger required
nodes_by_fact_typeobject required
links_by_link_typeobject required
links_by_fact_typeobject required
links_breakdownobject required
pending_operationsinteger required
failed_operationsinteger required
operations_by_statusobject

Async operations grouped by status (pending, processing, completed, failed, cancelled).

last_consolidated_atstring nullable

When consolidation last ran (ISO format)

last_memory_write_atstring nullable

When a memory was last written in this bank — stored, edited, or consolidated (ISO format). Null if the bank has no memories. A mental model whose last_memory_seen_at is at or after this is up to date whatever its tags; an older one may need a refresh, which only the single mental-model read can confirm.

pending_consolidationinteger

Number of source memories (world/experience) still queued for consolidation into observations. Excludes memories whose consolidation permanently failed — those are counted only in failed_consolidation — so this drains to 0 when the consolidator catches up.

failed_consolidationinteger

Number of source memories (world/experience) whose consolidation permanently failed and can be retried via the consolidation recovery endpoint.

total_observationsinteger

Total number of observations

paused_mental_modelsinteger

Number of mental models whose last refresh failed, so the automatic triggers (refresh_after_consolidation, refresh_cron, full_refresh_cron) skip them until an explicit refresh succeeds. Their content stops updating, so alert on this being above 0. Each model's last_refresh_failed_at says which ones, and its history says why.

Example response

{
  "bank_id": "user123",
  "failed_consolidation": 0,
  "failed_operations": 0,
  "last_consolidated_at": "2024-01-15T10:30:00Z",
  "last_memory_write_at": "2024-01-15T11:05:00Z",
  "links_breakdown": {
    "fact": {
      "entity": 40,
      "semantic": 60,
      "temporal": 100
    }
  },
  "links_by_fact_type": {
    "fact": 200,
    "observation": 40,
    "preference": 60
  },
  "links_by_link_type": {
    "entity": 50,
    "semantic": 100,
    "temporal": 150
  },
  "nodes_by_fact_type": {
    "fact": 100,
    "observation": 20,
    "preference": 30
  },
  "paused_mental_models": 0,
  "pending_consolidation": 0,
  "pending_operations": 2,
  "total_documents": 10,
  "total_links": 300,
  "total_nodes": 150,
  "total_observations": 45
}

Changes

    • info

      added the optional property to the response with the status

    • warning

      removed the optional property // from the response with the status

    • info

      added the new optional query request parameter refresh

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status