Skip to main content

How to Use Direct Import

The Direct Import feature allows users to skip the memory deduction phase and directly input pre-defined memories into the system for storage and retrieval. To enable this feature, set the infer parameter to False in the add method.
Direct import stores "user" and "assistant" messages alike, regardless of which entity ids you pass. Only "system" messages are dropped. Each surviving message becomes one memory, with its content stored verbatim.
Direct import skips semantic duplicate detection: two different phrasings of the same fact will be stored as two separate memories. Exact repeats in the same scope are deduplicated by an exact hash of the text, so resending identical text is safe. Mixing infer=False and infer=True for the same fact can still produce two memories, since neither path checks the other for duplicates.Direct import also does not support multimodal content (image_url, pdf_url, txt_url, mdx_url). Those messages are skipped without raising an error, so they are missing from results rather than reported as a failure. Pass plain string content only when infer=False.

How to Retrieve Memories

You can retrieve memories using the search method.

How to Retrieve All Memories

You can retrieve all memories using the get_all method.
get_all() now requires filters to be specified.
If you have any questions, please feel free to reach out to us using one of the following methods:

Discord

Join our community

GitHub

Ask questions on GitHub

Support

Talk to founders