LightMemory
$git clone https://github.com/zjunlp/lightmemInstalls into the current project.
Install lightmem by running `git clone https://github.com/zjunlp/lightmem`, then use it for the current task and follow its documentation at https://github.com/zjunlp/lightmem.
| 1 | <div align="center"> |
| 2 | <picture> |
| 3 | <source srcset="./figs/lightmem_logo_dark.png" media="(prefers-color-scheme: dark)"> |
| 4 | <img src="./figs/lightmem_logo_light.png" width="60%" height="40%" /> |
| 5 | </picture> |
| 6 | </div> |
| 7 | <h1 align="center"> LightMem: Lightweight and Efficient Memory-Augmented Generation </h1> |
| 8 | |
| 9 | <p align="center"> |
| 10 | <a href="https://arxiv.org/abs/2510.18866"> |
| 11 | <img src="https://img.shields.io/badge/arXiv-Paper-red" alt="arXiv"> |
| 12 | </a> |
| 13 | <a href="https://github.com/zjunlp/LightMem"> |
| 14 | <img src="https://img.shields.io/github/stars/zjunlp/LightMem?style=social" alt="GitHub Stars"> |
| 15 | </a> |
| 16 | <a href="https://github.com/zjunlp/LightMem/blob/main/LICENSE"> |
| 17 | <img src="https://img.shields.io/badge/License-MIT-green.svg" alt="License: MIT"> |
| 18 | </a> |
| 19 | <img src="https://img.shields.io/github/last-commit/zjunlp/LightMem?color=blue" alt="Last Commit"> |
| 20 | <img src="https://img.shields.io/badge/PRs-Welcome-red" alt="PRs Welcome"> |
| 21 | </p> |
| 22 | |
| 23 | <h5 align="center"> ⭐ If you like our project, please give us a star on GitHub for the latest updates!</h5> |
| 24 | |
| 25 | --- |
| 26 | |
| 27 | **LightMem** is a lightweight and efficient memory management framework designed for Large Language Models and AI Agents. It provides a simple yet powerful memory storage, retrieval, and update mechanism to help you quickly build intelligent applications with long-term memory capabilities. |
| 28 | |
| 29 | * 🚀 **Lightweight & Efficient** |
| 30 | <br> Minimalist design with minimal resource consumption and fast response times |
| 31 | |
| 32 | * 🎯 **Easy to Use** |
| 33 | <br> Simple API design - integrate into your application with just a few lines of code |
| 34 | |
| 35 | * 🔌 **Flexible & Extensible** |
| 36 | <br> Modular architecture supporting custom storage engines and retrieval strategies |
| 37 | |
| 38 | * 🌐 **Broad Compatibility** |
| 39 | <br> Support for cloud APIs (OpenAI, DeepSeek) and local models (Ollama, vLLM, etc.) |
| 40 | |
| 41 | <div align=center><img src="./figs/architecture.jpg" width="100%" height="60%" /></div> |
| 42 | |
| 43 | <span id='news'/> |
| 44 | |
| 45 | ## 📢 News |
| 46 | - **[2026-07-13]**: 🎉🎉🎉LightMem has been selected for the CCF ODTC open source incentive program. |
| 47 | - **[2026-04-24]**: 🚀 LightMem now supports the latest [**DeepSeek**](./src/lightmem/configs/memory_manager/base_config.py) models, including `deepseek-v4-flash` and `deepseek-v4-pro`, with `reasoning_effort` and thinking-mode configuration! |
| 48 | - **[2026-04-24]**: 🎉🎉🎉 [**StructMem: Structured Memory for Long-Horizon Behavior in LLMs**](https://arxiv.org/abs/2604.21748) has been accepted by **ACL 2026**! |
| 49 | - **[2026-03-21]**: 🚀 We provide a more comprehensive [baseline evaluation framework](https://github.com/zjunlp/MemBase), supporting the benchmarking of memory layers such as Mem0, A-MEM, EverMemOS, LangMem on multiple datasets like LoCoMo and LongMemEval. |
| 50 | - **[2026-02-15]**: 🚀 **[StructMem](./StructMem.md)** is released: A hierarchical memory framework that preserves event-level memory bindings and cross-event memory connections. |
| 51 | - **[2026-01-26]**: 🎉🎉🎉 [**LightMem: Lightweight and Efficient Memory-Augmented Generation**](https://arxiv.org/abs/2510.18866) has been accepted by **ICLR 2026**! |
| 52 | - **[2026-01-17]**: 🚀 We provide a comprehensive [baseline evaluation framework](https://github.com/zjunlp/LightMem/blob/main/src/lightmem/memory_toolkits/readme.md), supporting the benchmarking of memory layers such as Mem0, A-MEM, and LangMem on multiple datasets like LoCoMo and LongMemEval. |
| 53 | - **[2025-12-09]**: 🎬 Released a **[Demo Video](#demo)** showcasing long-context handling, along with comprehensive **[Tutorial Notebooks](./tutorial-notebooks/)** for various scenarios! |
| 54 | - **[2025-11-30]**: 🚌 LightMem now supports calling multiple tools provided by its [**MCP Server**](https://github.com/zjunlp/LightMem/blob/main/mcp/server.py). |
| 55 | - **[2025-11-26]**: 🚀 Added full **LoCoMo** dataset support, delivering strong [results](https://github.com/zjunlp/LightMem?tab=readme-ov-file#locomo) with leading performance and efficiency! Here is the [**reproduction script**](https://github.com/zjunlp/LightMem/blob/main/experiments/locomo/read |