# mind.remember

To store information in the mind, use the `remember` method. This allows the Mind to persist knowledge and generate a system message that can be passed to the LLM.

```javascript
const response = await mind.remember([
  {
    "author": "user",
    "message": "I want to learn Python and JavaScript"
  },
  {
    "author": "assistant",
    "message": "I understand you want to learn more programming languages"
  }
]);
```

#### **Arguments**

| Parameter | Type                                     | Description                                                                                                                       |
| --------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| messages  | Array<{author: string, message: string}> | Array of message objects containing the conversation history to remember. Each message must have an `author` and `message` field. |

#### **Response**

| Property      | Type   | Description                                                                                |
| ------------- | ------ | ------------------------------------------------------------------------------------------ |
| metadata      | object | Configuration and identifying information about a mind (see metadata structure below).     |
| systemMessage | string | A generated message that provides context and relevant knowledge for the mind's responses. |

#### **Metadata Structure**

| Property           | Type      | Description                                                                                                                                 |
| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| relatedKnowledge   | string    | Contains any related knowledge found in the mind's memory.                                                                                  |
| rawMessage         | string    | The original message in JSON format containing author and message.                                                                          |
| messageWithContext | string\[] | Array of messages with additional context added.                                                                                            |
| updateValues       | string\[] | Paths in the mind's memory structure where this information was stored (e.g., "/unstructured", "structured/Coding Languages/unstructured"). |
| changes            | object    | Object containing any changes made to the mind's memory structure.                                                                          |

```javascript
// Example metadata response
{
  "metadata": {
    "relatedKnowledge": "",
    "rawMessage": "{\"author\":\"assistant\",\"message\":\"A function is a block of code designed to perform a particular task. A class is a blueprint for creating objects.\"}",
    "messageWithContext": [
      "A function is a block of code designed to perform a particular task, while a class is a blueprint for creating objects."
    ],
    "updateValues": [
      "/unstructured",
      "structured/Coding Languages/unstructured"
    ],
    "changes": {}
  }
}
```
