--- id: retain-memories title: "Retain memories" description: "Retain memory items with automatic fact extraction." sidebar_label: "Retain memories" hide_title: true hide_table_of_contents: true api: eJztWFtv27gS/isDvpwGUHxr+yJgH9I0uydAuw1S9xQ42cAYi2OLG4lUSSquYfi/L4aUZMlu0kX3ceuXxLzM9ZtvxtwJSS6zqvLKaJGKW/KoNJRUGrsF5al0sFE+B6y9KdGrDFaYeaCv3mLGl0Z/6D80AMA8Vw6UA58TlCyEtKyM0h5WxoLzxiq9jpIVuRFce3B1VRnrHSyNz8FtdZZbo03tALUE7C9U1mTknNLrqO1RYdAUDkGFFkvyZDtrfiX0tSWXxq/ncLVaqUyR9rBEn+UnAs/h4ikXYWVNCZoFYgEF6nWNa+oEa6/8FixlZq1VOM/WF0o/9IS/NVldsnYWyhvHYa0rR9bDi01OGmRzeqEkh7Sy5lFJkmB0zMlZK3ZOZWXYKlbpqETNso50fwjZ5UNPRbTNIIHbOk/lwS4sim0Tw+kIrmJM3EHVKnwNAeJ0ZEZ70j5emI3gN9Jk0ZMDKpckpdJrFzdfjuAtyboqVBb2nSpVgTYKjEdejeDSUtj1jZ9JpzkJLlMMPjvcXHo9gjmH2HVBhJI8SvTY+vmZQxxi8Yu3NXUQuSVfW+1AlSVJhZ6KLeDKk4UvNdWcM3bRo3tob9x0MYQcq4r4sg6nlpg9rK2ptWzPfnIUdkzFEVFGu0OFeAOl0coby2lZW3LuG8ausHAELyStsC78WWf3Z1Scg3i5tccbyExZFeTp2L/oExZFV42AlkKJkmz1/m48pXC9AuyzAeToAAf49Dl6wMISyi3QV+W8S6KjhTzkgJPFVjayas1fNqooYEkgic2UsKSVsQQZJ5190LQBo8nBi6Y6lpTjozL2jOmj4yZW5rCkgVnsESegIgnerMnnZEOMqCOCQ7RGIhFdXq6lSIUNRLhoAyQS0XGME+ndTmgsSaRiifphoaRIhGL+rNDnIhGWvtTKkhQpAywRLsupRJHuhN9WfM15ZkORCK98wQtvUD/AtRT7/X28Ts6/MXLLd46lNUXGW1jFAlJ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6+u8zMecDz/qh//mU8/Mp5+dTzs+nnH/hU07TeLlvjasCVZgpAjPvmo56Jx6nvV9DcRhjOk0Pw2FHsveJyLkdp3dit1uio0+22O95+UtNdivSu/tEPKJVuOQOdLcTUjn+X3Yd90mWfnHbTCBn8JTh7aChuWk+YlHzN5GIB9r2HqBCL8wJJdlgQtxtHmzOwwB0uH0yD3LXjjcusowq/+zZ+96ccvPh45zD1zxV8STMr2e44eEKN9FSExwPw2JY24mWeUUqokz+/AWKXYOP sidebar_class_name: "post api-method" info_path: docs/api-reference/endpoints/hindsight-http-api custom_edit_url: null --- import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Retain memory items with automatic fact extraction. This is the main endpoint for storing memories. It supports both synchronous and asynchronous processing via the async parameter. Features: - Efficient batch processing - Automatic fact extraction from natural language - Entity recognition and linking - Document tracking with automatic upsert (when document_id is provided on items) - Temporal and semantic linking - Optional asynchronous processing The system automatically: 1. Extracts semantic facts from the content 2. Generates embeddings 3. Deduplicates similar facts 4. Creates temporal, semantic, and entity links 5. Tracks document metadata When async=true: - Returns immediately after queuing the task - Processing happens in the background - Use the operations endpoint to monitor progress When async=false (default): - Waits for processing to complete - Returns after all memories are stored Note: If a memory item has a document_id that already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior). Items with the same document_id are grouped together for efficient processing.