A novel agentic memory system for LLM agents that can dynamically organize memories in an agentic way.
Note: This repository is specifically designed to reproduce the results presented in our paper. If you want to use the A-MEM system in building your agents, please refer to our official implementation at: https://github.com/agiresearch/A-mem
Large Language Model (LLM) agents have demonstrated remarkable capabilities in handling complex real-world tasks through external tool usage. However, to effectively leverage historical experiences, they require sophisticated memory systems. Traditional memory systems, while providing basic storage and retrieval functionality, often lack advanced memory organization capabilities.
Our project introduces an innovative Agentic Memory system that revolutionizes how LLM agents manage and utilize their memories:


Comparison between traditional memory system (top) and our proposed agentic memory (bottom). Our system enables dynamic memory operations and flexible agent-memory interactions.
For more details, please refer to our paper: A-MEM: Agentic Memory for LLM Agents
- 🔄 Dynamic memory organization based on Zettelkasten principles
- 🔍 Intelligent indexing and linking of memories
- 📝 Comprehensive note generation with structured attributes
- 🌐 Interconnected knowledge networks
- 🔄 Continuous memory evolution and refinement
- 🤖 Agent-driven decision making for adaptive memory management

The framework of our Agentic Memory system showing the dynamic interaction between LLM agents and memory components.
When a new memory is added to the system:
- Generates comprehensive notes with structured attributes
- Creates contextual descriptions and tags
- Analyzes historical memories for relevant connections
- Establishes meaningful links based on similarities
- Enables dynamic memory evolution and updates
Empirical experiments conducted on six foundation models demonstrate superior performance compared to existing SOTA baselines.
- Clone the repository:
git clone https://github.com/WujiangXu/AgenticMemory.git
cd AgenticMemory
- Install dependencies: Option 1: Using venv (Python virtual environment)
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
Option 2: Using Conda
# Create and activate conda environment
conda create -n myenv python=3.9
conda activate myenv
# Install dependencies
pip install -r requirements.txt
- Run the experiments in LoCoMo dataset:
python test_advanced.py
If you use this code in your research, please cite our work:
@article{xu2025mem,
title={A-mem: Agentic memory for llm agents},
author={Xu, Wujiang and Liang, Zujie and Mei, Kai and Gao, Hang and Tan, Juntao and Zhang, Yongfeng},
journal={arXiv preprint arXiv:2502.12110},
year={2025}
}
This project is licensed under the MIT License. See LICENSE for details.