🎥How to Add Memory to the Tess AI Agent Using the Root ID | Example with N8N🗒️

A common challenge when interacting with AI agents is the lack of memory. Imagine sending a message like "2+2" and receiving the response "4." But when you ask "that times 3," the agent doesn't remember the previous message. Get to know the Root ID!

What is the Root ID?
The Root ID is a unique identifier generated for each conversation with the agent. It allows the agent to access the message history and maintain context, creating a more natural and continuous experience for the user. Without the Root ID, each interaction is treated as a new conversation, without memory of previous messages.

How It Works in Practice
When starting a conversation with the agent, Tess AI generates a Chat ID in the URL. This Chat ID is essential to maintain the memory of the conversation. For example, if you ask "How to bake a pie?", the agent will respond and generate a Chat ID. If you continue the conversation by asking "What did I ask you?", the agent will remember the previous question thanks to the Chat ID.

Implementing the Root ID in N8N
To bring memory to your agent via API, you need to retrieve and use the Root ID. Here is a step-by-step guide:

  1. Get the Agent ID
    Access your agent's URL in Tess AI and copy the first number in the URL, which is the agent ID. Replace this ID in the HTTP Request node configuration in n8n.

  2. Generate and Insert the API Token
    In the Tess AI platform, go to "API Tokens" and create a new token. Copy the token and paste it into the HTTP Request node in n8n, including the prefix "Bearer" for authentication.

  3. Send a Message and Retrieve the Root ID
    Set up the HTTP Request node to send a message to the agent, such as "How to make a pie?" After sending the message, the agent will respond, and in the node output, you will find the Root ID. This ID is what you will use to maintain conversation memory.

  4. Use the Root ID in Future Conversations
    Whenever the same user sends a new message, insert the Root ID into the request. This will ensure that the agent accesses the conversation history and responds contextually.

Integration Example
Imagine you are integrating the agent with WhatsApp. You can associate each WhatsApp number with a specific Root ID. This way, whenever the same number sends a message, the agent will remember the previous conversation. This can be done by storing the Root IDs in a database, such as Supabase, BigQuery, or Airtable, and linking them to the WhatsApp numbers.

Final Considerations
The Root ID is a powerful tool for creating smarter and more contextualized AI agents. By implementing it, you ensure that the agent remembers previous interactions, providing a more natural and efficient experience for the user. Whether for mathematical calculations, customer support, or any other application, the agent's memory is essential for quality interaction.

Next Steps
Explore the Tess AI documentation to learn more about using the Root ID and other API features. Additionally, try integrating the Root ID with different platforms, such as WhatsApp, Telegram, or CRM systems, to create even more robust automations.