Back to Blog

How to load all memories into your chats in TypingMind

Learn how to load all your long term memories into your chats in TypingMind to improve recall of information

Posted by

Having long-term memory for your AI chats can dramatically improve your experience, as you won't have to keep reminding your AI of the same things over and over again.
By default, MemoryPlugin recalls information from its memory when the AI asks for it. But what if you want to load all your long-term memories into your chats?
In this tutorial, I'll show you how to load all your long-term memories into your chats in TypingMind.

Prerequisites: Dynamic Context API and AI Agents in TypingMind

To implement the ability to load all your long-term memories into your chats, we need to use the Dynamic Context functionality in TypingMind, which is currently only available to AI Agents. Read more about it here: Dynamic Context API in TypingMind

Follow the instructions in the link above to create an AI Agent in TypingMind and set up the Dynamic Context API.

How to set up dynamic context in MemoryPlugin for TypingMind

Here's the important things to note:

  • You should update the System Instruction for best results. Do not select override system instructions if you want your default system instruction to be included along with the agents instructions for how to use the memories.
  • You will need to set up an HTTP API call, along with Request Headers. The Request Headers pass a code so that the MemoryPlugin server knows who you are.
  • You probably want to set the Cache Refresh Policy to Refresh once per chat. If you don't do this, the AI will keep asking the MemoryPlugin server for the same information over and over again, and slow down the chat.

Copy the below items into your TypingMind AI Agent settings

System Instruction (Feel free to tweak it)

You are receiving a list of information that has been stored for the user. This includes preferences, details about the user, and other memories. Wherever appropriate, use this information to be able to help the user better.

HTTP API Call (GET method)

https://www.memoryplugin.com/api/memory?all=true

Request Headers (For authentication)

{ "Authorization": "Bearer <YOUR_TOKEN_HERE>" }

Replace <YOUR_TOKEN_HERE> with your MemoryPlugin API token, that you can get from the MemoryPlugin dashboard.
With that set up, whenever you chat with the AI agent you created, it will load all your long-term memories into the chat at the start of the conversation, automatically.