Skip to main content

GET /v1/memories

List memories for your organization with optional filtering by agent and user. Results are paginated using opaque cursors. Content is excluded from results — use GET /v1/memories/{id} to fetch the full record. Required scope: memory:read

Request

curl "https://api.thrindex.com/v1/memories?agent_id=support-agent&user_id=user-42&limit=50" \
  -H "Authorization: Bearer th_live_..."

Query parameters

ParameterTypeRequiredDefaultDescription
agent_idstringnoFilter to memories belonging to this agent. Must match [A-Za-z0-9._:-], max 256 chars. Omit to list all agents.
user_idstringnoFilter to memories belonging to this user. Same constraints. Omit to list all users.
limitintegerno50Results per page. Range: 1200. Values outside range are clamped.
cursorstringnoOpaque cursor from next_cursor of a previous response. Omit for the first page.

Response

200 OK

{
  "results": [
    {
      "id": "3f2e1d0c-1234-5678-abcd-ef0123456789",
      "org_id": "org_abc...",
      "agent_id": "support-agent",
      "user_id": "user-42",
      "level": 0,
      "status": "active",
      "importance": 0.82,
      "confidence": 1.0,
      "source": "agent",
      "created_at": "2026-05-24T17:00:00.000Z",
      "updated_at": "2026-05-24T17:00:00.000Z"
    }
  ],
  "next_cursor": "eyJpZCI6Ii4..."
}

Top-level fields

FieldTypeDescription
resultsarrayCurrent page of memory records.
next_cursorstring | omittedOpaque pagination cursor. Pass as cursor in the next request. Absent when no more pages remain.

Memory record fields

FieldTypeDescription
idstring (UUID)Memory identifier
org_idstringYour organization identifier
agent_idstringAgent that owns the memory
user_idstringUser the memory belongs to
levelinteger0 = raw, 1 = abstraction
statusstring"active" or "deprecated"
importancefloat (0–1)Importance score
confidencefloat (0–1)Confidence score
sourcestringOrigin of the memory (e.g. "agent")
created_atISO 8601 stringCreation timestamp
updated_atISO 8601 stringLast update timestamp
content is intentionally omitted from list results to keep paginated payloads small. Use GET /v1/memories/{id} to retrieve the full record including content.

Pagination

Iterate through all pages by following next_cursor until it is absent:
# First page
curl "https://api.thrindex.com/v1/memories?agent_id=support-agent&limit=100" \
  -H "Authorization: Bearer th_live_..."

# Next page (use next_cursor from the previous response)
curl "https://api.thrindex.com/v1/memories?agent_id=support-agent&limit=100&cursor=eyJpZCI6Ii4..." \
  -H "Authorization: Bearer th_live_..."

Examples

from thrindex import Thrindex, ListResponse

client = Thrindex(api_key="th_live_...")

# Fetch the first page
page: ListResponse = client.list(
    agent_id="support-agent",
    user_id="user-42",
    limit=50,
)

# Iterate through all pages
all_memories = []
while True:
    all_memories.extend(page.results)
    if not page.next_cursor:
        break
    page = client.list(
        agent_id="support-agent",
        user_id="user-42",
        cursor=page.next_cursor,
    )

print(f"Total memories: {len(all_memories)}")

Errors

StatusCodeDescription
400validation_errorInvalid agent_id or user_id charset
401unauthorizedMissing or invalid API key
401forbiddenAPI key lacks memory:read scope
429rate_limitedRate limit exceeded
500internal_errorServer error