Memory

Memory management operations

Memory management operations

Append to memory

Append messages to existing memory content

POST
/memory/{memory_ref}/append

Path Parameters

memory_refstring

Memory reference

Key and messages to append

keystring
messagesarray<object>

Response Body

curl -X POST "https://loading/api/v0/memory/string/append" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "string",
    "messages": [
      {
        "property1": null,
        "property2": null
      }
    ]
  }'
{
  "data": {
    "appended": 0,
    "key": "string",
    "success": true,
    "total_count": 0
  },
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}

Clear memory

Clear all memory content with confirmation

POST
/memory/{memory_ref}/clear

Path Parameters

memory_refstring

Memory reference

Key and clear options

backup?boolean
confirmboolean
keystring

Response Body

curl -X POST "https://loading/api/v0/memory/string/clear" \
  -H "Content-Type: application/json" \
  -d '{
    "confirm": true,
    "key": "string"
  }'
{
  "data": {
    "backup_created": true,
    "key": "string",
    "messages_cleared": 0,
    "success": true
  },
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}

Delete memory

Delete all memory content for a specific key

POST
/memory/{memory_ref}/delete

Path Parameters

memory_refstring

Memory reference

Key to delete

keystring

Response Body

curl -X POST "https://loading/api/v0/memory/string/delete" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "string"
  }'
{
  "data": {
    "key": "string",
    "success": true
  },
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}

Flush memory

Flush memory content with optional summarization. The actual_strategy field in the response indicates which flush strategy was used.

POST
/memory/{memory_ref}/flush

Path Parameters

memory_refstring

Memory reference

Key and flush options

dry_run?boolean
force?boolean
keystring
max_keys?integer
strategy?string

Response Body

curl -X POST "https://loading/api/v0/memory/string/flush" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "string"
  }'
{
  "data": {
    "actual_strategy": "string",
    "dry_run": true,
    "error": "string",
    "key": "string",
    "message_count": 0,
    "success": true,
    "summary_generated": true,
    "token_count": 0,
    "would_flush": true
  },
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}

Check memory health

Get health status and metrics for memory

GET
/memory/{memory_ref}/health

Path Parameters

memory_refstring

Memory reference

Query Parameters

keystring

Memory key

include_stats?boolean

Include detailed stats

Response Body

curl -X GET "https://loading/api/v0/memory/string/health?key=string&include_stats=true"
{
  "data": {
    "actual_strategy": "string",
    "current_tokens": 0,
    "healthy": true,
    "key": "string",
    "last_flush": "string",
    "message_count": 0,
    "token_count": 0
  },
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}

Read memory content

Retrieve memory content for a specific memory reference and key

GET
/memory/{memory_ref}/read

Path Parameters

memory_refstring

Memory reference

Query Parameters

keystring

Memory key

limit?integer

Maximum number of messages to return (default: 50, max: 1000)

offset?integer

Number of messages to skip (for pagination)

Response Body

curl -X GET "https://loading/api/v0/memory/string/read?key=string&limit=0&offset=0"
{
  "data": {
    "has_more": true,
    "key": "string",
    "limit": 0,
    "messages": [
      {
        "content": "string",
        "role": "string"
      }
    ],
    "offset": 0,
    "total_count": 0
  },
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}

Get memory statistics

Retrieve detailed statistics about memory content

GET
/memory/{memory_ref}/stats

Path Parameters

memory_refstring

Memory reference

Query Parameters

keystring

Memory key

limit?integer

Limit for role distribution calculation (default: 100, max: 10000)

offset?integer

Offset for role distribution calculation

Response Body

curl -X GET "https://loading/api/v0/memory/string/stats?key=string&limit=0&offset=0"
{
  "data": {
    "context_window_used": 0,
    "key": "string",
    "message_count": 0,
    "pagination_info": {
      "has_more": true,
      "limit": 0,
      "offset": 0,
      "total_count": 0
    },
    "role_distribution": {
      "property1": 0,
      "property2": 0
    },
    "token_count": 0,
    "token_limit": 0,
    "token_utilization": 0
  },
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}

Write memory content

Write or replace memory content for a specific memory reference and key

POST
/memory/{memory_ref}/write

Path Parameters

memory_refstring

Memory reference

Key and messages to write

keystring
messagesarray<object>

Response Body

curl -X POST "https://loading/api/v0/memory/string/write" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "string",
    "messages": [
      {
        "property1": null,
        "property2": null
      }
    ]
  }'
{
  "data": {
    "count": 0,
    "key": "string",
    "success": true
  },
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}
{
  "data": null,
  "error": {
    "code": "string",
    "details": "string",
    "message": "string"
  },
  "message": "string",
  "status": 0
}

Get memory system health

Returns comprehensive health information for the memory system

GET
/memory/health

Response Body

curl -X GET "https://loading/api/v0/memory/health"
{
  "healthy": true,
  "healthy_instances": 0,
  "instance_health": {
    "property1": {
      "consecutive_failures": 0,
      "error_message": "string",
      "healthy": true,
      "last_checked": "string",
      "memory_id": "string",
      "token_usage": {
        "max_tokens": 0,
        "near_limit": true,
        "usage_percentage": 0,
        "used": 0
      }
    },
    "property2": {
      "consecutive_failures": 0,
      "error_message": "string",
      "healthy": true,
      "last_checked": "string",
      "memory_id": "string",
      "token_usage": {
        "max_tokens": 0,
        "near_limit": true,
        "usage_percentage": 0,
        "used": 0
      }
    }
  },
  "last_checked": "string",
  "system_errors": [
    "string"
  ],
  "total_instances": 0,
  "unhealthy_instances": 0
}
{
  "healthy": true,
  "healthy_instances": 0,
  "instance_health": {
    "property1": {
      "consecutive_failures": 0,
      "error_message": "string",
      "healthy": true,
      "last_checked": "string",
      "memory_id": "string",
      "token_usage": {
        "max_tokens": 0,
        "near_limit": true,
        "usage_percentage": 0,
        "used": 0
      }
    },
    "property2": {
      "consecutive_failures": 0,
      "error_message": "string",
      "healthy": true,
      "last_checked": "string",
      "memory_id": "string",
      "token_usage": {
        "max_tokens": 0,
        "near_limit": true,
        "usage_percentage": 0,
        "used": 0
      }
    }
  },
  "last_checked": "string",
  "system_errors": [
    "string"
  ],
  "total_instances": 0,
  "unhealthy_instances": 0
}

Get memory instance health

Returns health information for a specific memory instance

GET
/memory/health/{memory_id}

Path Parameters

memory_idstring

Memory Instance ID

Response Body

curl -X GET "https://loading/api/v0/memory/health/string"
{
  "consecutive_failures": 0,
  "error_message": "string",
  "healthy": true,
  "last_checked": "string",
  "memory_id": "string",
  "token_usage": {
    "max_tokens": 0,
    "near_limit": true,
    "usage_percentage": 0,
    "used": 0
  }
}
{
  "property1": null,
  "property2": null
}