Operations are background tasks that Hindsight executes asynchronously. They are created when you retain content withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/vectorize-io/hindsight/llms.txt
Use this file to discover all available pages before exploring further.
async: true, upload files, or create mental models. Each operation has a lifecycle from pending through processing to a terminal state. You can poll operation status, cancel pending operations, and retry failed ones.
By default, all background operations execute in-process within the API service.
Operation types
| Operation | Trigger | Description |
|---|---|---|
batch_retain | retain with async: true | Processes content batches in the background |
file_retain | File upload | Converts and ingests uploaded files |
consolidate | After retain | Consolidates new facts into observations |
mental_model | create_mental_model or refresh_mental_model | Generates or refreshes a mental model |
Operation status values
| Status | Description |
|---|---|
pending | Operation is queued and waiting to be picked up |
processing | Operation is actively being processed by a worker |
completed | Operation finished successfully |
failed | Operation failed — check error_message for details |
cancelled | Operation was cancelled before processing began |
List operations
Query parameters
Filter by operation status:
pending, processing, completed, failed, cancelled.Maximum number of operations to return.
Pagination offset.
Response fields
The memory bank these operations belong to.
List of operations.
Example
Get an operation
Example
Cancel an operation
pending operation before it starts processing. Has no effect on operations that are already processing, completed, or failed.
Example
Retry a failed operation
failed or cancelled operation for execution. The operation status resets to pending and the worker picks it up again. Returns 409 if the operation is not in a retriable state.
Response fields
Whether the retry was successfully queued.
Human-readable confirmation message.
The operation ID that was re-queued.
Example
Polling pattern
The recommended pattern for async retain is to submit the request, capture the operation ID, and poll until the operation reaches a terminal state.Error codes
| Status | Code | Description |
|---|---|---|
400 | invalid_request | Malformed request. |
401 | unauthorized | Missing or invalid API key. |
404 | operation_not_found | The specified operation does not exist. |
409 | invalid_state | Operation is not in a retriable state (retry endpoint). |
500 | internal_error | Server error. |
