Improved Long & Short-Term Memory for LlamaIndex Agents
Blog post from LllamaIndex
LlamaIndex has introduced a new Memory component designed to enhance agentic applications by retaining past conversations and user interactions. This component includes basic short-term memory for storing chat history within a token limit, and when that limit is reached, messages can be discarded or moved to long-term memory. Long-term memory is supported by three types of memory blocks: Static Memory Block for non-changing information, Fact Extraction Memory Block for dynamically extracting facts from conversations using a language model, and Vector Memory Block for storing chat history in a vector store to enable context retrieval in future interactions. Users can also create custom memory blocks by extending the BaseMemoryBlock class, allowing for specific functionalities like counting mentions of a name. Future improvements aim to expand database support to NoSQL options and enhance Fact Extraction Memory Block with structured outputs for predefined information fields.