SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.01885 · 2026

Agentic Memory: Learning Unified Long-Term and Short-Term Memory Management for Large Language Model Agents

Yaliang Li, Yi Yu, Liuyi Yao, Yuexiang Xie, Libing Wu, Jiaqi Feng, Qingquan Tan

arXiv · PDF · Open in the Atlas

Code that ran

14 of 24 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, 9 violated it and 0 have no contract verdict; 5 failures of our instrument; 10 no recorded run), measured 2026-11-23; 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/2601.01885.json · badge: /api/ran/2601.01885.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
mem0ai/mem0 community
Papers with Code archive
14 ran · 10 no recorded run
FunctionStatusWhere it lives
_clean_text Ran
ran; our contract draft was wrong, not the code
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("c5e53432d7662f70")
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) 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 _clean_text(txt: str) -> str:
    txt = re.sub('^\\*+\\s*|\\s*\\*+$', '', txt.strip())
    txt = re.sub('\\s*:+$', '', txt)
    txt = re.sub('^\\d+\\s*\\.\\s*', '', txt)
    return ' '.join(txt.split())

ARGS = {
    'txt': '  ***  Hello world  ***  ::: '
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
_has_artifacts Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("94ab7f0b12e44e6d")
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) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 _has_artifacts(txt: str) -> bool:
    """Check for formatting artifacts that indicate non-entity text."""
    return any(['**' in txt or '__' in txt or ':*' in txt, re.search('\\s\\*\\s|\\s\\*$|^\\*\\s', txt), '  ' in txt or '\n' in txt or '\t' in txt, len(txt) > 100, txt.startswith(('•', '-', '+', '–', '—'))])

ARGS = {
    'txt': 'simple entity name'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_has_internal_cap_or_digit Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("f8dd2a53c5047b07")
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) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

# Analyze the function: _has_internal_cap_or_digit(text: str) -> bool
# The function takes a single parameter 'text' of type str
# It checks if the text contains any digits OR any uppercase letters after the first character
# We need to provide a string value for the 'text' parameter

ARGS = {
    "text": "helloWorld123"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_is_bad_single_name_token Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("6ec909eb5afab022")
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) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 unittest.mock import Mock

# Create a mock token object with the required attributes
mock_token = Mock()
mock_token.text = "user"
mock_token.is_stop = False

ARGS = {
    "tok": mock_token
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_is_metric_list_context Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("4463a60a9d03dcdc")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

class Token:
    def __init__(self, text):
        self.text = text

# Create a list of tokens with various text values
tokens = [
    Token('metric'),
    Token(':'),
    Token('value1'),
    Token(','),
    Token('value2'),
    Token(';'),
    Token('end')
]

# Test with idx = 2 (between ':' and ',')
idx = 2

ARGS = {
    'tokens': tokens,
    'idx': idx
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_is_name_like_token Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("4cbf1073b0a023f3")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
from unittest.mock import Mock

# Create a mock token object
class MockToken:
    def __init__(self, text, pos_='NOUN', tag_='NN', is_stop=False, is_sent_start=False, dep_='nsubj'):
        self.text = text
        self.pos_ = pos_
        self.tag_ = tag_
        self.is_stop = is_stop
        self.is_sent_start = is_sent_start
        self.dep_ = dep_

# Test case 1: Simple proper noun token (should return True for PROPN)
tok_propn = MockToken(
    text='Alice',
    pos_='PROPN',
    tag_='NNP',
    is_stop=False,
    is_sent_start=False,
    dep_='nsubj'
)

# Test case 2: Token with internal capital (should return True)
tok_camel = MockToken(
    text='CamelCase',
    pos_='NOUN',
    tag_='NN',
    is_stop=False,
    is_sent_start=False,
    dep_='nsubj'
)

# Create a tokens list for context-dependent checking
tokens_list = [
    MockToken(text='The', pos_='DET', tag_='DT', is_stop=True),
    MockToken(text='Company', pos_='NOUN', tag_='NN', is_stop=False, dep_='nsubj'),
    MockToken(text='makes', pos_='VERB', tag_='VBZ', is_stop=False),
    MockToken(text='software', pos_='NOUN', tag_='NN', is_stop=False, dep_='obj'),
]

ARGS = {
    'tok': tok_propn,
    'tokens': tokens_list,
    'idx': 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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_is_sentence_start Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("5e4f2387f296d35f")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

class MockToken:
    def __init__(self, text, is_sent_start=False):
        self.text = text
        self.is_sent_start = is_sent_start

# Create a list of mock tokens for testing
tokens = [
    MockToken("Hello", is_sent_start=True),
    MockToken("world", is_sent_start=False),
    MockToken(".", is_sent_start=False),
    MockToken("This", is_sent_start=True),
    MockToken("is", is_sent_start=False),
    MockToken("-", is_sent_start=False),
    MockToken("great", is_sent_start=False),
]

# Test with different indices
idx = 2

ARGS = {
    "tokens": tokens,
    "idx": idx
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_looks_like_metric_count_token Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("74939975e0278685")
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) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
from unittest.mock import Mock

# Create a mock token object with the required attributes
tok = Mock()
tok.pos_ = 'NUM'
tok.text = '1,234.56'

ARGS = {
    'tok': tok
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_looks_like_technical_identifier Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("5ab76c035f2e64fc")
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) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 _looks_like_technical_identifier(text: str) -> bool:
    return bool(re.fullmatch('[A-Za-z_][\\w-]*(?:\\.[A-Za-z_][\\w-]*)+', text))

ARGS = {
    "text": "module.submodule.identifier"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_norm_text Ran
ran; our contract draft was wrong, not the code
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("a3008971abfa9122")
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) 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 torch

def _norm_text(txt: str) -> str:
    return ' '.join(txt.lower().split())

ARGS = {
    'txt': '  Hello   WORLD  this  IS   a   TEST  '
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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
_resolve_candidates Ran
ran; our contract draft was wrong, not the code
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("e9de39b62debfc85")
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) and returned list, ndim 2, 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.

from dataclasses import dataclass

@dataclass(frozen=True)
class _EntityCandidate:
    entity_type: str
    text: str
    source: str
    start: int
    end: int
    confidence: float
    priority: int

# Create test candidates with various properties
candidates = [
    _EntityCandidate(
        entity_type="PROPER",
        text="John Smith",
        source="doc1",
        start=0,
        end=10,
        confidence=0.95,
        priority=1
    ),
    _EntityCandidate(
        entity_type="PROPER",
        text="john smith",
        source="doc1",
        start=0,
        end=10,
        confidence=0.90,
        priority=1
    ),
    _EntityCandidate(
        entity_type="TOPIC",
        text="machine learning",
        source="doc1",
        start=15,
        end=31,
        confidence=0.85,
        priority=2
    ),
    _EntityCandidate(
        entity_type="TOPIC",
        text="Machine Learning",
        source="doc1",
        start=15,
        end=31,
        confidence=0.88,
        priority=2
    ),
    _EntityCandidate(
        entity_type="PROPER",
        text="Alice",
        source="doc1",
        start=35,
        end=40,
        confidence=0.92,
        priority=1
    ),
    _EntityCandidate(
        entity_type="TOPIC",
        text="neural networks",
        source="doc1",
        start=50,
        end=65,
        confidence=0.80,
        priority=3
    ),
    _EntityCandidate(
        entity_type="PROPER",
        text="Bob",
        source="doc1",
        start=-1,
        end=-1,
        confidence=0.75,
        priority=1
    ),
]

ARGS = {
    "candidates": candidates
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 2, 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
_spans_overlap Ran
ran, violated the contract we drafted
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("ea972a7e100feeab")
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) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 dataclasses import dataclass

@dataclass(frozen=True)
class _EntityCandidate:
    entity_type: str
    text: str
    source: str
    start: int
    end: int
    confidence: float
    priority: int

# Create two EntityCandidate instances with overlapping spans
candidate_a = _EntityCandidate(
    entity_type="PERSON",
    text="John",
    source="document1",
    start=5,
    end=9,
    confidence=0.95,
    priority=1
)

candidate_b = _EntityCandidate(
    entity_type="PERSON",
    text="John Smith",
    source="document1",
    start=5,
    end=15,
    confidence=0.90,
    priority=2
)

ARGS = {
    "a": candidate_a,
    "b": candidate_b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
_strip_generic_ending Ran
ran; our contract draft was wrong, not the code
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("431642b1fccacd8d")
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) 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 torch
import numpy as np

class MockToken:
    """Mock spaCy token with lemma_ attribute."""
    def __init__(self, text, lemma):
        self.text = text
        self.lemma_ = lemma

# Test case 1: List with generic ending (should strip)
toks_generic = [
    MockToken("some", "some"),
    MockToken("compound", "compound"),
    MockToken("work", "work")
]

# Test case 2: List without generic ending (should not strip)
toks_no_generic = [
    MockToken("some", "some"),
    MockToken("compound", "compound"),
    MockToken("word", "word")
]

# Test case 3: List with only 1 token (should return as-is)
toks_single = [MockToken("work", "work")]

# Test case 4: List with 2 tokens and generic ending (should not strip, needs > 2)
toks_two = [
    MockToken("some", "some"),
    MockToken("work", "work")
]

# Test case 5: List of strings instead of token objects
toks_strings = ["some", "compound", "work"]

ARGS = {
    "toks": toks_generic
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — 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
_strip_trailing_metric_counts Ran
ran; our contract draft was wrong, not the code
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("08193bfb7ac464ed")
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 re

class Token:
    def __init__(self, text, pos_, i):
        self.text = text
        self.pos_ = pos_
        self.i = i

def _is_metric_list_context(tokens: list, idx: int) -> bool:
    prev_text = tokens[idx - 1].text if idx > 0 else ''
    next_text = tokens[idx + 1].text if idx + 1 < len(tokens) else ''
    return prev_text in {':', ',', ';'} or next_text in {',', ';'}

def _looks_like_metric_count_token(tok) -> bool:
    return tok.pos_ == 'NUM' and bool(re.fullmatch('\\d[\\d,]*(?:\\.\\d+)?', tok.text))

def _strip_trailing_metric_counts(span_tokens: list, all_tokens: list) -> list:
    while len(span_tokens) > 1 and _looks_like_metric_count_token(span_tokens[-1]):
        tok = span_tokens[-1]
        if ',' not in tok.text and (not _is_metric_list_context(all_tokens, tok.i)):
            break
        span_tokens = span_tokens[:-1]
    return span_tokens

# Create token objects
# all_tokens represents a full token sequence with indices
all_tokens = [
    Token("metric", "NOUN", 0),
    Token(":", "PUNCT", 1),
    Token("100", "NUM", 2),
    Token(",", "PUNCT", 3),
    Token("200.5", "NUM", 4),
    Token(";", "PUNCT", 5),
    Token("results", "NOUN", 6),
]

# span_tokens is a list of tokens to process
# It contains some numeric tokens that should be stripped if in metric context
span_tokens = [
    Token("metric", "NOUN", 0),
    Token(":", "PUNCT", 1),
    Token("100", "NUM", 2),
    Token(",", "PUNCT", 3),
    Token("200.5", "NUM", 4),
]

ARGS = {
    "span_tokens": span_tokens,
    "all_tokens": all_tokens,
}
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
_EntityCandidate Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("60e944a1cd04f877")
How it ran

no invocation recorded.

_add_candidate Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("5ee1f4818e7f81a5")
How it ran

no invocation recorded.

_add_ner_candidates Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("24e930481bb6698f")
How it ran

no invocation recorded.

_add_proper_name_candidates Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("bc4f7d91fbb29c7f")
How it ran

no invocation recorded.

_add_quoted_candidates Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("c2e1a0f1532866f6")
How it ran

no invocation recorded.

_add_technical_identifier_candidates Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("da514d98bd792e73")
How it ran

no invocation recorded.

_add_topic_phrase_candidates Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("63bbf2b4b4e4e511")
How it ran

no invocation recorded.

_extract_entities_from_doc Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("7d39898fd2610bf2")
How it ran

no invocation recorded.

_is_list_item_name_token Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("a5f6f09c6d78957f")
How it ran

no invocation recorded.

extract_entities Not yet run
unverified (harvested, no recorded run)
mem0ai/mem0/mem0/utils/entity_extraction.py
code served (permissive licence) · get_code("803fac58e74c7e8b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 24 samples lifted from this paper's linked repositories, 24 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 24 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.

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

Large language model (LLM) agents face fundamental limitations in long-horizon reasoning due to finite context windows, making effective memory management critical. Existing methods typically handle long-term memory (LTM) and short-term memory (STM) as separate components, relying on heuristics or auxiliary controllers, which limits adaptability and end-to-end optimization. In this paper, we propose Agentic Memory (AgeMem), a unified framework that integrates LTM and STM management directly into the agent's policy. AgeMem exposes memory operations as tool-based actions, enabling the LLM agent to autonomously decide what and when to store, retrieve, update, summarize, or discard information. To train such unified behaviors, we propose a three-stage progressive reinforcement learning strategy and design a step-wise GRPO to address sparse and discontinuous rewards induced by memory operations. Experiments on five long-horizon benchmarks demonstrate that AgeMem consistently outperforms strong memory-augmented baselines across multiple LLM backbones, achieving improved task performance, higher-quality long-term memory, and more efficient context usage.

For agents

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

get_harvested_code_for_paper("2601.01885")
get_code_for_paper("2601.01885")
have("2601.01885")

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

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

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

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

Connect an agent — have() is free.