The retain endpoint ingests raw content into a memory bank and transforms it into structured, queryable memories. Hindsight runs LLM-based fact extraction on the content, resolves entities against the existing knowledge graph, and stores the resulting facts — not the original text. A single retain call can produce many memories depending on how much information the content contains.Documentation 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.
To learn about fact extraction, entity resolution, and graph construction in depth, see the Retain Architecture guide.
Endpoint
Request parameters
Your tenant identifier. Use
default for single-tenant deployments.The memory bank to store content into. The bank is created automatically if it does not exist.
One or more content items to retain. Each item is a piece of raw content — a conversation, document, or note — that Hindsight will analyze and decompose into structured memories.
When
true, the call returns immediately with an operation_id and processing runs in the background via the worker service. No usage metrics are returned for async operations. Recommended for large batches or when combined with the provider Batch API for 50% cost reduction.Tags applied to all items in this request batch (merged with per-item tags). Useful for tagging an entire batch with shared metadata such as a session ID.
Response fields
Whether the operation completed without errors.
The memory bank that received the content.
Number of items processed in this request.
Whether processing ran asynchronously.
Present when
async is true. Use this ID to poll GET /v1/{tenant}/banks/{bank_id}/operations/{operation_id} for completion status.Token usage for the LLM extraction calls. Only present for synchronous operations.
Examples
Basic retain
Batch retain
Submit multiple items in a single request to reduce network overhead. Hindsight processes the batch and can optimize extraction across related content.Async retain
For large batches, use async mode to avoid blocking your application.Enable provider Batch API support for 50% cost reduction on async retain by setting
HINDSIGHT_API_RETAIN_BATCH_ENABLED=true. OpenAI and Groq both offer this discount in exchange for a processing window of up to 24 hours.Error codes
| Status | Code | Description |
|---|---|---|
400 | invalid_request | Malformed request body or missing required fields. |
401 | unauthorized | Missing or invalid API key. |
404 | bank_not_found | The specified bank does not exist and could not be created. |
422 | validation_error | One or more item fields failed validation. |
429 | rate_limited | Too many requests. Retry with exponential backoff. |
500 | internal_error | Server error during processing. |
