87 lines
No EOL
6.4 KiB
Text
87 lines
No EOL
6.4 KiB
Text
---
|
|
id: batch-put-memories
|
|
title: "Store multiple memories"
|
|
description: "Store multiple memory items in batch with automatic fact extraction."
|
|
sidebar_label: "Store multiple memories"
|
|
hide_title: true
|
|
hide_table_of_contents: true
|
|
api: eJztWFFz2zgO/isY7sO1GcV23O6L3tw07Xmm3XYa3z5cmsnAEixxS5FakrLr8/i/34CkbDlp0l7nXu5m/WSJIEB8+AAC2gmPlRP5jXhPjbFb+NCSRS+NduI2EyW5wsqWn0Uurr2xBE2nvGwVQRN3SE+NA6lhib6oYSN9Ddh506CXBayw8EBfvcWCtYw+688aAOANoe8suTw+nsPVaiULSdonPa01BTknddVLzB5TCitrGtCsEBUo1FWHFR0Uay/9FiwVptIyyKMuQUn9ZaD8tSm6hq2zUl6470jXOrIenm1q0lAm6TtZgnR81rUsqXzea1tQ0xo+DFty1KBmFQeTUWxRE7it89QczaBS2wTJxQiuoovuqGIVHoO/viYojPakfdwwHcFb0hw+ckDNkspS6srFxRcjeE1l1ypZhHUnG6nQRoVR5OUILi2FVZ/Onx0sZ8EViliyI2nTryNYMGLugAk05LFEj72fvxlPOcxXj6EWNKOyhOUW6Kt03mXBO6PKo1YWkt71rOs0P2ykUrAkKEmRpxKWtGKKFuwGx1DTBowmB89S+JZU41oa+3wkMmF6rs9LkYtAu7u283fBhCQnMtGixYY8Wc6RndDYkMgFVtELkQnJidGir0UmLP3ZSUulyL3tKBOuqKlBke+E37a8z3krdSUy4aVX/GLGimBeiv3+Nu4n51+Zcsub7qtLweYlbGMgpdHjPxwn525grbXsmWcP8p0I+Xny53R9oPaxY14mkX0maM2ul+gpnENvP6wCMve3roxt0ItcsOi5lw2JfXYQ051Sgl3uLVyxWnjNavfJ06/+KQtPKbtM2/f7rJcxyz+o8Ccxujl4Ptgaq+DcUyMeVD+pq9OqBytj+2rVeWYUfcWmVXQCq5gpWfA+zYqoBFfT3xxsjA1lhstR4On7d9CYkpQY+C88YQMNkY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paCIy0VklclF737p8PN5sNiMMyyNjq3Ha68bv5pdXv11fnU9Hk1HtG8WK+YyxXFyMJqMJv+IS26Ae2Hokbe9XnGHB++tzzF+fY/6fPseknoXL9bhVKEM7FtJul5qRG4GtFJlYX/S9OCdIPujKD3lzm4ma+5j8Rux2XPH/YdV+z6/5XtqK/OY2E2u0Epd81d/sRCkd/y9FvkLl6InEe/YptW7P4bFj9x2a5u5jjarjJ5GJL7Qdfj8KXUdNWJINZ4jL6XPLeWgdj9sfdNLc/8Qds6Kg1j8pezvo8D5+uF6ITCzThyaeREQuLG64LcVNPKpp42dg/hLF73aiT2WRi6iTf/8GNVi39g==
|
|
sidebar_class_name: "post api-method"
|
|
info_path: docs/api-reference/endpoints/agent-memory-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";
|
|
|
|
<Heading
|
|
as={"h1"}
|
|
className={"openapi__heading"}
|
|
children={"Store multiple memories"}
|
|
>
|
|
</Heading>
|
|
|
|
<MethodEndpoint
|
|
method={"post"}
|
|
path={"/api/v1/memory banks/{agent_id}/memories"}
|
|
context={"endpoint"}
|
|
>
|
|
|
|
</MethodEndpoint>
|
|
|
|
|
|
|
|
Store multiple memory items in batch with automatic fact extraction.
|
|
|
|
Features:
|
|
- Efficient batch processing
|
|
- Automatic fact extraction from natural language
|
|
- Entity recognition and linking
|
|
- Document tracking with automatic upsert (when document_id is provided)
|
|
- Temporal and semantic linking
|
|
|
|
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
|
|
|
|
Note: If document_id is provided and already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior).
|
|
|
|
<Heading
|
|
id={"request"}
|
|
as={"h2"}
|
|
className={"openapi-tabs__heading"}
|
|
children={"Request"}
|
|
>
|
|
</Heading>
|
|
|
|
<ParamsDetails
|
|
parameters={[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"bank ID"}}]}
|
|
>
|
|
|
|
</ParamsDetails>
|
|
|
|
<RequestSchema
|
|
title={"Body"}
|
|
body={{"required":true,"content":{"application/json":{"schema":{"properties":{"items":{"items":{"properties":{"content":{"type":"string","title":"Content"},"event_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Event Date"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"}},"type":"object","required":["content"],"title":"MemoryItem","description":"Single memory item for batch put.","example":{"content":"Alice mentioned she's working on a new ML model","context":"team meeting","event_date":"2024-01-15T10:30:00Z"}},"type":"array","title":"Items"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"}},"type":"object","required":["items"],"title":"BatchPutRequest","description":"Request model for batch put endpoint.","example":{"document_id":"conversation_123","items":[{"content":"Alice works at Google","context":"work"},{"content":"Bob went hiking yesterday","event_date":"2024-01-15T10:00:00Z"}]}}}}}}
|
|
>
|
|
|
|
</RequestSchema>
|
|
|
|
<StatusCodes
|
|
id={undefined}
|
|
label={undefined}
|
|
responses={{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"agent_id":{"type":"string","title":"bank ID"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"items_count":{"type":"integer","title":"Items Count"}},"type":"object","required":["success","message","agent_id","items_count"],"title":"BatchPutResponse","description":"Response model for batch put endpoint.","example":{"agent_id":"user123","document_id":"conversation_123","items_count":2,"message":"Successfully stored 2 memory items","success":true}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}
|
|
>
|
|
|
|
</StatusCodes>
|
|
|
|
|
|
|