---
title: "Instant Recall: A Pre-Computed Concept Index for O(1) Memory Retrieval in Persistent AI Agents"
author: "Oscar Serra — Independent Research"
date: "June 2026"
---

## Abstract

Persistent AI agents accumulate months of interaction history yet routinely fail to retrieve knowledge they demonstrably own. We formalize this as **Contextual Ownership Retrieval Failure (CORF)**, identify four failure modes from eighteen months of deployment logs, and introduce **Instant Recall** — a pre-computed concept-to-memory index that resolves retrieval _before the model processes the prompt_. By mapping anchor vocabulary terms to pre-ranked memory clusters offline, Instant Recall achieves 0.85 CORF-Recall@20 at 54ms p95 latency — a 5.9× speedup over MemGPT-style sequential retrieval (0.79 at 320ms) — with a false positive rate of 0.18 and zero inference-time search computation. A probabilistic source-coverage analysis establishes that parallel source aggregation, not query quality, is the binding constraint on retrieval completeness. Concept anchoring closes the 9-point recall gap that remains after source coverage is saturated. Beyond similarity, the index carries three additional retrieval signals — validity over time, code-trust, and inter-chunk links — so that the highest-cosine chunk is not automatically the one returned.

**Keywords:** AI agent memory, episodic retrieval, cognitive architectures, RAG, hippocampal indexing, context management, sleep consolidation, CORF

## 1. Introduction

The gap between what a persistent AI agent _knows_ and what it _retrieves_ is one of the least-studied problems in agent architecture. As agents accumulate months of interaction history, project notes, and documents, the memory base grows faster than the retrieval mechanisms designed to access it. The result is not amnesia — the data exists — but _retrieval failure under load_.

Consider a concrete scenario. An agent has collaborated with its user on six technical papers over eighteen months, stored across a local memory directory, an imported ChatGPT archive, and a project index. The user asks: _"Can we talk about peer review for our papers?"_ The agent responds: _"What type of papers are you referring to?"_

This is not a hallucination or a context-length problem. The agent has the data. The failure is architectural: retrieval was not triggered by the right signals, did not search the right sources, and could not surface the right memories within a single inference step's latency budget.

We call this **Contextual Ownership Retrieval Failure (CORF)** and argue it is endemic to current agent memory architectures. CORF is the digital version of a familiar frustration: you know you own a particular book, but you cannot find it on your shelves. The book exists; the index just cannot locate it.

The solution takes its name and its shape from the brain. The human hippocampus is not where memories are stored — long-term memories live distributed across the neocortex. The hippocampus is the brain's *indexing organ*: it knows where every memory lives and how to retrieve it. The clinical evidence is stark. Patient H.M., who had both hippocampi removed to treat epilepsy, retained his old memories intact but could no longer form or retrieve new ones — the store was fine; the index was gone [Scoville & Milner, 1957]. **Instant Recall is our attempt to build the AI equivalent of this biological indexing organ — the layer that makes the difference between *having* memories and being *able to use them*.** It draws the same structural separation: a pre-computed concept index, built offline during a Sleep Consolidation phase, maps anchor vocabulary terms to their nearest memory clusters in embedding space [Teyler & DiScenna, 1986]. The mechanism is pre-computed KNN over sentence embeddings — the hippocampal analogy is architectural (index vs. store), not mechanistic. The index lookup completes in ~50ms before the LLM receives its context window, so the model begins reasoning with relevant memories already in place.

The anchor index behaves like the index at the back of a book. Look up "photosynthesis" and it tells you pages 42, 87, and 156. The index is tiny compared to the book, but without it you would have to read every page to find what you need. Instant Recall builds that index once, offline, so that every query is a lookup rather than a full-text scan.

**Scope note:** This paper addresses deployments up to ~50,000 memory chunks (roughly 2–3 years of personal assistant history). Large-scale adaptations for 100,000+ chunks are discussed in Section 8.

### 1.1 The Three-Layer Memory System

Instant Recall is one layer of a three-paper memory system. Each layer is independently useful; together they compound.

- **Storage layer (Total Recall; Serra, 2026a).** Persists every interaction as a typed, timestamped event and compacts older events into lightweight pointers — summaries that preserve the essential content while reducing storage by 80–95%. It stores without loss of meaning.
- **Retrieval layer (Instant Recall; this paper).** Indexes those pointers and full events alike, making the compaction transparent to retrieval, and surfaces the right chunk in O(1) at inference time.
- **Reflection layer (Sleep Consolidation; Serra, 2026e).** A nightly cycle reviews which retrievals succeeded and which failed, then adjusts the index parameters — anchor term selection, importance weights, chunk boundaries — based on observed patterns. The retrieval layer gets better without any code change.

In one line: the storage layer stores without losing, the retrieval layer recalls in constant time, and the reflection layer refines both. The rest of this paper concerns the middle layer.

![The three-layer memory system. Storage (Total Recall) persists and compacts events into the chunk store; Instant Recall builds and serves the concept index over that store; Sleep Consolidation reflects nightly and tunes the index parameters. Each arrow shows what flows between layers.](images/three-layer-system.png)

**Primary contributions:**

1. **Formal CORF definition and taxonomy** — four failure modes with empirical frequency estimates and a source-coverage upper bound separating _coverage_ error from _ranking_ error.
2. **Instant Recall architecture** — including real-time incremental index updating as a first-class component.
3. **Importance scoring** — weighted retrieval prioritizing decisions, entities, and user-engaged content.
4. **Deduplication via similarity check** — prevents index bloat from recurring logs.
5. **Post-retrieval re-ranking** — reduces false positive injection.
6. **Beyond-cosine retrieval signals** — bi-temporal validity, code-trust, and durable inter-chunk links, so ranking weights more than embedding distance (§4.9).
7. **Design space analysis** — comparison against inverted index, all-sources ANN, multi-source RAG, knowledge graph, and vector database alternatives.
8. **Evaluation protocol + artifacts** — metrics, baselines, ablations, and an annotated CORF dataset from deployment logs.

## 2. Background and Related Work

### 2.1 Persistent Agent Memory Systems

Memory in AI agents has evolved from pure in-context storage toward hierarchical architectures separating short-term working memory from long-term storage. The dominant paradigm is Retrieval-Augmented Generation (RAG): relevant documents are fetched and injected into the context window at inference time [Lewis et al., 2020]. Instant Recall complements RAG by pre-computing a small anchor→chunk index so retrieval cost is constant in corpus size and independent of query quality.

Recent work has expanded the field. A-MEM [Xu et al., 2025] introduces agentic memory where the agent manages its own retrieval strategies. Memory-R1 [Yan et al., 2025] applies reinforcement learning to memory management policies. LongMemEval [Wu et al., 2024] benchmarks long-term interactive memory. MemGPT [Packer et al., 2023] introduced virtual context management inspired by OS paging. Mem0 [MemoryOS, 2024] builds a multi-level memory architecture. RAPTOR [Sarthi et al., 2024] addresses multi-hop retrieval via recursive tree summarization.

### 2.2 The Storage and Reflection Layers

The storage layer [Serra, 2026a] defines persistent agent memory as a compaction-based cache eviction system. Raw events are stored in an event log; a compaction algorithm promotes high-salience content to long-term storage while evicting low-salience content. It provides the substrate Instant Recall operates on: the nightly rebuild consumes the storage layer's event files as its primary input.

The identity layer [Serra, 2026b] addresses agent identity drift across session boundaries via a persona-state structure injected into every session's system prompt. It assumes relevant memories can be retrieved; Instant Recall makes that assumption true — supplying context chunks at every prompt, before the model begins processing.

The reflection layer [Serra, 2026e] runs a nightly cycle that audits retrieval outcomes and tunes Instant Recall's parameters (§4.10). This is the orchestration boundary: Instant Recall builds and serves the index; the reflection layer decides *how* it should be built next time.

### 2.3 Neuroscience Basis

The biological hippocampus is a medial temporal lobe structure critical for episodic memory formation and retrieval. Lesion studies establish that it does not store long-term memories — those are distributed across neocortical areas — but encodes _indices_ [Teyler & DiScenna, 1986; Squire, 1992]. Patient H.M.'s preserved-store-but-lost-index profile [Scoville & Milner, 1957] is the clinical anchor for the architecture: damage the index, not the store, and you lose access without losing data — precisely CORF.

During sleep, hippocampal replay consolidates these indices: recently encoded patterns are reactivated, strengthening links between hippocampal indices and cortical storage sites [Wilson & McNaughton, 1994]. This offline consolidation is what our Sleep Consolidation phase implements.

## 3. Problem Formulation: Contextual Ownership Retrieval Failure (CORF)

### 3.1 Formal Definition

Let $M = \{m_1, m_2, \ldots, m_n\}$ be the agent's long-term memory, where each $m_i$ is a memory chunk with content $c_i$, timestamp $t_i$, source $s_i \in S$, and salience score $\sigma_i$.

**Definition (CORF).** A Contextual Ownership Retrieval Failure occurs when:

1. There exists $m^* \in M$ such that $m^*$ is ground-truth relevant to $q$.
2. $m^* \notin R(q, M)$ — the retrieval function fails to surface $m^*$.
3. The agent generates a response $a$ that contradicts, ignores, or is incompatible with the content of $m^*$.

### 3.2 Failure Modes

**Mode 1 — Pronoun Blindness.** The query uses pronouns ("our papers", "we wrote") without explicit noun anchors.

**Mode 2 — Associative Depth Failure.** The relevant memory requires two or more associative hops from query terms.

**Mode 3 — Source Blindness.** The relevant memory exists in a source not queried at inference time.

**Mode 4 — Anchor Silence.** A domain-significant noun is present in the query but does not trigger a comprehensive sweep.

### 3.3 Probabilistic Source-Coverage Analysis

**Observation 1 (Source-coverage upper bound).** Let $P(s) = |\{m \in M^* : s_m = s\}| / |M^*|$ be the fraction of ground-truth relevant memories stored in source $s$, where $M^* \subseteq M$ is the set of all relevant memories for the query distribution. For any retrieval strategy restricted to sources $\mathcal{Q} \subseteq S$:

$$\mathbb{E}[\text{Recall}|\mathcal{Q}] \leq \sum_{s \in \mathcal{Q}} P(s)$$

**Implication.** Improving query embedding quality within a fixed source set yields bounded recall improvement. Adding sources raises the upper bound toward 1.0 but cannot exceed it. Instant Recall saturates this bound at build time by aggregating all sources into a single unified index.

### 3.4 Frequency Analysis

Based on eighteen months of interaction logs (~8,400 queries) from a single personal assistant deployment:

| Failure Mode              | Est. Frequency (ownership queries) | Severity |
| ------------------------- | ---------------------------------- | -------- |
| Pronoun Blindness         | ~12%                               | High     |
| Associative Depth Failure | ~8%                                | High     |
| Source Blindness          | ~23%                               | Critical |
| Anchor Silence            | ~31%                               | High     |

These frequencies are derived from manual annotation of a stratified sample (n=612) from the full query log. Annotators labeled each query with the applicable failure mode(s) when ground-truth relevant chunks were not retrieved by the baseline system. Percentages do not sum to 100% because a single query can exhibit multiple failure modes simultaneously (e.g., a pronoun-heavy query targeting an unqueried source triggers both Mode 1 and Mode 3).

## 4. Instant Recall Architecture

### 4.1 Overview

Instant Recall operates in three phases:

- **Offline (nightly Sleep Consolidation):** Full rebuild of the concept index mapping anchor terms to pre-ranked memory chunk paths.
- **Real-time (incremental updates):** O(|V|) per-write update inserting new chunks into relevant anchor clusters immediately.
- **Online (inference):** Detect anchor words in incoming queries; load pre-ranked chunk lists in O(1); re-rank against current query; inject into context.

The index is a cacheable JSON artifact. The real-time phase keeps it fresh between nightly rebuilds.

The online phase executes before the model's inference pass. By the time the LLM receives the assembled context window, the memory search has already completed programmatically. The model refines and reasons over pre-retrieved chunks — it does not perform the search.

![Inference-time data flow. The user query enters anchor detection and semantic expansion (orange, input), feeds the O(1) index lookup against the pre-built concept index (blue, storage), then post-retrieval re-ranking blends anchor relevance, query cosine, and the beyond-cosine signals (green, processing). A low-confidence branch triggers the reformulation gate. Ranked chunks assemble into the context window handed to the LLM (purple, output).](images/inference-pipeline.png)

### 4.2 What Instant Recall Indexes

Instant Recall does not require the storage layer described in §2.2; it requires only that a memory store expose, per chunk, three things: a content string, a timestamp, and a source label. Any store satisfying that contract — an event log, a flat directory of Markdown files, an email archive — can be indexed. The architecture is store-agnostic by design.

Two stores are concrete in the reference deployment. The default is a single-writer relational store keyed by chunk; an optional columnar vector store implements the same interface for large-corpus experiments. Because both implement one storage contract, any schema addition (§4.9) is applied to both or explicitly scoped to the relational path. The point for this paper is that Instant Recall sits *above* the store and treats it as a source of `(content, timestamp, source)` triples — it inherits the storage layer's loss-free compaction for free, but does not depend on it.

### 4.3 Anchor Vocabulary

The anchor vocabulary $V = V_{curated} \cup V_{discovered}$ consists of two components. **Curated anchors** are manually defined domain-significant terms. **Salience-weighted discovered anchors** are concept phrases extracted from memory content using:

$$\text{salience}(term) = \text{TF-IDF}(term) \times \text{recency\_weight}(term) \times \text{engagement}(term)$$

where `engagement(term)` measures the frequency with which the term appears in user-initiated messages (as opposed to system-generated content), weighted by log-scaled conversational turn depth (a term mentioned on turn 8 of a conversation scores higher than one mentioned on turn 1, reflecting sustained topical engagement).

**User-feedback anchors** — proper nouns introduced by the user — are added to $V_{curated}$ immediately upon detection. The union typically yields 150–400 anchor terms for a mature deployment.

**Anchor Vocabulary Lifecycle.** Discovered anchors follow a promotion-and-pruning lifecycle. Anchors whose salience falls below a decay threshold for three consecutive rebuilds are pruned. Anchors maintaining high salience and appearing in user queries are candidates for promotion to $V_{curated}$. Curated anchors are never automatically pruned.

### 4.4 Concept Embedding and KNN Clustering

For each anchor term $v \in V$, we compute its embedding $\vec{v} = \text{embed}(v)$ using a fixed sentence-embedding model (default: `text-embedding-3-small`). The index entry for anchor $v$ is:

$$\text{index}[v] = \text{argsort}_{i}\left(\text{cos\_sim}(\vec{v}, \vec{m}_i)\right)_{1:K}$$

where $K$ is the cluster size (default: $K = 20$ chunks per anchor).

### 4.5 Pre-Computed Index Structure

```json
{
  "version": "1.3",
  "built_at": "2026-02-19T03:00:00Z",
  "model": "text-embedding-3-small",
  "anchor_count": 287,
  "entries": {
    "paper": {
      "chunks": [
        "memory/projects/total-recall/total-recall-v3.md#chunk-4",
        "archive/chatgpt-import/2025-07-laser-paper.md#chunk-1"
      ],
      "scores": [0.94, 0.91],
      "sources": ["memory/", "archive/"]
    }
  }
}
```

### 4.6 Nightly Sleep Consolidation (Full Rebuild)

The rebuild algorithm: (1) scan all memory sources, chunking long documents into 256–512 token segments; (2) embed all chunks (batch, cached by content hash); (3) build salience-weighted anchor vocabulary; (4) build index using ANN for large corpora, exact KNN for <50k chunks; (5) write atomic JSON artifact. The rebuild entry point consumes the storage layer's event files and writes the index in a single pass (~450 lines of orchestration code in the reference implementation).

### 4.6a Deduplication via Similarity Check

Before storing a new memory chunk into an anchor cluster, Instant Recall checks cosine similarity against existing chunks to prevent index bloat from daily logs that repeat similar facts. Three thresholds govern the policy:

- **Similarity > 0.9 (near-duplicate):** Merge — retain the richer or more recent version; create a provenance alias.
- **Similarity 0.7–0.9 (related but distinct):** Flag as related; both chunks remain with a `related_to` edge.
- **Similarity < 0.7 (distinct):** Store normally.

In deployment testing on a corpus with 18 months of daily logs, deduplication reduced effective index size by approximately 12%.

### 4.6b Real-Time Anchor Discovery

Novel concepts emerging between nightly rebuilds are detected and indexed within 10–30 seconds via a lightweight micro-rebuild. A new anchor is created when its salience score (§4.3) exceeds the emergence threshold of 0.75 — a normalized value on the [0, 1] salience scale — computed over content ingested since the last nightly build.

### 4.7 Two-Tier Memory: Episodic and Semantic

**Episodic tier (real-time).** When a new memory chunk is written, it is immediately inserted into the index. This tier contains raw, unprocessed facts — always current, with <2-minute freshness. The desk-versus-filing-cabinet distinction is the right intuition: what you used in the last hour stays within arm's reach.

**Semantic tier (nightly rebuild).** At 04:15 each night, the full index is rebuilt from scratch, reflecting abstracted, consolidated understanding — concepts that have risen to sufficient salience and relationships visible across many episodes.

Within a session, retrieval is episodically accurate (same-day freshness). Across sessions, retrieval is semantically rich (nightly consolidation). Both tiers are necessary; neither is sufficient alone.

The episodic tier doubles as a fix for a subtler retrieval failure: the agent has *written* a correct fact in today's notes but acts against it before the nightly rebuild can index it. A same-day hot cache that unconditionally injects today's self-written log closes that window, so the agent does not contradict notes it wrote an hour ago.

### 4.8 Importance Scoring

Instant Recall assigns an **importance score** $\iota(m) \in [1, 10]$ to each memory chunk at write time:

$$\iota(m) = w_1 \cdot \text{entity\_density}(m) + w_2 \cdot \text{decision\_signal}(m) + w_3 \cdot \text{user\_engagement}(m) + w_4 \cdot \text{recency\_bonus}(m)$$

Default weights: $w_1 = 3.0$, $w_2 = 3.0$, $w_3 = 2.5$, $w_4 = 1.5$. Each component is normalized to [0, 1] before weighting, so the raw weighted sum falls in [0, 10] and is clamped to [1, 10]. Importance scoring works like an editor deciding the front page — recency, weight, and relevance to what the reader is currently asking about. The importance score modulates effective similarity during K-slot ranking:

$$\text{effective\_score}(v, m) = \text{cos\_sim}(\vec{v}, \vec{m}) \times (1 + \alpha \cdot \log(\iota(m)))$$

where $\alpha = 0.15$. A connection-count bonus (+1 per three related links, capped at +1) lets well-connected chunks rise — anticipating the link signal of §4.9.

The TRACE event model [Serra, 2026a] aligns with this: decisions and constraints receive elevated importance at ingest time, mapping directly to the `decision_signal` component.

### 4.9 Beyond Cosine: Validity, Trust, and Links

A pure similarity index treats the highest-cosine chunk as the best answer. Production exposed three cases where that is wrong, and Instant Recall now carries three additional per-chunk signals that ranking weights alongside cosine. Each is the same move — *raw similarity is insufficient; retrieval must weight signals beyond embedding distance* — applied to a different dimension.

**Validity over time (bi-temporal facts).** A chunk you can retrieve but that is silently *wrong because it was overwritten* is a recall failure subtler than CORF: the index finds it, but it no longer reflects reality, and the prior truth is gone. Each chunk therefore carries a validity interval (`validity_start … validity_end`) describing when it was true in the world, and an ingestion time describing when the system learned it — the two clocks of a bi-temporal store. A new fact that contradicts an old one *closes the interval* of the old fact (`validity_end = now`) and stamps it `superseded_by` the new chunk, rather than overwriting the row. History is preserved, and the index can answer "what did we believe was true *as of* date X," not only "what is the latest snapshot." Retrieval defaults to a `current`-mode filter (`validity_end IS NULL OR validity_end > now`), backed by a covering index so the hot path does not scan; `valid-at` and `all` modes are available for time-travel queries. The invalidation routine only closes currently-open intervals — it never deletes a row or resurrects a closed one — and the contradiction *detection* that decides when to call it is left to the nightly reflection layer.

**Trust (verified-code retrieval).** When the index holds code chunks — from source files and from session transcripts — an embedding match treats a battle-tested function and an unreviewed scratch snippet as equals. For an agent that *acts* on retrieved code, the highest-cosine match may be the least trustworthy. Each code chunk carries a `verification_status` (`unverified | partial | verified | failed`) and a test-coverage percentage; a verification-aware re-rank multiplies the score by ×1.5 (verified), ×1.2 (partial), ×1.0 (unverified), or ×0.5 (failed). Penalized chunks are demoted, not dropped, unless the caller explicitly requires verification. Coverage is populated by a nightly batch that maps test-runner coverage back to chunk line ranges (≥80% coverage marks a chunk `verified`, partial coverage `partial`, no coverage `unverified`) — keeping metadata churn off the inference path. A file whose coverage disappears is downgraded rather than left stale, and transcript code, which has no coverage map, stays `unverified` by default.

**Links (durable inter-chunk edges).** A Zettelkasten's power is not the notes but the links between them — retrieving one note surfaces the web it sits in. The deduplication pass (§4.6a) already computes relatedness but historically discarded it. Those edges are now persisted in a `backlinks` table (authoritative) with a denormalized JSON cache on the chunk row: `link_type='duplicate'` for similarity ≥ 0.9, `'related'` for 0.7–0.9, with a link strength blending similarity, recency, and access count. A search can opt in to hydrate each result with its top backlinks, and a depth-capped, cycle-safe breadth-first walk (carrying a visited set so a cyclic graph terminates) can pull in a chunk's k-hop neighbourhood. Out-degree is bounded by linking only the top-k similar chunks per insert, avoiding the O(n²) link-explosion trap.

![The three beyond-cosine signals layered on the base cosine ranking. The base lane (blue) produces a cosine-ranked candidate set; validity (closes superseded intervals via a temporal filter), trust (×1.5/×1.2/×1.0/×0.5 verification multipliers), and links (durable backlinks + k-hop walk) each re-weight the candidates (green). All three are populated by the nightly cycle, never at query time, so the inference path stays O(1). The output is a re-weighted ranking where the closest chunk is not automatically first.](images/beyond-cosine-signals.png)

These three signals share a discipline: enrichment runs in the nightly cycle, not at query time, so the inference-path lookup stays O(1).

### 4.10 Reflection-Tuned Parameters

The nightly reflection layer (§2.2) audits the previous day's retrievals — which anchors fired, which returned chunks the agent then used, which returned chunks it ignored — and adjusts three knobs for the next rebuild: anchor term selection (promote anchors that produced used chunks, prune anchors that only produced ignored ones), importance weights ($w_1 \ldots w_4$), and chunk boundaries. The retrieval layer thus improves without code change; the reflection layer owns the *policy*, Instant Recall owns the *mechanism*.

### 4.11 Inference-Time Lookup with Post-Retrieval Re-ranking

Inference-time retrieval proceeds in five steps: (1) **anchor detection** — each token in the query is matched against $V$ via exact match, stemmed match, and bigram/trigram phrase match; all matching anchors form the active set $A$; (2) **semantic anchor expansion** — the query embedding is compared against all anchor embeddings in $V$, and any anchor within cosine distance 0.3 of the query is added to $A$; (3) **O(1) index lookup** — for each $a \in A$, retrieve the pre-computed top-K chunk list; (4) **post-retrieval re-ranking** — score each candidate chunk by blending anchor relevance (weight 0.6), query-specific cosine similarity (weight 0.4), and the validity/trust/link signals of §4.9; (5) **chunk content loading** — top chunks after re-ranking are loaded from disk.

The re-ranking step discards false positives — chunks matching the anchor word but semantically unrelated to the specific query — without an additional retrieval pass. The candidate set is small (K×|A| ≤ 100 chunks), making re-ranking fast (~10ms).

### 4.12 Low-Confidence Reformulation (Proposed)

The pipeline above assumes one query attempt. Production showed a distinct failure: when retrieval scores are uniformly low (max cosine < 0.5 across all results), the agent accepts the best-of-bad matches as authoritative rather than recognizing that retrieval *failed*. We propose a reformulation gate to close this gap. When max(scores) falls below a confidence threshold **and** the query carries ownership signals ("our", "we", "my", "the [noun] we [verb]"), the gate would (1) extract domain-anchor nouns and re-search on those alone, (2) search explicitly for known project and paper titles, and (3) if still low, broaden to a file-path search — the knowledge may live in a file whose *name* matches even when its *text* does not. This addresses the dominant residual: a 2026-04-01 incident in which the agent searched memory-retrieval content, scored 0.47–0.49 across all results, and accepted the wrong files with no retry. The keyword channel matters here too: a hybrid store weighting vector and keyword search 70/30 can let the BM25 channel rescue a bad embedding match — but only if the indexed text contains the query terms. Papers about "compaction" do not match queries about "retrieval." A complementary proposal is a concept→keyword routing table, built during Sleep Consolidation, storing 10–20 human-search keywords per project (e.g., Total Recall → ["memory", "retrieval", "forgetting", "context", "compaction", "eviction", "recall"]) even when those words never appear in the body text. Unlike the signals of §4.9, the reformulation gate and routing table are design proposals, not yet in the live pipeline.

### 4.13 Full Inference Pipeline Integration

```
INFERENCE_PIPELINE(user_message, agent_config):
  # Layer 0: Always-loaded context (O(1), ~500 tokens)
  base_context  = load(agent_config.persona_state)      # Identity layer
  project_index = load("memory/projects-master.md")
  today_log     = load_today_self_written_log()         # episodic hot cache

  # Layer 1: Instant Recall lookup + re-rank (O(|A|) + O(K×|A|), ~50ms)
  index         = load_cached("memory/instant-recall-index.json")
  memory_chunks = INSTANT_RECALL_LOOKUP(user_message, index)
  if max_score(memory_chunks) < CONFIDENCE_THRESHOLD and has_ownership_signal(user_message):
    memory_chunks = REFORMULATE_AND_RETRY(user_message, index)   # §4.12 (proposed)

  # Layer 2: Assemble context window
  context = [base_context, project_index, today_log, *memory_chunks, user_message]

  # Layer 3: Compaction if budget exceeded
  if token_count(context) > CONTEXT_BUDGET:
    context = COMPACT(context)

  return LLM_INFERENCE(context)
```

## 5. Theoretical Analysis

### 5.1 Amortized Complexity Analysis

| Method                     | Per-query inference cost | Build cost     |
| -------------------------- | ------------------------ | -------------- |
| Single-source exact KNN    | O(n)                     | —              |
| Single-source ANN (FAISS)  | O(log n)                 | O(n log n)     |
| Instant Recall (+ semantic anchor expansion) | O(\|V\| + \|A\| + K·\|A\|) | O(\|V\|·n) offline |

For $n=50{,}000$, $|V|=300$, $|A|=3$, $K=20$: Instant Recall inference evaluates ~363 operations (300 anchor comparisons + 3 lookups + 60 re-rank comparisons), independent of corpus size $n$. By contrast, exact KNN scales as O(n) = 50,000 comparisons per query. The nightly build cost O(|V|·n) ≈ 15M operations is amortized across all queries until the next rebuild.

### 5.2 Recognition vs. Recall

Current RAG systems implement recall: given a query, the system generates the retrieval path. Instant Recall implements recognition: given an anchor word, the system activates the pre-existing index entry. The re-ranking step adds a lightweight query-specific discriminator within the already-small candidate set — analogous to the "familiarity signal" in dual-process recognition theory [Yonelinas, 2002].

## 6. Design Space Analysis

### 6.1 Alternative 1: Inverted Index (Classical IR)

Captures exact term matches but fails on synonymy and paraphrase. Preferred on edge devices where embedding compute is too expensive.

### 6.2 Alternative 2: All-Sources ANN

Fixes Source Blindness by searching across all memory sources, but still requires a well-formed query — Pronoun Blindness and Anchor Silence remain unaddressed. The 9-point gap between AS-ANN (0.76) and Instant Recall (0.85) in §7 isolates the benefit of concept-anchored clustering. AS-ANN also runs at inference time, adding latency.

### 6.3 Alternative 3: Multi-Source RAG (MS-RAG)

MS-RAG queries all memory sources at inference time with full embedding search, achieving high recall (0.87 in our evaluation). However, it incurs 418ms p95 latency — 7.7× slower than Instant Recall — because it performs exhaustive embedding comparison across all sources at every query. Instant Recall trades 2 percentage points of recall for an order-of-magnitude latency reduction, and the gap narrows further with anchor vocabulary tuning.

### 6.4 Alternative 4: Knowledge Graph Overlay

Preferred when relationship types between concepts matter (e.g., causal chains, temporal ordering). The durable backlink edges of §4.9 are a step in this direction; richer typed edges are a natural extension for structured domains (future work, §8.6).

### 6.5 Alternative 5: Hosted Vector Databases (Pinecone, Weaviate)

| Dimension           | Hosted Vector DB                           | Instant Recall                         |
| ------------------- | ------------------------------------------ | -------------------------------------- |
| **Retrieval model** | Flat similarity search (O(log n) via HNSW) | Pre-computed anchor→chunk cache (O(1)) |
| **Cost**            | $8+/month (starter tier)                   | Zero ongoing cost (local compute)      |
| **Privacy**         | Embeddings sent to cloud                   | All data remains local                 |
| **Latency**         | ~50–200ms (network round-trip)             | ~50ms (local, no network)              |

Vector databases are preferred for large-scale deployments (n > 100k chunks) or when query-time semantic flexibility is critical.

## 7. Evaluation

### 7.1 Evaluation Protocol

**Test Setup:** Evaluated on a real personal assistant deployment with 47,392 memory chunks across memory/ (52%), archive/chatgpt-import/ (28%), emails/ (15%), other (5%). Test set: 612 queries annotated with ground-truth target chunks by two independent annotators (Cohen's κ = 0.87).

**Baselines:**

- **NR (No Retrieval):** No memory retrieval; model sees only base context.
- **SS-RAG (Single-Source RAG):** Standard RAG over the primary memory directory only.
- **AS-ANN (All-Sources ANN):** ANN search across all memory sources at inference time.
- **MS-RAG (Multi-Source RAG):** Full embedding search across all sources at inference time — the highest-recall but highest-latency baseline.
- **MG-REC (MemGPT-style Sequential):** Sequential multi-step retrieval with virtual context paging [Packer et al., 2023].

### 7.2 Results

| Metric                      | NR   | SS-RAG | AS-ANN | MG-REC | MS-RAG   | Instant Recall |
| --------------------------- | ---- | ------ | ------ | ------ | -------- | -------------- |
| CORF-Recall@20              | 0.12 | 0.51   | 0.76   | 0.79   | **0.87** | 0.85           |
| Source Coverage Rate        | 0.25 | 0.33   | 1.00   | 1.00   | 1.00     | 1.00           |
| Inference Latency (p95, ms) | <1   | 178    | 94     | 320    | 418      | **54**         |
| FPR (post-rerank)           | —    | 0.28   | 0.31   | 0.19   | 0.22     | **0.18**       |
| Index Build Time            | —    | —      | 45s    | —      | —        | 12s            |
| Same-Day Index Freshness    | —    | —      | 24h    | —      | —        | <2min          |

**Key findings:**

- **Recall–latency tradeoff.** MS-RAG achieves the highest recall (0.87) but at 418ms — 7.7× slower than Instant Recall. For personal assistant workloads where sub-100ms retrieval is required for responsive interaction, Instant Recall's 0.85 recall at 54ms is a favorable operating point on the Pareto frontier.
- **Concept anchoring value.** The 9-point gap between AS-ANN (0.76) and Instant Recall (0.85) isolates the benefit of pre-computed concept clustering beyond source coverage.
- **False positive control.** Post-retrieval re-ranking gives Instant Recall the lowest FPR (0.18) of any method achieving >0.75 recall.
- **MS-RAG ceiling.** MS-RAG's 2-point recall advantage over Instant Recall comes entirely from queries where no anchor term matches the relevant concept — a limitation addressable through vocabulary expansion rather than architectural change.

### 7.3 Ablations

| Variant                                   | CORF-Recall@20 | Latency (p95, ms) |  FPR |
| ----------------------------------------- | -------------: | ----------------: | ---: |
| Full Instant Recall                       |           0.85 |                54 | 0.18 |
| A1 — w/o pronoun expansion                |           0.79 |                52 | 0.19 |
| A2 — w/o post-retrieval re-ranking        |           0.85 |                41 | 0.35 |
| A3 — nightly-only (no real-time episodic) |           0.82 |                54 | 0.18 |

Pronoun expansion contributes 6 points of recall (Mode 1 mitigation). Re-ranking does not affect recall but nearly halves FPR (0.35 → 0.18). The episodic tier contributes 3 points of recall for within-day queries.

### 7.4 Implementation Status

The reference implementation is TypeScript (ESM, Node 22+), organized around an enhancement module (importance scoring, episodic buffer, deduplication, ~480 lines), a rebuild module (nightly orchestration, anchor extraction, incremental mtime-diff state, ~470 lines), and a co-located unit test suite. The beyond-cosine signals of §4.9 are present in the live schema and ranking path: bi-temporal validity columns and a covering index, a verification-status column with a coverage-mapping batch and a verification-aware re-rank, and a `backlinks` table with backlink hydration and a depth-capped k-hop walk on the manager. The low-confidence reformulation gate and concept→keyword routing of §4.12 are designed but not yet wired into the live pipeline. Exact line counts and test totals vary as the code evolves; the architectural claims above are the stable contract.

### 7.5 Threats to Validity

**Single-deployment evaluation.** All results come from one personal assistant deployment with one user. Interaction patterns, source distributions, and vocabulary characteristics may not generalize to other domains (e.g., enterprise knowledge management, multi-user systems). We mitigate this partially through ablation analysis, which shows each architectural component contributes independently, but cross-deployment validation remains necessary future work.

**Annotator bias.** Both annotators had familiarity with the system, potentially inflating relevance judgments. The high inter-annotator agreement (κ = 0.87) suggests consistency but does not rule out shared bias.

**Beyond-cosine signals not yet in the benchmark.** The validity, trust, and link signals of §4.9 are implemented but were added after the §7.2 benchmark was frozen; their retrieval-quality contribution is not yet isolated in an ablation. Quantifying each is the next evaluation priority. The §4.12 reformulation gate, being a proposal rather than live code, is likewise unbenchmarked.

## 8. Discussion

### 8.1 Limitations and Mitigation Strategies

**Anchor vocabulary brittleness.** Paraphrased queries bypass the anchor vocabulary unless fuzzy matching or embedding-based anchor detection is used. With stemming + phonetic matching, paraphrase robustness improves from 68% to 82%.

**Semantic ambiguity.** The anchor "paper" could refer to research papers, manuscripts, or paper-based workflows. Mitigation: sense-specific sub-clustering via contextual embeddings. Deployment results: FPR drops from 0.18 to 0.14 with sub-clustering.

**K selection.** Fixed K=20 may be too small or too large depending on anchor specificity. Adaptive K based on score distribution within a cluster reduces context overhead by 15% with no recall loss.

**Contradiction detection boundary.** The validity machinery (§4.9) can close a fact's interval, but *deciding* that a new fact contradicts an old one is left to the reflection layer. Until that detector is in place, validity intervals are only as good as the heuristics that call the invalidation routine.

### 8.2 Large-Scale Deployment (n > 100,000 chunks)

For n > 100k chunks: (1) replace exact KNN with FAISS IVF at build time; (2) use differential builds (track chunk hashes changed since last build); (3) use disk-backed embedding store (DiskANN/ScaNN); (4) shard by source for parallel builds.

| Corpus Size                 | Build Time (full) | Index Size | p95 Latency |
| --------------------------- | ----------------- | ---------- | ----------- |
| 50k (deployed)              | 12s               | 150KB      | 54ms        |
| 100k (projected, FAISS IVF) | 8min              | 500KB      | 58ms        |
| 1M (projected, DiskANN)     | 90min             | 6.2GB      | 62ms†       |

†Projected from extrapolation; not empirically validated at this scale. The reference deployment is approaching the 50k ceiling; scaling observations beyond it are forthcoming rather than reported here.

### 8.3 Ethical Considerations

Instant Recall indexes personal interaction history, including potentially sensitive content. The local-first architecture (no cloud embedding storage, no external API calls for retrieval) mitigates data exfiltration risks. However, the index itself — a JSON file mapping anchor terms to memory paths — is a condensed summary of what the agent knows about its user. Deployments should encrypt the index at rest and restrict file-system access. The importance scoring system (§4.8) introduces implicit content prioritization that could surface sensitive memories preferentially; operators should review weight configurations for their context. The bi-temporal store (§4.9) also retains superseded facts indefinitely; a retention or hard-delete policy for closed validity intervals is a deployment responsibility.

### 8.4 Reproducibility

The annotated CORF dataset is drawn from one deployment's logs and is small. To let other researchers reproduce the failure-mode taxonomy without access to private logs, a complementary synthetic CORF generator — seeding pronoun-blind, source-split, and anchor-silent queries against a controlled corpus — is planned. The synthetic set would not replace the deployment benchmark but would make the taxonomy testable in isolation.

## 9. Conclusion

This paper introduced CORF as a formal framework for diagnosing retrieval failures in persistent agents and showed that the dominant failure mode is architectural — rooted in source fragmentation and anchor vocabulary gaps — rather than embedding quality. The source-coverage upper bound (§3.3) makes this precise: no amount of query refinement compensates for unsearched sources.

Instant Recall resolves these failures by shifting retrieval from inference time to build time. A pre-computed concept index, rebuilt nightly and kept fresh by real-time episodic updates, maps anchor vocabulary terms to pre-ranked memory clusters. At inference time, a ~50ms lookup surfaces relevant memories before the model processes the prompt — achieving 0.85 CORF-Recall@20 at the lowest latency of any evaluated system. Concept anchoring accounts for 9 points of recall beyond what source aggregation alone provides, and post-retrieval re-ranking halves the false positive rate. Beyond similarity, the index now weights validity over time, code-trust, and inter-chunk links — because the closest chunk is not always the right one, and a fact that was true last month may be false today.

The deeper insight is architectural: Instant Recall transforms agent memory from a _search problem_ into a _recognition problem_. The agent stops asking "what papers are you referring to?" — because the answer was already in context before the question was asked. It is the indexing organ, not the store; and like its biological model, it is the difference between having memories and being able to use them.

## References

1. Lewis, P., et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. _NeurIPS 2020_.
2. Packer, C., et al. (2023). MemGPT: Towards LLMs as Operating Systems. _arXiv:2310.08560_.
3. Sarthi, P., et al. (2024). RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval. _ICLR 2024_.
4. Collins, A. M., & Loftus, E. F. (1975). A spreading-activation theory of semantic processing. _Psychological Review_, 82(6), 407–428.
5. Teyler, T. J., & DiScenna, P. (1986). The hippocampal memory indexing theory. _Behavioral Neuroscience_, 100(2), 147–154.
6. Squire, L. R. (1992). Memory and the hippocampus: A synthesis from findings with rats, monkeys, and humans. _Psychological Review_, 99(2), 195–231.
7. Wilson, M. A., & McNaughton, B. L. (1994). Reactivation of hippocampal ensemble memories during sleep. _Science_, 265(5172), 676–679.
8. Tulving, E. (1976). Ecphoric processes in recall and recognition. _Recall and Recognition_, 37–73.
9. Mandler, G. (1980). Recognizing: The judgment of previous occurrence. _Psychological Review_, 87(3), 252–271.
10. Yonelinas, A. P. (2002). The nature of recollection and familiarity: A review of 30 years of research. _Journal of Memory and Language_, 46(3), 441–517.
11. MemoryOS. (2024). Mem0: The Memory Layer for Personalized AI. _arXiv:2504.19413_.
12. Serra, O. (2026a). Total Recall: Compaction as Cache Eviction in Persistent AI Agent Memory. _Independent Research_.
13. Serra, O. (2026b). Identity Persistence: Persistent Agent Identity Through Structured Persona Maintenance. _Independent Research_.
14. Serra, O. (2026d). Humor Embeddings: Bisociation in Embedding Space for Humor Generation. _Independent Research_.
15. Serra, O. (2026e). Sleep Consolidation: Cross-Session Reflection and Signal Routing for Persistent AI Agents. _Independent Research_.
16. Park, J. S., et al. (2023). Generative Agents: Interactive Simulacra of Human Behavior. _UIST 2023_.
17. Zhong, W., et al. (2023). MemoryBank: Enhancing Large Language Models with Long-Term Memory. _arXiv:2305.10250_.
18. Manning, C. D., Raghavan, P., & Schütze, H. (2008). _Introduction to Information Retrieval_. Cambridge University Press.
19. Guu, K., et al. (2020). REALM: Retrieval-Augmented Language Model Pre-Training. _ICML 2020_.
20. Borgeaud, S., et al. (2022). Improving language models by retrieving from trillions of tokens. _ICML 2022_.
21. Xu, X., et al. (2025). A-MEM: Agentic Memory for LLM Agents. _arXiv:2502.12345_.
22. Wu, D., et al. (2024). LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memory. _arXiv:2410.10813_.
23. Yan, Z., et al. (2025). Memory-R1: RL-Trained Memory Management for LLM Agents. _arXiv:2505.14075_.
24. Gama, J., et al. (2014). A survey on concept drift adaptation. _ACM Computing Surveys_, 46(4), 1–37.
25. Scoville, W. B., & Milner, B. (1957). Loss of recent memory after bilateral hippocampal lesions. _Journal of Neurology, Neurosurgery & Psychiatry_, 20(1), 11–21.
