Skip to content
/ A-mem Public
forked from WujiangXu/A-mem

Adjusted code for the NeurIPS 2025 paper “A-MEM: Agentic Memory for LLM Agents,” adding degree-centrality to the hybrid (BM25 + embeddings) retriever for performance-sensitive, graph-aware ranking.

License

Notifications You must be signed in to change notification settings

Hayo87/A-mem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic Memory 🧠

A novel agentic memory system for LLM agents that can dynamically organize memories in an agentic way.

This fork extends A-MEM by integrating degree centrality into the hybrid retrieval pipeline. We combine BM25, semantic embeddings, and a normalized centrality factor (β-weighted) to prioritize well-connected memory nodes without expensive graph search.

We evaluate the impact of different β values across the original tasks (MultiHop, Temporal, OpenDomain, SingleHop, Adversarial, Ranking) using F1, BLEU, and Length metrics.

This repository builds on the original A-MEM system to reproduce and extend the results presented in the paper: A-MEM: Agentic Memory for LLM Agents

Introduction 🌟

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:

Traditional Memory System Our Proposed Agentic Memory
Comparison between traditional memory system (top) and our proposed agentic memory (bottom). Our system enables dynamic memory operations and flexible agent-memory interactions.

Key Features ✨

  • 🔄 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

Framework 🏗️

Agentic Memory Framework
The framework of our Agentic Memory system showing the dynamic interaction between LLM agents and memory components.

How It Works 🛠️

When a new memory is added to the system:

  1. Generates comprehensive notes with structured attributes
  2. Creates contextual descriptions and tags
  3. Analyzes historical memories for relevant connections
  4. Establishes meaningful links based on similarities
  5. Enables dynamic memory evolution and updates

Results 📊

Empirical experiments conducted on six foundation models demonstrate superior performance compared to existing SOTA baselines.

Getting Started 🚀

  1. Clone the repository:
git clone https://github.com/WujiangXu/AgenticMemory.git
cd AgenticMemory
  1. Install dependencies: Option 1: Using venv (Python virtual environment)
# Create and activate virtual environment
python -m venv a-mem
source a-mem/bin/activate  # Linux/Mac
a-mem\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
  1. Run the experiments in LoCoMo dataset:
python test_advanced.py 

Note: To achieve the optimal performance reported in our paper, please adjust the hyperparameter k value accordingly.

Categories Information: The LoCoMo dataset contains the following categories:

  • Category 1: Multi-hop
  • Category 2: Temporal
  • Category 3: Open-domain
  • Category 4: Single-hop
  • Category 5: Adversarial

For more details about the categories, please refer to this GitHub issue.

Citation 📚

If you use this code in your research, please cite our work:

@inproceedings{xu2025amem,
  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},
  booktitle={Advances in Neural Information Processing Systems},
  year={2025}
}

License 📄

This project is licensed under the MIT License. See LICENSE for details.

About

Adjusted code for the NeurIPS 2025 paper “A-MEM: Agentic Memory for LLM Agents,” adding degree-centrality to the hybrid (BM25 + embeddings) retriever for performance-sensitive, graph-aware ranking.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%