GET /api/memory/stats Bearer

Get Memory Stats

Retrieve memory backend statistics including total entries stored, storage size, last auto-learn timestamp, and provider-specific metrics for monitoring memory system health.

Overview

Returns statistics about the current memory backend, including the number of stored memories and the active backend type.

Response

backend string
Active memory backend (file or mem0)
total_memories integer
Total number of long-term memory entries
Terminal window
curl -X GET "http://localhost:8000/api/memory/stats" \
-H "Authorization: Bearer <token>"
const response = await fetch("http://localhost:8000/api/memory/stats", {
headers: { "Authorization": "Bearer <token>" }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
"http://localhost:8000/api/memory/stats",
headers={"Authorization": "Bearer <token>"}
)
print(response.json())
{
"backend": "mem0",
"total_memories": 47
}
Request
curl -X GET "http://localhost:8000/api/memory/stats" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>"
const response = await fetch("http://localhost:8000/api/memory/stats", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
},
});

const data = await response.json();
console.log(data);
import requests

response = requests.get(
    "http://localhost:8000/api/memory/stats",
    headers={'Content-Type':'application/json','Authorization':'Bearer <token>'},
)

print(response.json())
package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {
    req, _ := http.NewRequest("GET", "http://localhost:8000/api/memory/stats", nil)
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer <token>")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
Response
Send a request to see the response