SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.12110 · NeurIPS · 2025

A-Mem: Agentic Memory for LLM Agents

Hang Gao, Yongfeng Zhang, Kai Mei, Juntao Tan, Wujiang Xu, Zujie Liang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2502.12110.json · badge: /api/ran/2502.12110.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
wujiangxu/agenticmemory canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
agiresearch/a-mem canonical (classifier label)
classifier basis not recorded on the link
0 ran · 1 no recorded run
FunctionStatusWhere it lives
calculate_rouge_scores Ran
ran on a synthesized input
wujiangxu/agenticmemory/utils.py
code served (permissive licence) · get_code("324c4d669513e950")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from rouge_score import rouge_scorer

# The function takes two string parameters: prediction and reference
# These are natural language text strings that will be scored against each other

prediction_text = "The quick brown fox jumps over the lazy dog"
reference_text = "A fast brown fox leaps over a lazy dog"

ARGS = {
    'prediction': prediction_text,
    'reference': reference_text,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
rouge_score — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_locomo_dataset Ran
ran; our contract draft was wrong, not the code
wujiangxu/agenticmemory/load_dataset.py
code served (permissive licence) · get_code("5c12c257ad6b32ca")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
from pathlib import Path

# Create a temporary JSON file with valid LoComo dataset structure
temp_data = [
    {
        "qa": [
            {
                "question": "What is the main topic?",
                "answer": "The main topic is about conversation analysis.",
                "evidence": ["session_0:turn_1"],
                "category": 1,
                "adversarial_answer": None
            },
            {
                "question": "What happened in the session?",
                "answer": "A discussion took place.",
                "evidence": ["session_0:turn_2"],
                "category": 5,
                "adversarial_answer": "An adversarial answer"
            }
        ],
        "conversation": {
            "speaker_a": "Alice",
            "speaker_b": "Bob",
            "session_0": [
                {
                    "speaker": "Alice",
                    "dia_id": "session_0_turn_1",
                    "text": "Hello, how are you?",
                    "img_url": None,
                    "blip_caption": None
                },
                {
                    "speaker": "Bob",
                    "dia_id": "session_0_turn_2",
                    "text": "I'm doing well.",
                    "img_url": "http://example.com/image.jpg",
                    "blip_caption": "A person standing"
                }
            ],
            "session_0_date_time": "2023-01-01T10:00:00"
        },
        "event_summary": {
            "events": {
                "greeting": {
                    "speakers": ["Alice"],
                    "timestamps": ["10:00"]
                }
            }
        },
        "observation": {
            "observations": {
                "mood": {
                    "Alice": [["happy", "engaged"]],
                    "Bob": [["neutral", "responsive"]]
                }
            }
        },
        "session_summary": {
            "session_0": "A brief conversation between Alice and Bob"
        }
    },
    {
        "qa": [
            {
                "question": "Second sample question?",
                "answer": "Second sample answer.",
                "evidence": ["session_1:turn_3"],
                "category": 2,
                "adversarial_answer": None
            }
        ],
        "conversation": {
            "speaker_a": "Charlie",
            "speaker_b": "Diana",
            "session_1": [
                {
                    "speaker": "Charlie",
                    "dia_id": "session_1_turn_3",
                    "text": "Good morning!",
                    "img_url": None,
                    "blip_caption": None
                }
            ],
            "session_1_date_time": "2023-01-02T09:00:00"
        },
        "event_summary": {
            "events": {
                "greeting": {
                    "speakers": ["Charlie"],
                    "timestamps": ["09:00"]
                }
            }
        },
        "observation": {
            "observations": {
                "mood": {
                    "Charlie": [["cheerful"]],
                    "Diana": [["attentive"]]
                }
            }
        },
        "session_summary": {
            "session_1": "Morning greeting between Charlie and Diana"
        }
    }
]

# Write temporary JSON file
with tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False, encoding='utf-8') as f:
    json.dump(temp_data, f)
    temp_file_path = f.name

ARGS = {
    "file_path": temp_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_conversation Ran
ran; our contract draft was wrong, not the code
wujiangxu/agenticmemory/load_dataset.py
code served (permissive licence) · get_code("4a1510da2b417c43")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Conversation. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from typing import Dict, List

# Construct a valid conv_data dictionary for parse_conversation
conv_data = {
    'speaker_a': 'Alice',
    'speaker_b': 'Bob',
    'session_0': [
        {
            'speaker': 'Alice',
            'dia_id': 'turn_1',
            'text': 'Hello, how are you?',
        },
        {
            'speaker': 'Bob',
            'dia_id': 'turn_2',
            'text': 'I am doing well.',
            'img_url': 'https://example.com/image1.jpg',
            'blip_caption': 'A cat sitting on a couch',
        },
    ],
    'session_0_date_time': '2024-01-15 10:30:00',
    'session_1': [
        {
            'speaker': 'Alice',
            'dia_id': 'turn_3',
            'text': 'That sounds great!',
            'img_url': 'https://example.com/image2.jpg',
            'blip_caption': 'A sunny day at the beach',
        },
        {
            'speaker': 'Bob',
            'dia_id': 'turn_4',
            'text': '',
        },
    ],
    'session_1_date_time': '2024-01-15 11:45:00',
    'session_2': [],
    'session_2_date_time': '2024-01-15 12:00:00',
}

ARGS = {
    'conv_data': conv_data,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conversation — a Conversation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conversation output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_session Ran
ran; our contract draft was wrong, not the code
wujiangxu/agenticmemory/load_dataset.py
code served (permissive licence) · get_code("3701fefb10719e87")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Session. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from typing import Dict, List, Optional, Union
from dataclasses import dataclass

@dataclass
class Turn:
    speaker: str
    dia_id: str
    text: str

@dataclass
class Session:
    session_id: int
    date_time: str
    turns: List[Turn]

def parse_session(session_data: List[dict], session_id: int, date_time: str) -> Session:
    """Parse a single session's data, including turns with images by using their captions."""
    turns = []
    for turn in session_data:
        text = turn.get('text', '')
        if 'img_url' in turn and 'blip_caption' in turn:
            caption_text = f"[Image: {turn['blip_caption']}]"
            if text:
                text = f'{caption_text} {text}'
            else:
                text = caption_text
        turns.append(Turn(speaker=turn['speaker'], dia_id=turn['dia_id'], text=text))
    return Session(session_id=session_id, date_time=date_time, turns=turns)


# Setup code to construct valid arguments
session_data = [
    {
        'speaker': 'user',
        'dia_id': 'turn_001',
        'text': 'Hello, how are you?'
    },
    {
        'speaker': 'assistant',
        'dia_id': 'turn_002',
        'text': 'I am doing well.',
        'img_url': 'https://example.com/image.jpg',
        'blip_caption': 'A cat sitting on a table'
    },
    {
        'speaker': 'user',
        'dia_id': 'turn_003',
        'img_url': 'https://example.com/image2.jpg',
        'blip_caption': 'A dog running in the park'
    }
]

ARGS = {
    'session_data': session_data,
    'session_id': 42,
    'date_time': '2024-01-15 10:30:00'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Session — a Session output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Session output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_with_json_fallback Ran
ran; our contract draft was wrong, not the code
wujiangxu/agenticmemory/llm_text_parsers.py
code served (permissive licence) · get_code("24e35e9dadb2fe27")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import re
from typing import Dict, List, Any, Optional, Callable

def strip_markdown_fences(text: str) -> str:
    """Remove ```json ... ``` or ``` ... ``` fences from LLM output."""
    text = text.strip()
    text = re.sub('^```(?:json)?\\s*\\n?', '', text, flags=re.MULTILINE)
    text = re.sub('\\n?\\s*```$', '', text, flags=re.MULTILINE)
    return text.strip()

def parse_with_json_fallback(response: str, plain_text_parser: Callable, *parser_args) -> Any:
    """Try JSON parsing first; fall back to section-marker parsing.

    Many models emit valid JSON even without strict mode, so we try that first
    for best-of-both-worlds compatibility.
    """
    try:
        cleaned = strip_markdown_fences(response)
        result = json.loads(cleaned)
        if isinstance(result, dict):
            return result
    except (json.JSONDecodeError, ValueError):
        pass
    return plain_text_parser(response, *parser_args)


def mock_plain_text_parser(response: str, *args) -> Dict[str, Any]:
    """Simple fallback parser that extracts key-value pairs from plain text."""
    result = {}
    lines = response.split('\n')
    for line in lines:
        if ':' in line:
            key, value = line.split(':', 1)
            result[key.strip()] = value.strip()
    return result


ARGS = {
    'response': '```json\n{"key1": "value1", "key2": 42}\n```',
    'plain_text_parser': mock_plain_text_parser,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
retry_llm_call Ran
ran; our contract draft was wrong, not the code
wujiangxu/agenticmemory/memory_layer_robust.py
code served (permissive licence) · get_code("ddc19d511f03d63d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging
import functools
import time

# Set up logging to avoid issues
logging.basicConfig(level=logging.WARNING)

# Define a simple test function that we'll decorate
def simple_llm_function(query: str):
    """A simple function that simulates an LLM call."""
    return f"Response to: {query}"

# Create a function that sometimes fails (for testing retry logic)
call_count = 0

@functools.wraps(simple_llm_function)
def flaky_llm_function(query: str):
    """A function that fails on first attempt, then succeeds."""
    global call_count
    call_count += 1
    if call_count < 2:
        raise RuntimeError("Simulated LLM failure")
    return f"Response to: {query}"

# Define ARGS mapping all parameters of retry_llm_call
ARGS = {
    "max_retries": 2,
    "base_delay": 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
strip_markdown_fences Ran
ran; our contract draft was wrong, not the code
wujiangxu/agenticmemory/llm_text_parsers.py
code served (permissive licence) · get_code("21854723dac05890")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def strip_markdown_fences(text: str) -> str:
    """Remove ```json ... ``` or ``` ... ``` fences from LLM output."""
    text = text.strip()
    text = re.sub('^```(?:json)?\\s*\\n?', '', text, flags=re.MULTILINE)
    text = re.sub('\\n?\\s*```$', '', text, flags=re.MULTILINE)
    return text.strip()

# Setup test arguments
ARGS = {
    "text": "```json\n{\"key\": \"value\"}\n```"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_bleu_scores Not yet run
unverified (harvested, no recorded run)
wujiangxu/agenticmemory/utils.py
code served (permissive licence) · get_code("ccb432656283341e")
How it ran

no invocation recorded.

parse_analyze_content Not yet run
unverified (harvested, no recorded run)
wujiangxu/agenticmemory/llm_text_parsers.py
code served (permissive licence) · get_code("901a2bbc34750c4e")
How it ran

no invocation recorded.

simple_tokenize Not yet run
unverified (harvested, no recorded run)
agiresearch/a-mem/agentic_memory/retrievers.py
code served (permissive licence) · get_code("ef1bb1531a00b95c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 7 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 7 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
load_locomo_dataset 2 other papers
2 later
2604.18349 (2026-04)
HiGMem: A Hierarchical and LLM-Guided Memory System for Long-Term Conversational Agents
2606.07402 (2026-06)
M 3 Exam: Benchmarking Multimodal Memory for Realistic User-Agent Interactions
parse_analyze_content 2 other papers
2 later
2606.07402 (2026-06)
M 3 Exam: Benchmarking Multimodal Memory for Realistic User-Agent Interactions
2607.00339 (2026-07)
TRACE: State-Aware Query Processing over Temporal Evidence Graphs for Conversational Data
parse_conversation 2 other papers
2 later
2604.18349 (2026-04)
HiGMem: A Hierarchical and LLM-Guided Memory System for Long-Term Conversational Agents
2606.07402 (2026-06)
M 3 Exam: Benchmarking Multimodal Memory for Realistic User-Agent Interactions
parse_session 2 other papers
2 later
2604.18349 (2026-04)
HiGMem: A Hierarchical and LLM-Guided Memory System for Long-Term Conversational Agents
2606.07402 (2026-06)
M 3 Exam: Benchmarking Multimodal Memory for Realistic User-Agent Interactions
strip_markdown_fences 2 other papers
2 later
2606.07402 (2026-06)
M 3 Exam: Benchmarking Multimodal Memory for Realistic User-Agent Interactions
2607.00339 (2026-07)
TRACE: State-Aware Query Processing over Temporal Evidence Graphs for Conversational Data
parse_with_json_fallback 1 other paper
1 later
2606.07402 (2026-06)
M 3 Exam: Benchmarking Multimodal Memory for Realistic User-Agent Interactions
retry_llm_call 1 other paper
1 later
2606.07402 (2026-06)
M 3 Exam: Benchmarking Multimodal Memory for Realistic User-Agent Interactions

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

While large language model (LLM) agents can effectively use external tools for complex real-world tasks, they require memory systems to leverage historical experiences. Current memory systems enable basic storage and retrieval but lack sophisticated memory organization, despite recent attempts to incorporate graph databases. Moreover, these systems' fixed operations and structures limit their adaptability across diverse tasks. To address this limitation, this paper proposes a novel agentic memory system for LLM agents that can dynamically organize memories in an agentic way. Following the basic principles of the Zettelkasten method, we designed our memory system to create interconnected knowledge networks through dynamic indexing and linking. When a new memory is added, we generate a comprehensive note containing multiple structured attributes, including contextual descriptions, keywords, and tags. The system then analyzes historical memories to identify relevant connections, establishing links where meaningful similarities exist. Additionally, this process enables memory evolution -as new memories are integrated, they can trigger updates to the contextual representations and attributes of existing historical memories, allowing the memory network to continuously refine its understanding. Our approach combines the structured organization principles of Zettelkasten with the flexibility of agent-driven decision making, allowing for more adaptive and context-aware memory management. Empirical experiments on six foundation models show superior improvement against existing SOTA baselines.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2502.12110")
get_code_for_paper("2502.12110")
have("2502.12110")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2502.12110.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2502.12110.svg)](https://syntology.ai/paper/2502.12110)

Connect an agent — have() is free.