Skip to main content
Hindsight is State-of-the-Art on Memory for AI Agents | Read the paper β†’
πŸ€–
Using a coding agent? Run this to install the Hindsight docs skill:
npx skills add https://github.com/vectorize-io/hindsight --skill hindsight-docs

Webhooks

Hindsight can notify your application in real-time when memory events occur by sending HTTP POST requests to a URL you configure.

Delivery and Retries​

Webhooks are registered per memory bank and fire automatically when matching events occur. Each delivery attempt is tracked, and failed deliveries are retried with exponential backoff:

AttemptDelay after failure
15 seconds
25 minutes
330 minutes
42 hours
55 hours
6Permanent failure

A delivery is considered failed if your endpoint returns a non-2xx status code or does not respond within the configured timeout (default 30 seconds). After 6 failed attempts, the delivery is marked as permanently failed and no further retries are made.

At-least-once delivery

Webhook delivery tasks are queued in the same database transaction as the primary operation (e.g. the retain or consolidation write). This means if the server crashes after committing but before sending, the delivery task survives and will be retried. As a result, your endpoint may receive the same event more than once β€” use the operation_id field to deduplicate if needed.

Event Types​

consolidation.completed​

Fired after Hindsight finishes consolidating new memories into observations for a bank.

Payload:

{
"event":"consolidation.completed",
"bank_id":"my-bank",
"operation_id":"a1b2c3d4e5f6",
"status":"completed",
"timestamp":"2026εΉ΄03月04ζ—₯T12:00:00Z",
"data":{
"observations_created":3,
"observations_updated":1,
"observations_deleted":null,
"error_message":null
}
}

data fields:

FieldTypeDescription
observations_createdinteger | nullNumber of new observations created
observations_updatedinteger | nullNumber of existing observations updated
observations_deletedinteger | nullNumber of observations deleted
error_messagestring | nullSet when status is "failed"

status values: "completed" or "failed"


retain.completed​

Fired once per document after a retain operation completes (both synchronous and asynchronous). When retaining a batch of N documents, N separate events are fired.

Payload:

{
"event":"retain.completed",
"bank_id":"my-bank",
"operation_id":"a1b2c3d4e5f6",
"status":"completed",
"timestamp":"2026εΉ΄03月04ζ—₯T12:00:01Z",
"data":{
"document_id":"doc-abc123",
"tags":["meeting","q1-2026"]
}
}

data fields:

FieldTypeDescription
document_idstring | nullThe document ID if one was provided in the retain request
tagsstring[] | nullDocument-level tags applied during retain

Notes:

  • For async retain (async: true), operation_id matches the operation_id returned by the retain API.
  • For sync retain, operation_id is a generated identifier for tracing purposes.
  • One event is fired per content item in the retain request.

memory_defense.triggered​

Fired when a bank's Memory Defense policy acts on a retained item β€” once per item that is redacted or blocked. Items that pass cleanly do not fire an event. Requires a Memory Defense policy enabled on the bank and a webhook subscribed to this event type.

Payload:

{
"event":"memory_defense.triggered",
"bank_id":"my-bank",
"operation_id":"a1b2c3d4e5f6",
"status":"redact",
"timestamp":"2026εΉ΄03月04ζ—₯T12:00:02Z",
"data":{
"action":"redact",
"detector":"sensitive_data",
"document_id":"doc-abc123",
"matched_types":["github_token","aws_access_key"],
"message":"Sensitive data pattern matched: github_token, aws_access_key"
}
}

data fields:

FieldTypeDescription
actionstringAction taken on the item: "redact" or "block"
detectorstring | nullThe detector that matched ("sensitive_data")
document_idstring | nullThe document ID if one was provided in the retain request
matched_typesstring[] | nullLabels of the redaction patterns that fired (e.g. github_token, ssn_us)
messagestring | nullHuman-readable summary of what matched

status values: mirrors data.action β€” "redact" or "block".

Notes:

  • A redact event means the secret was scrubbed and the redacted memory was still stored. A block event means the item was dropped; if every item in the retain request is blocked, the retain call returns 422.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /