"The Memory suite consists of **MemoryStore**, **MemorySource**, and **MemorySink**. Under the hood, the Memory suite points to an in-memory dictionary. Similarly, the **MemoryStore** is a just a wrapper around a paired **MemorySource** and **MemorySink**; as there is quite limited uses for just a **MemorySource** or a **MemorySink**, it is recommended to always use **MemoryStore**. The **MemoryStore** is intended for retrieving/searching and pushing STIX content to memory. It is important to note that all STIX content in memory is not backed up on the file system (disk), as that functionality is ecompassed within the **FileSystemStore**. However, the Memory suite does provide some utility methods for saving and loading STIX content to disk. **MemoryStore.save_to_file()** allows for saving all the STIX content that is in memory to a json file. **MemoryStore.load_from_file()** allows for loading STIX content from a json-formatted file. \n",
"\n",
"\n",
"### Memory API\n",
"\n",
"### MemorySource (snapshot)\n",
"* **get()** - search/retrieve from memory most current STIX SDO/SRO via its ID\n",
"* **all_versions()** - search/retrieve from memory all versions of STIX SDO/SRO via its id\n",
"* **query()** - search/retrieve from memory STIX SDO/SRO(s) via search filters\n",
"* **load_from_file()** - load STIX content into memory from file\n",
" \n",
"### MemorySink (snapshot)\n",
"* **add()** - add a set of STIX SDO/SRO(s) to memory\n",
"* **save_to_file()** - save STIX content that is in memory to file\n",
" \n",
"### MemoryStore (snapshot)\n",
"\n",
"(super set of the MemorySource and MemorySink)\n",
"* **get()**\n",
"* **all_versions()**\n",
"* **query()**\n",
"* **load_from_file()**\n",
"* **save_to_file()**\n",
"* **add()**\n",
"\n",
"A note on **load_from_file()** and **save()**. These methods both add STIX content to an internal dictionary (maintained by MemoryStore). STIX content that is to be added can be in the following forms: python STIX objects, python dicts (of valid STIX objects or Bundles), json-encoded strings (of valid STIX objects or Bundles), or a (python)list of any of the previously listed types. **MemoryStore** actually stores STIX content either as python STIX objects or as python dictionaries, reducing and converting any of the aforementioned types to one of those; and whatever form the STIX object is stored as , is what it will be returned as when queried or retrieved. Python STIX objects, and json-encoded strings (of STIX content) are stored as python STIX objects. Python dicts (of STIX objects) are stored as python dictionaries. This is done, as can be efficiently supported, in order to return STIX content in the form it was added to the **MemoryStore**. Also, for **load_from_file()**, STIX content is assumed to be in json form within the file, individually or in a Bundle. \n",
"\n",
"A note on **save_to_file()**. This method dumps all STIX content that is in MemoryStore to the specified file. The file format will be json, and the STIX content will be within a STIX Bundle. ntoe, the the output form will be a json STIX Bundle regardless of the form that the individual STIX objects are stored(i.e. supplied) to the MemoryStore. \n",