# Memory

Your AI workers can memorize data, behavior, and past outputs using memory. Toolhouse adds memory automatically if your worker needs it to complete their task. You can also add it manually.

## When to use Memory

* If you are building an email marketing worker, you can make it memorize the images it already selected for each email send, so it won't repeat them too often.
* If you are building a customer support worker, you can make it remember past user interaction to keep in mind recurring questions and let you know when a specific problem surfaces often.

## Reading and Writing Memories

Reading and writing memories are two separate operations. Toolhouse adds two separate integrations to your workers, one to read, and one to write. This is done in case you decide to make your agent read-only.

### Reading memories

Usually, your worker will only read the memory relevant to the task at hand. For example, if you're creating an email marketing worker, you may want the worker to remember the entire email messages it sent. Next time you talk to your worker, you may want it to pick a different images.

Internally, the worker will ask itself: "what images did I pick so far?". This question will be forwarded to its memory, which will only reply with a list of images it sent in the past.

This behavior is already preconfigured and you don't need to prompt it yourself.

### Writing memories

The worker will write memories as needed, based on the task. For example, an email marketing worker will always remember the emails it sent. A personal assistant worker, instead, may choose to not write all the memories—for example, it can choose to avoid remembering personal information.

You can change this behavior, edit your agent in [Agent Editor](/toolhouse/toolhouse/agent-editor.md) and tell the editor: "I want my worker to always remember a summary of every conversation we have".

## Adding Memory manually

* Go to [Agents](https://toolhouse.app/agents) in your Toolhouse
* Click on your worker to edit it
* Select <i class="fa-wrench">:wrench:</i> **Integrations,** then click **Add Integration**
* Choose one or more of these:
  * **Semantic Memory Search** to read memories
  * **Memory Store** to write memories
* Click **Save 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.toolhouse.ai/toolhouse/capabilites/memory.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.
