5.19 The count_memories tool

Returns COUNT(*) over the memory store, with the same set of optional filters that list_memories accepts plus tag and source-provider filters. Cheap; useful as a sanity check before a bulk operation (“how many would I touch?”).

5.19.1 Inputs

include_deleted

Boolean. Optional, default false.

tags

Array of strings. Optional. A memory is counted if it has at least one of these tags.

source_provider

String. Optional exact-match filter on source_provider.

untagged_only

Boolean. Optional. Only count rows with no tags.

min_chars

Integer. Optional. Only count rows whose text length is at least this many characters.

max_chars

Integer. Optional. Only count rows whose text length is at most this many characters.

not_confirmed_since

ISO 8601 timestamp. Optional. Only count rows with last_confirmed_at IS NULL or older than this instant.

5.19.2 Output

{
  "ok": true,
  "count": 412
}

5.19.3 Errors

INVALID_INPUT (out-of-range filter values), DATABASE_ERROR.