SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.20400 · 2026

When Retrieval Fails Before It Begins: Structurally Indirect Prerequisite Eviction as a Retention Failure in Agentic Memory

Minkyu Song

arXiv · PDF · Open in the Atlas

Code that ran

6 of 13 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, 1 violated it and 3 have no contract verdict; 2 failures of our instrument; 7 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/2608.20400.json · badge: /api/ran/2608.20400.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
smkgenesis/dsgc community
Papers with Code archive
6 ran · 7 no recorded run
FunctionStatusWhere it lives
DependencyGraph Ran
ran on a synthesized input
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("b3f8239f3c36bbdb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned NoneType. 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 collections import defaultdict

class DependencyGraph:
    """Edge convention: (i, j) means block i depends on block j."""

    def __init__(self) -> None:
        self._out: dict[str, set[str]] = defaultdict(set)
        self._in: dict[str, set[str]] = defaultdict(set)

    def add_edge(self, dependent: str, prerequisite: str) -> None:
        self._out[dependent].add(prerequisite)
        self._in[prerequisite].add(dependent)

    def n_in(self, block_id: str) -> set[str]:
        return set(self._in.get(block_id, set()))

    def n_out(self, block_id: str) -> set[str]:
        return set(self._out.get(block_id, set()))

    @property
    def num_nodes(self) -> int:
        return len(set(self._in) | set(self._out))


INIT_ARGS = {}

ARGS = {
    "dependent": "block_a",
    "prerequisite": "block_b"
}

METHOD = "add_edge"


if __name__ == "__main__":
    graph = DependencyGraph(**INIT_ARGS)
    graph.add_edge(**ARGS)
    print(f"num_nodes: {graph.num_nodes}")
    print(f"n_in('block_b'): {graph.n_in('block_b')}")
    print(f"n_out('block_a'): {graph.n_out('block_a')}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
FrozenEncoder Ran
ran on a synthesized input
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("40820423c54b4f0a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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.

import hashlib
import math
import re

TOKEN_RE = re.compile('[a-zA-Z0-9_]+')

class FrozenEncoder:
    """Deterministic feature-hashing encoder for reproducible local experiments."""

    def __init__(self, embedding_dim: int=256) -> None:
        self.dim = embedding_dim

    def _tokenize(self, text: str) -> list[str]:
        return TOKEN_RE.findall(text.lower())

    def encode(self, text: str) -> tuple[float, ...]:
        vec = [0.0] * self.dim
        for token in self._tokenize(text):
            digest = hashlib.sha256(token.encode('utf-8')).digest()
            bucket = int.from_bytes(digest[:4], 'big') % self.dim
            sign = 1.0 if digest[4] % 2 == 0 else -1.0
            vec[bucket] += sign
        norm = math.sqrt(sum((v * v for v in vec)))
        if norm == 0.0:
            return tuple(vec)
        return tuple((v / norm for v in vec))

    def encode_batch(self, texts: list[str]) -> list[tuple[float, ...]]:
        return [self.encode(text) for text in texts]


INIT_ARGS = {
    'embedding_dim': 64
}

ARGS = {
    'texts': ['hello world', 'test string']
}

METHOD = 'encode_batch'


if __name__ == '__main__':
    encoder = FrozenEncoder(**INIT_ARGS)
    result = getattr(encoder, METHOD)(**ARGS)
    print(f"Result type: {type(result)}")
    print(f"Result length: {len(result)}")
    print(f"First encoding length: {len(result[0])}")
    print(f"First few values of first encoding: {result[0][:5]}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SentenceEncoder Ran
ran on a synthesized input
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("bc2571798fbe41b1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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.

import numpy as np
import torch

# Mock the sentence_transformers module since we cannot download pretrained models
import sys
from unittest.mock import Mock

# Create a mock SentenceTransformer class
class MockSentenceTransformer:
    def __init__(self, model_name):
        self.model_name = model_name
        self.embedding_dim = 384  # typical dimension for all-MiniLM-L6-v2
        
    def get_sentence_embedding_dimension(self):
        return self.embedding_dim
    
    def encode(self, text, normalize_embeddings=False):
        # Generate deterministic embeddings based on text
        if isinstance(text, str):
            # Single text
            np.random.seed(hash(text) % (2**32))
            vec = np.random.randn(self.embedding_dim).astype(np.float32)
            if normalize_embeddings:
                vec = vec / np.linalg.norm(vec)
            return vec
        else:
            # Batch of texts
            vecs = []
            for t in text:
                np.random.seed(hash(t) % (2**32))
                vec = np.random.randn(self.embedding_dim).astype(np.float32)
                if normalize_embeddings:
                    vec = vec / np.linalg.norm(vec)
                vecs.append(vec)
            return np.array(vecs)

# Mock the sentence_transformers module
mock_st = Mock()
mock_st.SentenceTransformer = MockSentenceTransformer
sys.modules['sentence_transformers'] = mock_st

# Now import and set up the class
class SentenceEncoder:
    """Semantic encoder backed by sentence-transformers (optional dependency)."""
    _cache: dict[str, object] = {}

    def __init__(self, model_name: str='all-MiniLM-L6-v2') -> None:
        try:
            from sentence_transformers import SentenceTransformer
        except ImportError as exc:
            raise ImportError('sentence-transformers is required for SentenceEncoder. Install it with: pip install sentence-transformers') from exc
        if model_name not in SentenceEncoder._cache:
            SentenceEncoder._cache[model_name] = SentenceTransformer(model_name)
        self._model = SentenceEncoder._cache[model_name]
        self.dim: int = self._model.get_sentence_embedding_dimension()

    def encode(self, text: str) -> tuple[float, ...]:
        vec = self._model.encode(text, normalize_embeddings=True)
        return tuple((float(v) for v in vec))

    def encode_batch(self, texts: list[str]) -> list[tuple[float, ...]]:
        vecs = self._model.encode(texts, normalize_embeddings=True)
        return [tuple((float(v) for v in vec)) for vec in vecs]

INIT_ARGS = {
    'model_name': 'all-MiniLM-L6-v2'
}

ARGS = {
    'texts': ['Hello world', 'This is a test sentence']
}

METHOD = 'encode_batch'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, sentence_transformers, torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
dot Ran
ran, violated the contract we drafted
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("b0e689fc61be3b1f")
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 float, 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

torch.manual_seed(0)

# The function dot takes two tuples of floats and computes their dot product
# by zipping them together and summing element-wise products.

# Create two tuples of floats with distinct lengths to make testing unambiguous
a = (1.5, 2.3, 3.7, 4.2)
b = (0.5, 1.1, 2.0, 3.5)

ARGS = {
    'a': a,
    'b': b,
}
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 float, 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
make_encoder Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("547b9712bd0ef152")
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 FrozenEncoder. 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
import hashlib
import math

TOKEN_RE = re.compile('[a-zA-Z0-9_]+')

class FrozenEncoder:
    """Deterministic feature-hashing encoder for reproducible local experiments."""

    def __init__(self, embedding_dim: int=256) -> None:
        self.dim = embedding_dim

    def _tokenize(self, text: str) -> list[str]:
        return TOKEN_RE.findall(text.lower())

    def encode(self, text: str) -> tuple[float, ...]:
        vec = [0.0] * self.dim
        for token in self._tokenize(text):
            digest = hashlib.sha256(token.encode('utf-8')).digest()
            bucket = int.from_bytes(digest[:4], 'big') % self.dim
            sign = 1.0 if digest[4] % 2 == 0 else -1.0
            vec[bucket] += sign
        norm = math.sqrt(sum((v * v for v in vec)))
        if norm == 0.0:
            return tuple(vec)
        return tuple((v / norm for v in vec))

    def encode_batch(self, texts: list[str]) -> list[tuple[float, ...]]:
        return [self.encode(text) for text in texts]

class SentenceEncoder:
    """Semantic encoder backed by sentence-transformers (optional dependency)."""
    _cache: dict[str, object] = {}

    def __init__(self, model_name: str='all-MiniLM-L6-v2') -> None:
        try:
            from sentence_transformers import SentenceTransformer
        except ImportError as exc:
            raise ImportError('sentence-transformers is required for SentenceEncoder. Install it with: pip install sentence-transformers') from exc
        if model_name not in SentenceEncoder._cache:
            SentenceEncoder._cache[model_name] = SentenceTransformer(model_name)
        self._model = SentenceEncoder._cache[model_name]
        self.dim: int = self._model.get_sentence_embedding_dimension()

    def encode(self, text: str) -> tuple[float, ...]:
        vec = self._model.encode(text, normalize_embeddings=True)
        return tuple((float(v) for v in vec))

    def encode_batch(self, texts: list[str]) -> list[tuple[float, ...]]:
        vecs = self._model.encode(texts, normalize_embeddings=True)
        return [tuple((float(v) for v in vec)) for vec in vecs]

def make_encoder(config) -> FrozenEncoder | SentenceEncoder:
    """Return the encoder specified by config.encoder_type.

    Accepts "lexical" (paper terminology) and "frozen" (legacy code alias)
    interchangeably; both route to FrozenEncoder, the L2-normalized
    feature-hashing encoder reported as "Lexical" in the paper.
    """
    if config.encoder_type == 'sentence':
        return SentenceEncoder(config.sentence_model)
    if config.encoder_type in ('lexical', 'frozen'):
        return FrozenEncoder(config.embedding_dim)
    raise ValueError(f'Unknown encoder_type: {config.encoder_type!r}')

class MockConfig:
    def __init__(self, encoder_type: str, embedding_dim: int = 256, sentence_model: str = 'all-MiniLM-L6-v2'):
        self.encoder_type = encoder_type
        self.embedding_dim = embedding_dim
        self.sentence_model = sentence_model

ARGS = {
    'config': MockConfig(encoder_type='frozen', embedding_dim=128)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
sentence_transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FrozenEncoder — a FrozenEncoder output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FrozenEncoder 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
softmax Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("ca9816c0c550df1a")
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 math

def softmax(values: list[float]) -> list[float]:
    if not values:
        return []
    shifted = [v - max(values) for v in values]
    exp_values = [math.exp(v) for v in shifted]
    total = sum(exp_values)
    if total == 0.0:
        return [0.0 for _ in values]
    return [v / total for v in exp_values]

ARGS = {
    "values": [1.0, 2.0, 3.0, 4.0]
}
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 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
BaseMemoryPolicy Not yet run
unverified (harvested, no recorded run)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("2094b5f3b0d327ca")
How it ran

no invocation recorded.

DSGCConfig Not yet run
unverified (harvested, no recorded run)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("41b0f12b6f26f50e")
How it ran

no invocation recorded.

Fact Not yet run
unverified (harvested, no recorded run)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("4ec60cb092eea309")
How it ran

no invocation recorded.

MemoryBlock Not yet run
unverified (harvested, no recorded run)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("6e9bf9ac624a9067")
How it ran

no invocation recorded.

MemoryTier Not yet run
unverified (harvested, no recorded run)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("f05d4440f2c96ee6")
How it ran

no invocation recorded.

Metadata Not yet run
unverified (harvested, no recorded run)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("a0f55068488b949e")
How it ran

no invocation recorded.

MinimalDSGCPolicy Not yet run
unverified (harvested, no recorded run)
smkgenesis/dsgc/src/benchmarking/policy.py
code served (permissive licence) · get_code("efb41616219700b6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 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 13 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

Agentic memory under a fixed budget involves two stages: retention and retrieval. Existing retrieval-centered paradigms implicitly assume necessary evidence survives eviction, but we challenge this by isolating a pre-retrieval failure mode: structurally indirect prerequisite eviction, in which upstream blocks weakly aligned with the query are discarded under budget pressure. We provide an operational definition of this failure, a reproducible deterministic benchmark, and per-seed trace diagnostics. Finally, we evaluate Dependency-aware Semantic Garbage Collection (DSGC), a one-hop graph-aware rule. In our main suite, DSGC improves full-chain retention from 0.03 to 0.90 under a lexical encoder and from 0.23 to 1.00 under a sentence encoder. Robustness checks then identify the budget and scaling regimes where the one-hop rule holds or degrades. Our released pipeline and failure postmortem support mechanistic analysis of retention before retrieval as a distinct failure boundary.

For agents

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

get_harvested_code_for_paper("2608.20400")
get_code_for_paper("2608.20400")
have("2608.20400")

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

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

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

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

Connect an agent — have() is free.