Research reference code
The paper implementation, evaluation entry points, figures, and reproduction guidance for studying AMA.
AMA coordinates four specialized agents to construct, retrieve, verify, and refresh long-term memory—aligning the granularity of evidence with the reasoning task at hand.
The paper implementation, evaluation entry points, figures, and reproduction guidance for studying AMA.
A portable AMA memory skill for agent-harness architectures, plus an OpenClaw adapter as a runnable reference integration.
Fine details, stable facts, and high-level episodes demand different representations. As user information changes, a useful system must detect conflicts and repair stale knowledge—not merely append more context.
Rewrites ambiguous queries and routes each intent to raw text, fact knowledge, or episode memory.
Audits relevance and consistency, triggering bounded retrieval feedback when evidence is insufficient.
Resolves logical conflicts through targeted updates or deletions, preserving knowledge over time.
Transforms validated dialogue into traceable raw turns, atomic facts, and event-level episodes.
The Constructor preserves exact turns as raw text, distills reusable facts, and synthesizes cross-turn episodes. Episodes are created when the topic shifts, the user explicitly asks to consolidate, or context becomes saturated.
AMA stores dialogue at multiple levels and selects a representation according to current reasoning intent.
Overall LLM score, compared with 0.740 for the strongest listed memory baseline.
Average accuracy across six question types, compared with 0.642 for Nemori.
Accuracy on questions that require the system to follow evolving user information.
Input tokens versus 18,625 for FullContext in the efficiency analysis.
*3,613 tokens is approximately 19% of the 18,625-token FullContext input reported in the paper.
AMA is evaluated on LoCoMo (1,540 questions over long multi-session conversations) and LongMemEvals (500 questions with approximately 115K-token histories). Temperature is 0, retrieval uses top-k 10, and AMA defaults to at most two retrieval rounds.
| Method | GPT-4o-mini | GPT-4.1-mini | Qwen3-30B | Qwen3-8B |
|---|---|---|---|---|
| FullContext | 0.717 | 0.786 | 0.733 | 0.696 |
| RAG | 0.300 | 0.321 | 0.307 | 0.298 |
| LangMem | 0.515 | 0.717 | 0.525 | 0.512 |
| MemGPT | 0.415 | 0.425 | — | — |
| Zep | 0.580 | 0.601 | — | — |
| A-Mem | 0.476 | 0.487 | 0.476 | 0.464 |
| Mem0 | 0.608 | 0.647 | — | — |
| Nemori | 0.740 | 0.774 | 0.756 | 0.686 |
| AMA | 0.774 | 0.805 | 0.791 | 0.707 |
Dashes indicate evaluations omitted for commercial systems under open-source backbones, following the paper's experimental protocol.
| Question type | Full-ctx | RAG | LangMem | A-Mem | MemGPT | Mem0 | Zep | Nemori | AMA |
|---|---|---|---|---|---|---|---|---|---|
| Single-session preference | 0.300 | 0.333 | 0.267 | 0.367 | 0.200 | 0.333 | 0.533 | 0.467 | 0.467 |
| Single-session assistant | 0.818 | 0.714 | 0.777 | 0.804 | 0.857 | 0.875 | 0.750 | 0.839 | 0.964 |
| Temporal reasoning | 0.365 | 0.280 | 0.353 | 0.398 | 0.451 | 0.399 | 0.541 | 0.617 | 0.444 |
| Multi-session | 0.406 | 0.254 | 0.424 | 0.451 | 0.549 | 0.481 | 0.474 | 0.511 | 0.624 |
| Knowledge update | 0.769 | 0.385 | 0.578 | 0.602 | 0.410 | 0.654 | 0.744 | 0.615 | 0.897 |
| Single-session user | 0.814 | 0.686 | 0.750 | 0.750 | 0.814 | 0.857 | 0.929 | 0.886 | 0.986 |
| Average | 0.548 | 0.374 | 0.528 | 0.538 | 0.554 | 0.574 | 0.632 | 0.642 | 0.698 |
Cross-backbone consistency. AMA achieves the highest overall LoCoMo LLM Score with all four tested backbones, from Qwen3-8B-Instruct to GPT-4.1-mini.
Long-term updates. On LongMemEvals, AMA leads the average and reaches 0.897 on knowledge-update questions and 0.986 on user-specific recall.
Transparent limitations. Nemori remains stronger on temporal reasoning and Zep on single-session preferences, leaving clear room for future work.
Most of the performance gain arrives in the first few retrieval rounds and then saturates, while token use and latency continue to grow approximately linearly. AMA therefore uses Kr = 2 as its default balance.



| Method | Tokens | Latency | Score |
|---|---|---|---|
| FullContext | 18,625 | 7.206 s | 0.717 |
| RAG | 5,800 | 2.983 s | 0.300 |
| Nemori | 2,925 | 3.152 s | 0.740 |
| AMA (Kr=1) | 2,491 | 3.124 s | 0.723 |
| AMA (Kr=2) | 3,613 | 3.910 s | 0.774 |
| Memory setting | LoCoMo | Knowledge update |
|---|---|---|
| Raw text only | 0.669 | 0.767 |
| Fact knowledge only | 0.712 | 0.804 |
| Episode memory only | 0.688 | 0.748 |
| All granularities, no Refresher | 0.771 | 0.568 |
| Full AMA | 0.774 | 0.897 |
Multi-granular memory gives broad coverage; the Refresher is especially important when user information changes.
Conflict-aware refresh. When device information changes, the Retriever recalls the earlier fact, the Judge identifies the conflict, and the Refresher updates the stale memory instead of keeping contradictory records.
Intent-aware granularity. A factual query routes to Fact Knowledge; an abstract summary query retrieves Episode Memory.
The repository translates AMA into a reusable SKILL.md for agent-harness architectures. It specifies when an agent should retrieve, capture, refresh, summarize, inspect, or forget memory while preserving the framework's three complementary granularities.
Runtime integration: the skill is harness-oriented and portable; the bundled OpenClaw plugin is a runnable reference adapter that contributes automatic recall/capture hooks, six explicit tools, and a local SQLite/FAISS sidecar.
$ git clone https://github.com/Sherlockwz/AMA.git
$ cd AMA && ./scripts/setup.sh
$ openclaw plugins install --link .
$ openclaw ama doctor
ama_retrievesemantic recallama_process_turnmemory lifecycleama_process_assistantresponse captureama_memory_listmemory statisticsama_session_endepisode synthesisama_memory_forgetuser-controlled deletionWeiquan Huang, Zixuan Wang, Hehai Lin, Sudong Wang, Bo Xu, Qian Li, Beier Zhu, Linyi Yang, and Chengwei Qin. 2026.
AMA: Adaptive Memory via Multi-Agent Collaboration.
Findings of the Association for Computational Linguistics: ACL 2026, pages 3099–3120.
@inproceedings{huang-etal-2026-ama,
title = {{AMA}: Adaptive Memory via Multi-Agent Collaboration},
author = {Huang, Weiquan and Wang, Zixuan and Lin, Hehai and
Wang, Sudong and Xu, Bo and Li, Qian and Zhu, Beier and
Yang, Linyi and Qin, Chengwei},
booktitle = {Findings of the Association for Computational Linguistics: ACL 2026},
year = {2026},
pages = {3099--3120},
doi = {10.18653/v1/2026.findings-acl.152}
}