Systematic Diagnosis and Benchmarking of Memory Systems in Autonomous AI Research Agents: A Low-Resource Framework

A hands-on KDD'26 tutorial — diagnose, benchmark, and improve memory systems for autonomous research agents. Everything runs on a laptop; no GPU required for Phases 1–2.

KDD'26 · Jeju Island, Republic of Korea · August 9–13, 2026

Nur Arifin Akbar1 · Rahool Dembani2 · Gregorius Airlangga3 · Ripto Mukti Wibowo3
Biagio Lenzitti1 · Domenico Tegolo1

1 Universitá degli Studi di Palermo, Italy   2 Singularlogic, Athens, Greece   3 Atma Jaya Catholic University of Indonesia, Jakarta

DOI: 10.1145/3770855.3816477 · ISBN: 979-8-4007-2259-2/2026/08

Tutorial Workflow

┌─────────────────────────────────────────────────────────────────────┐
│                  4-PHASE HANDS-ON TUTORIAL (180 min)                │
├─────────────────────────────────────────────────────────────────────┤
│  Phase 1 (45 min)  30 memory techniques × 6 families (8 books) │
│                    LLM demos (offline fallback)            │
│  Phase 2 (40 min)  Diagnose + benchmark on public data (5 books)    │
│                    3-probe diag · utilization lab · LLM-as-judge    │
│  Phase 3 (35 min)  Real LLM-pretraining sweep on Modal L4 (4 books) │
│                    groups split by depth/batch · memory diagnostic │
│  Phase 4 (50 min)  Cognitive Memory Layer — constraint-aware    │
│                    memory: CML-lite build + diagnose (1 notebook)   │
├─────────────────────────────────────────────────────────────────────┤
│  4 storage providers: verbatim | extracted_facts | episodic | hybrid │
│  + cognitive_constraint (Phase 4) — constraint-aware retrieval   │
│  Honest metrics: util ≠ hit | semantic_pass ≠ hit | 3-arm reader │
└─────────────────────────────────────────────────────────────────────┘

You are here: this is the complete documentation. Follow the sections in the sidebar left-to-right, or jump to any phase.

Quick Start Step-by-step Guide 4-Phase Schedule FAQ

What You'll Learn

  1. The 30 memory techniques across 6 families (short-term, long-term, cognitive, retrieval, frameworks, production) — with hands-on demos using a real LLM.
  2. The 3-probe diagnostic framework — how to measure retrieval relevance, context utilization, and failure root-cause independently (not circularly).
  3. How to benchmark four genuine memory providers (verbatim, extracted facts, episodic, hierarchical) on real public datasets (LoCoMo, LongMemEval, MemoryArena).
  4. The autonomous-research case study — run a real LLM-pretraining sweep on a cloud GPU, aggregate results across groups, and diagnose memory failures.
  5. Cognitive / constraint-aware memory — build a pure-Python "CML-lite" provider that surfaces stored constraints (allergies, OOM rules) even on zero-overlap queries, then diagnose it with the same 3-probe harness.

🔬 Run in Google Colab

Every notebook below is a clickable Colab link (🔬). Click any name to open that specific notebook in Google Colab — the setup cell auto-clones the repo and installs dependencies.

PhaseStart here (click to open)Total
101 Short-term Memory 🔬8 notebooks
201 Diagnostic Framework 🔬5 notebooks
301 Autoresearch Loop 🔬4 notebooks
411 Cognitive Memory Layer 🔬1 notebook

Individual notebook links (all 18) are in the Phase tables below.

Setup (5 minutes)

Prerequisites

RequirementDetails
Python3.10 or later
RAM8 GB+ (16 GB recommended for Phase 3)
GPUNot required for Phases 1–2. Phase 3 uses a cloud L4 (Modal).
API key (Phase 1)Free OpenAI-compatible endpoint: OPENAI_API_KEY + OPENAI_BASE_URL=https://api.openai.com/v1
Modal (Phase 3)pip install modal && modal setup (~$0.5–1/group)

Install

# 1. Clone the repository
git clone -b tutorial-rebuild https://github.com/syaikhipin/kdd26-memdiag kdd-tutorial
cd kdd-tutorial

# 2. Install dependencies (offline-only, lightweight)
pip install numpy matplotlib pyyaml

# 3. Install the CLI package (optional but recommended)
pip install -e source # core package
pip install -e "source[api]" # + openai/tiktoken for LLM demos

# 4. Verify
python -m compileall -q source # should print nothing (success)
For Phase 1 LLM demos: export an OpenAI-compatible endpoint before launching Jupyter:
export OPENAI_API_KEY=-<your-key>
export OPENAI_BASE_URL=https://api.openai.com/v1
Without a key, the demos fall back to offline heuristics (still runnable, just less rich).

Quick Start

Open any notebook in Jupyter or Colab — each is independent and self-contained:

# Phase 1 (offline or ):
jupyter notebook tutorial/phase1_memory_architectures/01_short_term_memory.ipynb

# Phase 2 (offline, no key):
jupyter notebook tutorial/phase2_public_datasets/01_diagnostic_framework.ipynb

# Or use the CLI directly:
diagnostic-framework diagnose --strategies verbatim,extracted_facts,episodic,hybrid --top_k 5
benchmark-cli compare --providers verbatim,extracted_facts,episodic,hybrid --sample_size 20

Phase 1 Agent Memory Techniques (60 min)

Goal: tour all 30 memory techniques across 6 families, with hands-on demos. LLM-based techniques use an OpenAI-compatible endpoint; offline fallbacks are always available.

Adapted from Agent Memory Techniques by Nir Diamant (Apache-2.0).

The 6 families

FamilyTechniquesWhat it solves
Short-term01–05Keep recent turns without filling the context window
Long-term06–11Persist knowledge across sessions, users, and time
Cognitive12–19Working, hierarchical, consolidation, reflection, routing, forgetting
Retrieval20–23Choose what to recall and when; share across agents
Frameworks24–27Production libraries: Graphiti, Mem0, Letta, Zep
Evaluation28–30Measure quality, benchmark, deploy at scale

Phase 1 notebooks (8)

#NotebookCoversLLM demos
0101_short_term_memory 🔬Buffer, sliding, summary, token budget03 summary
0202_long_term_memory 🔬Vector, entity, KG, episodic, semantic, procedural07 entity
0303_cognitive_architectures 🔬Working, hierarchical, consolidation, forgettingvia providers
0404_retrieval_multi_agent 🔬Retrieval patterns, cross-session, multi-agent, tools
0505_frameworks 🔬Graphiti, Mem0, Letta, Zep (descriptions)
0606_evaluation_production 🔬Evaluation, benchmarks, production
0707_capstone 🔬4 architectures compared on one conversationvia providers
0808_exercise 🔬Hands-on: build a support-agent memory systemyes

Phase 2 Public Datasets (60 min, offline)

Goal: diagnose retrieval vs utilization failures on real benchmarks, then benchmark the 4 providers. No API key needed.

The 3-probe diagnostic framework

ProbeMeasuresHow
1. Retrieval relevanceDid the system retrieve the right evidence?P/R/F1 vs gold evidence IDs
2. Context utilizationDid the agent use the memory?3-arm reader (no-context / oracle / provider)
3. Failure root-causeWhere did it break?retrieval_miss / partial / retrieved-but-unused
The circularity trap: many benchmarks set "memory used" = "evidence retrieved" — making utilization just retrieval in disguise. Our 3-arm reader avoids this.

Phase 2 notebooks (5)

#NotebookWhatTime
01diagnostic_framework 🔬Exercise 1: diagnose failures1.4s
02utilization_lab 🔬3-arm utilization lab + inspect a failure<1s
03benchmarking 🔬Exercise 2: benchmark providers4.2s
04llm_as_judge_lab 🔬Live LLM judge vs offline proxy25s
05question_type_analysis 🔬Per-type: which architecture wins where<1s

Phase 3 Autoresearch (60 min, Modal L4)

Goal: run a real LLM-pretraining sweep on a cloud GPU, aggregate across groups, and diagnose memory failures.

Group slices (each fits one L4)

GroupConfigs (depth, batch)Why
A(4,32), (6,32)Shallow, safe
B(8,32), (10,32)Medium depth
C(12,16), (14,16)Deep — batch 16 recovers the VRAM">OOM
D(16,16), (18,16)Deepest

Phase 3 notebooks (4)

#NotebookWhatTime
01autoresearch_loop 🔬The loop + why we split into groups<1s
02run_your_group 🔬Run YOUR slice on Modal L4~14.5 min
03aggregate_and_debug 🔬Aggregate sweep + keep/revise/discard8s
04memory_diagnostic 🔬5-condition interventional diagnosticpilot

Phase 4 Cognitive Memory Layer (50 min, offline)

Goal: go beyond storage memory. Build a tiny "CML-lite" provider that adds the one thing verbatim / episodic / extracted / hybrid all lack — constraint awareness: surfacing a stored rule ("I'm allergic to shellfish", "depth 16 → OOM") even when the query shares zero words with it. Then diagnose it with the same 3-probe / LoCoMo harness from Phase 2.

Inspired by the Cognitive Memory Layer (avinash-mall/CognitiveMemoryLayer), a neuro-inspired system (Docker + Postgres + Neo4j + Redis + ~25 GB of models) we cannot run in a Colab slot — so we capture its cognitive core in ~90 lines of pure Python, fully offline.

The 5 cognitive constraint types

TypeExampleWhen the cognitive layer surfaces it
POLICY"I'm allergic to shellfish"Always (safety-critical)
STATE"the GPU server is down"Always
CAUSAL"depth 16 batch 32 → OOM"Action / config queries (Phase 3 tie-in!)
GOAL"I want to lose weight"Recommendation queries
VALUE"I value privacy over convenience"Recommendation queries
The zero-overlap win: store "I'm allergic to shellfish", then ask "recommend a restaurant". Plain lexical memory (verbatim) retrieves nothing (cosine ≈ 0); CML-lite's read path injects the POLICY constraint regardless of overlap. This is exactly where standard RAG fails but cognitive memory succeeds — and it turns the Phase-3 OOM rule into a first-class CAUSAL constraint.

Phase 4 notebook (1)

#NotebookWhatTime
11cognitive_constraint_layer 🔬Constraint extraction + zero-overlap retrieval + 3-probe diagnostic<1s
The honest read: CML-lite is deliberately a sketch. Mapping its gaps onto the real CML repo's LoCoMo-Plus profile (adversarial 75.3%, overall 48.6%, cognitive reasoning 25.4%, multi-hop 34.6%, temporal 35.5%) is the tutorial's "diagnose a cognitive system" moment — even the system you admire has failure modes you can name.

Results (honest, tutorial-scale)

Teaching sample (LoCoMo 40 / LongMemEval 50 / MemoryArena 86 questions). Full provenance in the note below.

LoCoMo — where the 4 architectures are distinct

StrategyPrecisionRecallHitMemory size
no_memory0.0000.0000.0000
verbatim0.0400.1880.200419
extracted_facts0.0400.1880.2001282
episodic0.0000.0000.00019
hybrid0.0030.1250.125438

Memory footprints differ 10x (419 / 1282 / 19 / 438) — genuinely different architectures. No single strategy dominates.

Autoresearch trace (real L4)

DepthBatchval_bpb (lower = better)
4321.254
6321.296
8321.433
10321.661
Retrieval diagnostics
Retrieval diagnostics. Evidence hit rate across datasets & strategies. No single architecture dominates — the core benchmarking message.
LoCoMo retrieval
LoCoMo detail. The long-conversation setting where architectures differ most. Verbatim hits 0.30; episodic misses (session summaries lose specific dia_ids).
Failure modes
Failure analysis. Breakdown by failure category: retrieval_miss, partial_evidence, retrieved_but_answer_absent, no_memory_available.
Memory growth
Memory growth. Storage cost per architecture: verbatim (419), extracted_facts (1282), episodic (19), hybrid (438). 10× difference.
Semantic scores
Semantic scores. Non-circular token-overlap evaluation (context-only; never reads evidence_hit). Decoupled from retrieval metrics.
Semantic vs retrieval
Semantic vs retrieval alignment. Shows whether stronger retrieval recall translates into more faithful/evaluable answers. The gap is the utilization signal.
Evaluator coverage
Evaluator coverage. Offline semantic evaluation coverage across all datasets and strategies — complete (1.000) for the tutorial sample.
Idea novelty
Idea novelty. Autonomous research-agent case study: novelty scores of generated ideas (Phase 3 autoresearch-agent loop).

3-arm utilization lab results

Strategyp0 (baseline)Oracle (ceiling)ProviderNet gainBeneficialHarmful
no_memory0.250.600.250.0000
verbatim0.250.600.35+0.1073
extracted_facts0.250.600.325+0.07563
episodic0.250.600.35+0.1051
hybrid0.250.600.35+0.1073

Memory helps by +10pp accuracy (provider vs no-memory). The oracle ceiling (0.60) shows room for improvement — better retrieval/representation could close the gap.

Provenance: The committed sample was produced by the rebuilt providers (4 genuine architectures, non-circular metrics). Scale: LoCoMo 20 questions, LongMemEval 50 items (stratified subset), MemoryArena 50 items (formal_reasoning_phys). This is a teaching sample, not paper-scale. Pre-refactor numbers were removed (they used prefix-string strategies + circular utilization metrics).

CLI Package

pip install -e source # offline deps
pip install -e "source[api]" # + openai/tiktoken
diagnostic-framework diagnose --strategies verbatim,extracted_facts,episodic,hybrid --top_k 5
benchmark-cli compare --providers verbatim,extracted_facts,episodic,hybrid --sample_size 20
benchmark-cli serve --port 8080

LLM-as-Judge Lab

Notebook 04_llm_as_judge_lab.ipynb runs a live LLM judge and compares it to the offline token-overlap proxy. Where they disagree: semantic relevance the proxy misses. This is the proposal's headline evaluation protocol, demonstrated live.

Memory Diagnostic (Phase 3D)

5 memory conditions x K=5 repeated probes, frozen pre-decision snapshots, real LLM agent:

ConditionOOM rateAny-OOMTests
M0 no-memory50%62%Placebo baseline
M1 raw-history12%12%Full trial log
M2 retrieved12%30%Batch-keyed retrieval
M3 structured-rule5%5%Raw + constraint
M4 oracle0%12%Raw + outcome
Key finding: any history cuts OOM proposals by 76%. Retrieval filtering is counterproductive (loses cross-task context, increases OOMs 2.5x). Structured rules approach oracle performance.

4-Phase Schedule (180 min)

TimePhaseActivity
0:00–0:45130 memory techniques (8 notebooks) + hands-on exercise
0:45–0:55Break (install Modal for Phase 3)
0:55–1:352Diagnose + benchmark (5 notebooks) + LLM-as-judge lab + type analysis
1:35–2:103Autoresearch groups (4 notebooks) + memory diagnostic
2:10–3:004Cognitive Memory Layer — CML-lite build + diagnose (1 notebook) + discussion

Prerequisites: Python 3.10+, 8 GB RAM, no GPU for Phases 1–2. Phase 3 uses Modal L4 (~$0.5–1/group). An OpenAI-compatible API key enables richer LLM demos in Phase 1 (offline fallbacks always available).

Timing & Pacing

PhaseExecutionSpeech (3s/cell)Total
Phase 1 (8 notebooks)182s126s308s (5.1 min)
Phase 2 (5 notebooks)31s48s79s (1.3 min)
Phase 3 (4 notebooks)885s18s903s (15.1 min)
Phase 4 (1 notebook)1s15s16s (0.3 min)
Total1099s (18.3 min)207s1306s (21.8 min)

For a 180-min session: 158 min spare for lecture, discussion, Q&A.

FAQ

Do I need an API key?

Phase 1 LLM demos use an OpenAI-compatible endpoint. Without a key, offline heuristics. Phase 2 is fully offline. Phase 3 uses Modal (cloud GPU).

Do I need a GPU?

No for Phases 1-2. Phase 3 uses a cloud L4 via Modal (~$0.5-1/group, ~15 min).

Are these results publishable?

No — tutorial-scale (40-86 questions). Full-scale needs complete datasets + Modal.

Can I use the providers in my project?

Yes — pip install -e source then from providers import build_provider. MIT-licensed.

Glossary

TermMeaning
RAGRetrieving context from a memory store to augment an LLM's answer
LLMLarge Language Model (e.g. GPT, Claude, Llama)
TF-IDFLexical text similarity: matches by word overlap, not meaning
OOMCUDA error when the GPU runs out of VRAM
val_bpbCompression metric for language models (lower = better). Independent of vocabulary size.
VRAMMemory on the GPU (e.g. 22 GB on an NVIDIA L4)
F1Harmonic mean of precision and recall. Balanced retrieval metric.
POf retrieved items, how many are relevant. High = few false positives.
ROf relevant items, how many were retrieved. High = few misses.
CIAutomated testing on every code push (GitHub Actions)
CLIRun tools from the terminal (e.g. diagnostic-framework diagnose)
GPUParallel processor for ML training. Phase 3 uses an NVIDIA L4 via Modal.
SDPAPyTorch's built-in attention mechanism (replaces Hopper-only flash-attn-3)
dia_idDialogue turn ID in LoCoMo (identifies a specific turn in a conversation)
evidence_hitWhether the system retrieved the gold evidence turn (an ID match)
memory_utilizedWhether the agent actually used the retrieved memory (a content match, independent of evidence_hit)
3-arm readerThe contrastive utilization probe: tests no-context / oracle / provider conditions
providerA memory architecture (verbatim, extracted_facts, episodic, hybrid)

Authors & Credits

Tutorial Authors

NameAffiliation
Nur Arifin AkbarUniversitá degli Studi di Palermo, Italy
Rahool DembaniSingularlogic, Athens, Greece
Gregorius AirlanggaAtma Jaya Catholic University of Indonesia
Ripto Mukti WibowoAtma Jaya Catholic University of Indonesia
Biagio LenzittiUniversitá degli Studi di Palermo, Italy
Domenico TegoloUniversitá degli Studi di Palermo, Italy

Funded by the European Union's Horizon research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 101073381.

Software & Data Attribution

This is a tutorial, not a research paper. Results are tutorial-scale samples (LoCoMo 40 / LongMemEval 50 / MemoryArena 86 questions). Full-scale runs require the complete datasets + the Modal GPU runner. See the provenance note above.