Documents

List documents with pagination, optional search, and an optional time window. Most recently written first (updated_at descending) unless time_field selects another axis. Documents are the source content from which memory units are extracted.

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

Request

Path parameters

bank_idstring required

Query parameters

qstring nullable

Case-insensitive substring filter on document ID or document text (e.g. 'report' matches 'report-2024' or any document containing 'report'). Meant for browsing and inspection, not for high-volume or latency-sensitive workloads — use recall for that. Matches are capped: past the cap, total is a lower bound and total_is_estimate is true. A store-owned backend may match approximately; each item's matched_fields says what matched.

tagsstring[] nullable

Filter documents by tags

tags_match'any' | 'all' | 'any_strict' | 'all_strict' | 'exact'

How to match tags: 'any', 'all', 'any_strict', 'all_strict', 'exact'

time_field'created_at' | 'updated_at' nullable

Time axis to filter and order by: created_at (when the document first arrived) or updated_at (its last write, the default ordering). Filtering and ordering both follow time_field, and rows with no value on that column are excluded — so total counts only rows carrying that timestamp, and can be 0 on a bank that is not empty.

start_datestring nullable

Filter from this ISO datetime (inclusive)

end_datestring nullable

Filter until this ISO datetime (exclusive)

limitinteger
offsetinteger

Headers

authorizationstring nullable

Response

Successful Response

totalinteger required
limitinteger required
offsetinteger required
total_is_estimateboolean

True when a q search stopped at its match cap, so total is a lower bound rather than an exact count. Always false without q.

Example response

{
  "items": [
    {
      "bank_id": "user123",
      "content_hash": "abc123",
      "created_at": "2024-01-15T10:30:00Z",
      "id": "session_1",
      "memory_unit_count": 15,
      "tags": [
        "user_a",
        "session_123"
      ],
      "text_length": 5420,
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "limit": 100,
  "offset": 0,
  "total": 50
}

Changes

    • breaking

      the query request parameter tags_match was restricted to a list of enum values

    • info

      added the new enum value all to the query request parameter tags_match

    • info

      added the new enum value all_strict to the query request parameter tags_match

    • info

      added the new enum value any to the query request parameter tags_match

    • info

      added the new enum value any_strict to the query request parameter tags_match

    • info

      added the new enum value exact to the query request parameter tags_match

    • info

      added the optional property // to the response with the status

    • info

      added the optional property to the response with the status

    • warning

      for the query request parameter limit, the min was set to 0.00

    • warning

      for the query request parameter offset, the min was set to 0.00

    • warning

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

    • info

      added the new optional query request parameter end_date

    • info

      added the new optional query request parameter start_date

    • info

      added the new optional query request parameter time_field

    • info

      added the non-success response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the required property // to the response with the status