# 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": {}
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.llongterm.com/docs/javascript/mind.remember.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
