WujiangXu/A-mem
The code for NeurIPS 2025 paper "A-Mem: Agentic Memory for LLM Agents"
A‑Mem: Agentic Memory for LLM Agents
What it is – A research implementation of Agentic Memory, a system that lets large‑language‑model (LLM) agents organise their past “memories” dynamically, inspired by the Zettelkasten note‑taking method. The code reproduces the experiments from the paper A‑Mem: Agentic Memory for LLM Agents (NeurIPS 2025).
Key ideas
- When a new piece of information (a memory) is added, the system automatically creates a structured note, tags it, and searches existing memories for related content.
- It then creates explicit links between related memories, forming a graph‑like knowledge network that can evolve as the agent interacts with new data.
- The agent can query this network, retrieve the most relevant memories, and even decide to reorganise or refine them based on the task at hand.
Main features
- Dynamic organisation – memories are linked and re‑indexed on the fly rather than stored in a static vector store.
- Zettelkasten‑style notes – each memory gets a rich, attribute‑filled note (title, description, tags, etc.).
- Agent‑driven management – the LLM itself decides how many memories to retrieve (
k), when to create new links, and how to update existing ones. - Backend‑agnostic evaluation – scripts work with OpenAI’s API, vLLM‑served open‑source models, or Ollama, so you can test the method on any LLM.
- Reproducible experiments – the repository includes the LoCoMo benchmark suite and a k‑sweep script to find the best retrieval size per model.
How to get started
- Clone the repo and create a Python environment (venv or Conda).
- Install the required packages with
pip install -r requirements.txt. - Run the provided evaluation scripts on the LoCoMo dataset:
python test_advanced.py– original evaluation (needs OpenAI JSON‑schema support).python test_advanced_robust.py …– robust version that works with OpenAI, vLLM, or Ollama back‑ends. Example for GPT‑4o‑mini:
python test_advanced_robust.py --backend openai --model gpt-4o-mini \ --dataset data/locomo10.json --output results.json - Use
bash run_k_sweep.shto automatically sweep the retrieval‑size (k) hyper‑parameter for each model.
Typical workflow
- Add a memory – the system generates a note, tags it, and searches existing notes for similarity.
- Link creation – if related notes are found, the system adds bidirectional links, enriching the knowledge graph.
- Query – the LLM agent asks a question; the memory system retrieves the top‑
klinked notes, which are then fed back to the agent for answer generation.
Intended audience
- Researchers exploring memory architectures for LLM‑based agents.
- Developers who want a reproducible baseline for dynamic, graph‑based memory in their own agents.
- Anyone interested in comparing traditional vector‑store memories with a more structured, link‑driven approach.
Citation
@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 – MIT.
This summary is based solely on the repository’s README; no external information has been added.
Related
- Project
- Project
- Project
- Project