> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.toolkits.memory toolkit

<a id="camel.toolkits.memory_toolkit" />

<a id="camel.toolkits.memory_toolkit.MemoryToolkit" />

## MemoryToolkit

```python theme={"system"}
class MemoryToolkit(BaseToolkit):
```

A toolkit that provides methods for saving, loading, and clearing a
ChatAgent's memory.
These methods are exposed as FunctionTool objects for
function calling. Internally, it calls:

* agent.save\_memory(path)
* agent.load\_memory(new\_memory\_obj)
* agent.load\_memory\_from\_path(path)
* agent.clear\_memory()

**Parameters:**

* **agent** (ChatAgent): The chat agent whose memory will be managed.
* **timeout** (Optional\[float], optional): Maximum execution time allowed for toolkit operations in seconds. If None, no timeout is applied. (default: :obj:`None`)

<a id="camel.toolkits.memory_toolkit.MemoryToolkit.__init__" />

### **init**

```python theme={"system"}
def __init__(self, agent: 'ChatAgent', timeout: Optional[float] = None):
```

<a id="camel.toolkits.memory_toolkit.MemoryToolkit.save" />

### save

```python theme={"system"}
def save(self, path: str):
```

Saves the agent's current memory to a JSON file.

**Parameters:**

* **path** (str): The file path to save the memory to.

**Returns:**

str: Confirmation message.

<a id="camel.toolkits.memory_toolkit.MemoryToolkit.load" />

### load

```python theme={"system"}
def load(self, memory_json: str):
```

Loads memory into the agent from a JSON string.

**Parameters:**

* **memory\_json** (str): A JSON string containing memory records.

**Returns:**

str: Confirmation or error message.

<a id="camel.toolkits.memory_toolkit.MemoryToolkit.load_from_path" />

### load\_from\_path

```python theme={"system"}
def load_from_path(self, path: str):
```

Loads the agent's memory from a JSON file.

**Parameters:**

* **path** (str): The file path to load the memory from.

**Returns:**

str: Confirmation message.

<a id="camel.toolkits.memory_toolkit.MemoryToolkit.clear_memory" />

### clear\_memory

```python theme={"system"}
def clear_memory(self):
```

**Returns:**

str: Confirmation message.

<a id="camel.toolkits.memory_toolkit.MemoryToolkit.get_tools" />

### get\_tools

```python theme={"system"}
def get_tools(self):
```

**Returns:**

list\[FunctionTool]: List of FunctionTool objects.
