How to add memory to LLM Bot using DynamoDB

Amlan Chakladar
6 min readJul 11, 2024

In the realm of artificial intelligence, the capability to remember past interactions is pivotal for creating personalized and engaging user experiences. For any chatbots, to answer questions effectively and keep up with a conversation, it becomes essential to have its own memory.

There are many solutions available using which memory capability can be added to a chatbot, based on a LLM or anything else. In this post I am explaining one of the methods of providing memory using AWS DynamoDB.

I will walkthrough the steps to provision a DynamoDB table and convert it to a memory store for a LLM chatbot. Here is a little video of me chatting with the chatbot and showing how the DynamoDB stores the chat history at each step.

Pre-Requisites

To be able to follow along and implement this, there are few pre-requisites needed:

  • Python installed
  • AWS account
  • A free Huggingface account
  • An access token created on Huggingface

--

--

Amlan Chakladar

Cloud architect and DevOps engineer. Love to code and develop new stuff. A nerd by nature.