WorksComputer Science
Reglos: A Self-Evolving Personal Memory Agent with Recursive Self-Improvement
Abstract
Personal agents draw on past conversations to tailor their responses to each user. Their memory systems store and update what each user says, and coding agents now also rewrite the harness that turns this memory into the model's context. Such patches risk overfitting, because one tested only on the failures it targets can fix those cases and help nowhere else. We present Reglos, a training-free personal memory agent that tests whether harness changes help beyond the failures they were written to fix. Its self-evolving memory adds to each user's append-only record with every conversation, as new preferences supersede old ones and facts can be forgotten. Its harness improves through recursive self-improvement, in which a coding agent proposes patches from failure traces and a critic from a second model family screens each one for benchmark gaming. After the harness is frozen, a fixed evaluator decides which further patches to accept. With the same backbone behind every system, Reglos outperforms state-of-the-art memory systems such as Mem0, MemOS and EverOS, reaching 61.3% and 84.0% on PersonaMem-v2 and LongMemEval-S with Qwen3.8-27B, and 57.5% and 87.2% with GPT-5.6 Luna.
Website: https://reglos.ai
Introduction
A personal assistant that talks with the same user for months has to keep track of what that user prefers ([12] (Hu et al. 2025)). Some of those preferences change, and the user may later ask the assistant to forget others. Reading the whole history handles this poorly, and even frontier models often miss a preference the user only implied or keep applying one that has changed ([12]). Memory systems keep what each user says across conversations and recall it when the model answers ([25, 4, 27] (Li et al. 2025; Hu et al. 2026)). How well they work depends on what they store and on the code that decides what to recall and how to show it to the model, which we call the harness.
Although these systems update what they store as the user talks, the harness itself is usually written by hand and revised between releases. Recent work hands that job to coding agents, which evolve memory programs and pipelines against benchmarks ([19, 3, 43]).
A benchmark score alone leaves one question open: does a change help users whose failures nobody inspected while writing it?
Our own development data show why that question matters. A memory can be stored correctly and still be used wrongly: in 31% of the failures we traced, the evidence the model needed was already in its context (Section 4.1). Those are failures of the harness, and a coding agent can patch them, but a patch judged on the cases that prompted it can look better than it is. A prompt-only search over the harness text in the style of GEPA ([1]) gained 3.8 points on the questions it was selected on and 1.1 on questions it had never seen.
These failures point to two kinds of change with different owners. A user’s memory changes whenever that user talks, and an error in it is best fixed then, inside that user’s record. The harness serves every user at once, so a change to it can help some users and hurt others, and that is where overfitting happens. We therefore argue that a personal memory system should improve at two time scales: its memory online as each user talks, and its harness offline through changes that a fixed evaluator accepts only after testing them on held-out users. We present Reglos, a training-free personal memory agent built on this principle (Figure 2). Its inner loop is a self-evolving memory. Each fact enters an append-only record that stores when it holds and when it was learned, so a new preference can supersede an old one without erasing it. A request to forget expires the matching facts, and a nightly pass rewrites the profile from the user’s current facts. Because these states are explicit, the harness can tell the model which of two conflicting preferences is current and what it must not use. Its outer loop improves the harness through recursive self-improvement. A coding agent reads failure traces and writes patches, and a critic from a second model family clusters the same failures and rejects patches that game the benchmark. After the harness is frozen, a fixed evaluator accepts a patch only if it helps users held out from development. The two loops co-evolve. The outer loop learns from the failures of the memory the inner loop builds, and each accepted patch changes how that memory is written and read. Qwen3.8-27B writes memory throughout.
Figure 2. Reglos improves on two time scales: each user’s memory evolves online (inner loop), and the harness that turns memory into context for a frozen model is recursively improved offline (outer loop). The brain-region labels name the write buffer (hippocampus) and the nightly profile (cortex); the proposer is a coding agent.
With Qwen3.8-27B writing memory for every system, Reglos outperforms Mem0, MemOS and EverOS on PersonaMem-v2, LongMemEval-S and LoCoMo, whether Qwen3.8-27B or GPT-5.6 Luna answers (Figure 1). On the official PersonaMem-v2 benchmark split it reaches 61.3%, 7.5 points above the strongest of them; the best published result we found is 57.2%, obtained with a GPT-4.1-mini reader ([20]). On LongMemEval-S it reaches 84.0%, 3.6 points above EverOS. With GPT-5.6 Luna answering, it scores 57.5% and 87.2% and again leads both benchmarks. Within the outer loop, the coding agent’s accepted patches lift the harness from 54.2% to 60.7% on the validation questions.
Figure 1. Qwen3.8-27B writes memory for every system and answers in the top panel; GPT-5.6 Luna answers in the bottom panel. Reglos leads on PersonaMem-v2 and LongMemEval-S. Details in Table 1.
Our contributions are:
A self-evolving personal memory agent. Reglos keeps an append-only memory for each user that records how preferences change and what the user asked to forget (§ 3).
Recursive self-improvement of the harness. A coding agent proposes patches from failure traces, a critic from a second model family screens them, and after the freeze a fixed evaluator decides which further patches to keep (§ 3.4 and § 4.3).
Training-free results across backbones. Reglos outperforms Mem0, MemOS and EverOS on three benchmarks under two answering models and exceeds the best published result under PersonaMem-v2’s official protocol (§ 4).
Related Work
Memory Systems and Benchmarks. Early memory for LLM agents paged information in and out of a bounded context [25] or kept a stream of observations with periodic reflection [26]. Production systems now extract and reconcile facts [4], build temporal knowledge graphs [27], link notes (Xu et al. 2025) or manage memory as an operating system (Li et al. 2025; Hu et al. 2026); Hu et al. (2025) survey the space. Benchmarks have moved from recalling facts in long dialogues (Maharana et al. 2024; Wu et al. 2025) to inferring implicit, evolving preferences [11 b] and to long agent trajectories (Zhao et al. 2026). Two diagnostic studies shape our evaluation. Most memory systems fall below naive retrieval over the raw history on PersonaMem-v2 (He et al. 2026), so we report raw retrieval with our own answer policy as a control. On LoCoMo, most failures arise at retrieval [40]; on PersonaMem-v2 we find most reachable failures after retrieval, when the answering model already holds the evidence (Section 4).
Self-Evolving Agents and Memory. Self-evolving agents improve from their own interaction data and feedback [6] (Gao et al. 2026); without retraining the underlying model, they reflect on failures [28, 21], accumulate skills [31], or grow an evolving context or prompt [1] (Zhang et al. 2026d). Memory is a common place where this evolution happens. MemEvolve meta-evolves how experience is encoded, stored and retrieved [43], EvolveMem tunes retrieval configurations from failure logs [18], MemSkill and SelfMem evolve memory skills and strategies [44, 39], and MindMemOS evolves memory schemas and consolidates them by dreaming [16]; Memory-R1, Mem- and Mem-T instead train the memory manager with reinforcement learning [38, 32, 41]. Reglos’s inner loop is self-evolution of this kind, applied per user under fixed rules (supersession that keeps history, retraction that records the request, and user edits).
Recursive Self-Improvement. In the sense of Duan et al. [5], recursive self-improvement (RSI) is an autonomous, closed loop whose changes persist and alter later improvement. One line of recent work trains the model inside that loop [17, 42]. Another is training-free and evolves the harness around a frozen model [14, 13] (Zhang et al. 2026c), and some systems combine the two [33] (Su et al. 2026). RSI has also reached memory: MemPro, PrisMem and ALMA evolve the memory pipeline as code [19, 3, 35], and DACCI gates memory changes with statistical tests [20]. Reglos belongs to the training-free harness line, at the level of strategy autonomy: a coding agent proposes harness code, the task model stays frozen, and a fixed evaluator decides which changes to keep.
Reglos
Reglos pairs an online loop that updates each user’s memory with an offline loop that recursively improves the harness supplying context to the frozen model, and the two co-evolve (Figure 2). The same memory service serves our own app, and Appendix A gives its thresholds and limits.
Inner Loop: Self-Evolving Memory
From conversation to facts. Each user’s memory grows from what that user says. New messages wait in a buffer until there are enough to be worth reading, and the task model then extracts the facts, commitments and requests to forget that they contain. Before any of this text reaches a model,
secrets such as keys and card numbers are masked. Once extracted, each candidate is compared with the facts already stored. One batch call then decides whether it is new, already known, a replacement for an older fact, or extra detail for one. The accepted facts are kept in the language the user spoke and indexed for recall.
An append-only record. Every fact keeps the identifiers of its source messages, a perspective (the user’s own belief, an objective fact, or something the assistant said) and two times: when the fact holds and when the system learned it. A fact’s text is never rewritten, so a change of mind closes the old fact’s validity and leaves it in the record, where the history of a preference stays readable. A request to forget expires the matching facts and records the request itself, which the harness later shows the model with the rule never to rely on it. Figure 3 follows one user through these cases. Users can also inspect, correct, delete and undo any memory in the app.
Figure 3. One user’s record across three sessions. A change of mind closes the old fact and keeps it, a request to forget expires the fact and stays as a rule, and recall shows the model which version holds.
Consolidation and recall. The record is condensed as well as kept. Each night a pass called Dream summarizes the day’s sessions and rewrites the user’s profile from the facts that are still current. When a question arrives, recall searches the facts through six routes at once: three on content (vector, keyword and entity graph), two anchored on the time and place the question mentions, and recency. The content routes decide what can come back. Time, place and recency only raise facts that a content route has found, unless no content route finds anything, and a fact found by recency alone is dropped. The routes are fused by reciprocal rank fusion into a fixed token budget, and an explain call reports which route surfaced each item.
Engine and Serving
A Rust kernel and a Python harness. The memory kernel is a Rust service. The harness, the benchmark drivers and the outer loop are written in Python and call it over HTTP. The split sets what a candidate costs the outer loop. A harness change is scored on the memories already stored, while an engine change must re-ingest every history.
One database. The kernel keeps every layer of memory, and the work queue that maintains it, in a single PostgreSQL 16 database. The indexes behind recall’s three content routes live there too, as embedding columns beside the facts, a trigram index and a relational graph table, so no separate vector store is needed. Recall scans each user’s rows exactly. One user holds a few hundred to a few thousand facts, and an approximate index filtered down to one user can silently return fewer of them than asked. Extraction and Dream run as jobs that workers lease from the same database, so several instances share the load and a job interrupted by a crash is picked up when its lease expires.
Writes that never lose a fact. A candidate that matches a stored fact after normalization (case, width, spacing and punctuation) only confirms the stored row, with no model call. If the batch adjudication fails, every candidate is kept as new, so a model error can duplicate a fact but never lose one. Model calls back off for about three minutes on rate limits and server errors. With the model’s reasoning disabled, the engine uses a quarter of the output tokens and 2.6 seconds per model call against 9.3.
The Harness
The harness is the program that sits between the memory kernel and the frozen task model and determines what the model reads. It receives the question, together with its answer options where the benchmark provides them, but has no access to the dataset’s labels. Memory is reachable only through a narrow interface: recall, the list of stored items, the user’s profile and the source messages of each fact. Within this interface the harness may issue several recall queries, filter and rank the results across memory layers, and decide how the evidence is organized. These decisions form the search space of the outer loop (§ 3.4).
Each context opens with a memory-use policy and the user’s requests to forget, followed by the profile, the recalled facts with superseded ones marked as no longer true, and a small number of session summaries and raw excerpts. For multiple-choice questions the harness also retrieves evidence for each option. The options of a question typically share a template, so recall on the full option text returns nearly the same facts for all of them; the harness therefore queries with the terms that distinguish each option from the others. This per-option retrieval was the final step accepted by the outer loop (§ 4.3).
The policy specifies how the model should interpret the states that the record encodes. The model must not rely on facts the user asked to forget or on preferences that are no longer current, and it must keep the preferences of other people separate from the user’s own. Further rules address what the record cannot encode: the memory is incomplete, preferences must not be inferred from demographic attributes, and sensitive identifiers must not appear in the answer. Appendix A gives the full policy.
Outer Loop: Recursive Self-Improvement Setting
Setting. We evolve the harness on PersonaMem-v2 ([12]), whose four-way questions turn on implicit, revised or retracted preferences, on preferences that belong to someone else, and on information the user asked not to repeat. Qwen3.8-27B (reasoning off) writes memory and answers throughout. The loop sees only the validation split. We report all PersonaMem-v2 results on the official 5,000-question test set. We scored it once after the freeze and never read its failures (Appendix C).
Proposer, critic and evaluator. The proposer is the coding agent Claude Code [2] running Claude Opus 5.5. It reads raw failure traces and writes a patch to the harness, following the finding that raw traces carry more signal than summaries ([14]). The critic is Codex [24] running GPT-6.1 Sol, so the proposer and the critic come from different model families. The critic clusters the same failures independently and rejects any patch keyed to the dataset’s option templates or labels. A fixed evaluator then decides. After the freeze, every candidate faces the rule of Figure 4: it must gain on each of two persona-disjoint validation halves (1,317 questions) and may cost a second reader at most one point; GPT-5.6 Luna is that reader and answers from the same context. Humans fix the objective, the splits and the rule; the proposer decides what to change. In the taxonomy of Duan et al. [5] this is strategy autonomy (L2), and the inner loop is environment adaptation (L4); Appendix C maps both loops onto their components.
Figure 4. After the freeze, a patch replaces the current harness only if it passes the critic’s review and every test of the fixed evaluator.
Trajectory. Five accepted steps built the harness before we froze it as v3, the harness behind every result in this paper; Section 4.3 traces them on the validation questions.
Results
Models. Qwen3.8-27B runs in non-thinking mode through Alibaba Cloud’s DashScope API, and qwen3.7-text-embedding supplies every embedding. The EverOS store for BEAM-100K and the no-memory LoCoMo row with Qwen3.8-27B used the same unquantized weights served locally. GPT-5.6 Luna answers with its default reasoning setting.
Baselines. MemOS and EverOS run self-hosted; Appendix § 9 describes their PersonaMem-v2 configurations. Mem0 uses its open-source extraction prompts and retrieval scoring, with its add and search logic running on an in-process store. Zep runs through its open-source Graphiti engine. gpt-5.5 judges LongMemEval-S and LoCoMo (categories 1 to 4), and OmniMemEval’s rubric grader with gpt-5.5 scores BEAM. BEAM-100K and BEAM-500K each use ten sampled conversations with 200 questions. Full context keeps the newest 400k characters of a history.
PersonaMem-v2
Reglos is best on PersonaMem-v2 with both readers. Table 1 compares each system in its standard configuration, with Qwen3.8-27B writing memory in every row and answering in its left half. Reglos reaches 61.3%, 7.5 points above the strongest competitor and 12.0 above the same model reading the full history. With GPT-5.6 Luna answering from the same memories, Reglos reaches 57.5%, 6.9 points above the strongest baseline and 12.9 above the full history. Two controls test whether our policy or our harness alone explains the lead. Our memory-use policy lifts every baseline by 3 to 6 points, and EverOS with the policy still trails Reglos by 2.5. Raw retrieval inside the Reglos harness scores 58.1%, so the memory pipeline adds 3.2 points under the same harness (Table 2), the comparison memory systems are asked to report (He et al. 2026). Under the official protocol the best published result we found is 57.2%, from MemStack with a GPT-4.1-mini reader [20].
| Method | Qwen3.8-27B PM-v2 | LME-S | LoCoMo | BEAM 100K | BEAM 500K | GPT-5.6 Luna PM-v2 | LME-S | LoCoMo | BEAM 100K | BEAM 500K |
| Context baselines | ||||||||||
| No memory | 40.0 | 6.0 | 0.1 | 26.6 | 23.3 | 30.6 | 6.8 | 0.1 | 27.2 | 25.3 |
| Full context | 49.3 | 68.0 | 86.6 | 57.3 | 40.8 | 44.6 | 68.8 | 90.0 | 56.0 | 39.9 |
| Raw retrieval | 53.3 | 78.8 | 84.7 | 64.2 | 57.2 | 50.6 | 80.8 | 88.1 | 60.7 | 55.5 |
| Memory systems | ||||||||||
| Mem0 ([4]) | 45.0 | 65.6 | 57.8 | 69.4 | 66.8 | 45.2 | 64.4 | 62.4 | 68.8 | 59.9 |
| MemOS (Li et al. 2025) | 53.8 | 73.0 | 75.7 | 67.0 | 62.9 | 50.5 | 74.0 | 78.8 | 64.4 | 61.3 |
| EverOS (Hu et al. 2026) | 53.6 | 80.4 | 81.5 | 69.5 | 58.3 | 49.6 | 80.0 | 86.1 | 67.5 | 57.0 |
| Reglos (ours) | 61.3 | 84.0 | 87.2 | 67.9 | 65.6 | 57.5 | 87.2 | 89.5 | 65.9 | 65.0 |
Table 1. Results with two answering models. Qwen3.8-27B writes memory in every row. PM-v2: PersonaMem-v2; LME-S: LongMemEval-S; BEAM: mean rubric score. Best in bold, second underlined.
| Baseline with our components | Accuracy | Reglos lead |
| EverOS + policy | 58.9 | +2.5 |
| MemOS + policy | 58.4 | +3.0 |
| Raw retrieval in Reglos harness | 58.1 | +3.2 |
| Full context + policy | 55.6 | +5.7 |
| Mem0 in Reglos harness | 50.5 | +10.8 |
| Reglos | 61.3 |
Table 2. Baselines given our memory-use policy or our harness, with Qwen3.8-27B answering. Reglos still leads every one.
Reglos’s lead comes from sensitive information and forgetting. Figure 5 breaks the results down by question type.
Figure 5. PersonaMem-v2 accuracy by question type, with Qwen3.8-27B answering. Reglos leads most on sensitive information and forgetting.
On sensitive-information questions Reglos answers 91.4%, against 42.9% to 47.6% for the other memory systems. Where the user asked to forget, Reglos answers 63.1%, well ahead of EverOS (42.8%) and Mem0 (11.8%) and close to MemOS (61.3%). The tombstone and the memory-use policy target these two types, because they tell the reader what it must not use. On the five ordinary preference types EverOS is ahead on four, by 0.8 to 2.0 points on three and by 8.3 points on health conditions, and Reglos is ahead on therapy background. Split instead by whose preference a question turns on, one group is below chance for every system: preferences that belong to someone other than the user (19.0% to 20.5% on 522 questions).
The largest share of remaining errors asks for facts the user never stated. On the development slices we traced 159 failures of the task model to the layer responsible, with a stronger model checking each case (Table 3). In 48% the fact needed was never stated in the conversation, so no memory system could answer from the history; in 31% the evidence was in the context and the reader chose wrongly; in 16% the fact was in the conversation but never written to memory; in 4% it was written but not recalled. Among failures whose evidence exists in the history, reader errors form the largest group.
| Where the failure arises (159 traced) | Share |
| Fact never stated in the conversation | 48% |
| Evidence in context, reader chose wrongly | 31% |
| Stated but never written to memory | 16% |
| Written but not recalled | 4% |
Table 3. Where 159 traced development failures arise.
Generalization Across Benchmarks
Reglos leads the memory systems on LongMemEval-S and LoCoMo with both readers. Table 1 reports the other benchmarks. On LongMemEval-S (Wu et al. 2025) Reglos reaches 84.0% with Qwen3.8-27B and 87.2% with GPT-5.6 Luna, ahead of the next system by 3.6 and 6.4 points. Without the 54 questions used during development Reglos stays first (83.4%, against 79.8% for raw retrieval and 79.4% for EverOS); ten EverOS questions that never finished processing count as wrong, which costs it at most 2.0 points. On a 100-question sample with the same model, Zep (Rasmussen et al. [27]) answers 34.0%, against 79.0% for Reglos.
On LoCoMo (Maharana et al. [22]) Reglos exceeds EverOS by 5.7 points with Qwen3.8-27B and by 3.4 with GPT-5.6 Luna; with GPT-5.6 Luna the full history reaches 90.0% and Reglos 89.5%. LoCoMo histories are short enough that Reglos passes the reader the full dated history, so these numbers measure the reader and the prompt.
On BEAM (Tavakoli et al. [30]), scored with OmniMemEval’s rubric grader (MemTensor [23]), Reglos ranks first at 500K tokens with GPT-5.6 Luna (65.0 against 61.3 for MemOS). With Qwen3.8-27B it scores 65.6 there, 1.2 points behind Mem0. At 100K tokens it ranks third with both readers, 1.6 and 2.9 points behind the leader. On a 1M-token sample of two conversations and 40 questions, Reglos scores 67.6 against 64.3 for Mem0.
Reglos leads on multi-session and temporal questions. With Qwen3.8-27B answering, Reglos ranks first on the two largest LongMemEval-S question types (Table 4): 76.7% against 72.9% for EverOS on multi-session questions and 84.2% against 83.5% on temporal ones. Its largest margin over EverOS is on what the assistant said earlier (98.2% against 67.9%). The extracted facts hold mostly what the user said, and Reglos keeps raw conversation excerpts beside them. Raw retrieval returns conversation rounds and reaches 100.0% on this type. Its one clear weakness is the 30 preference questions, where EverOS and Mem0 lead by 13 to 17 points. On LoCoMo with Qwen3.8-27B, Reglos leads the memory systems in every category, by 6.2 points on single-hop and 10.0 on multi-hop questions over EverOS (Table 7). At BEAM-500K with Qwen3.8-27B, Reglos is ahead of Mem0 on temporal reasoning, abstention and contradiction resolution, and Mem0 is ahead on multi-session reasoning and knowledge updates.
| Type (n) | Reglos | EverOS | RAG | MemOS | Mem0 |
| Multi-session (133) | 76.7 | 72.9 | 66.9 | 66.2 | 64.7 |
| Temporal (133) | 84.2 | 83.5 | 75.2 | 75.2 | 43.6 |
| Knowledge update (78) | 85.9 | 85.9 | 88.5 | 79.5 | 75.6 |
| User facts (70) | 94.3 | 94.3 | 90.0 | 88.6 | 88.6 |
| Assistant said (56) | 98.2 | 67.9 | 100.0 | 60.7 | 73.2 |
| Preferences (30) | 60.0 | 76.7 | 56.7 | 63.3 | 73.3 |
Table 4. LongMemEval-S accuracy by question type, with Qwen3.8-27B answering. RAG: raw retrieval.
| Category (n) | Reglos | EverOS | MemOS | Mem0 |
| Single-hop (841) | 92.9 | 86.7 | 81.3 | 74.2 |
| Multi-hop (282) | 83.0 | 73.0 | 69.1 | 72.7 |
| Temporal (321) | 83.2 | 82.9 | 72.6 | 5.0 |
| Open-domain (96) | 63.5 | 56.2 | 56.2 | 46.9 |
Table 7. LoCoMo accuracy by category, same runs as Table 1; Reglos reads these short histories in full. Mem0 stores memories without dates, hence its temporal score.
The Outer Loop
The coding agent lifted the harness by 6.5 points. After the engine patch, four accepted steps took the harness from 54.2% to 60.7% on the 1,317 validation questions, overtaking the full history given the same policy (55.0%) at its first step (Figure 6). Table 5 lists the steps; the largest single gain came from a revised policy that treats memory as incomplete and keeps sensitive identifiers private. The final harness carries over to the held-out benchmark split, where the same model rises from 49.3% reading the full history to 61.3% (Table 1).
Figure 6. The coding agent lifts the harness from 54.2% to 60.7% in four accepted steps on 1,317 validation questions. Dashed: full history with the same policy.
| Step | Change | Acc. |
| engine | conversation-language storage; forget as retraction; implicit-preference rule | |
| seed | harness before any accepted harness step | 54.2 |
| v1 | + forgotten facts in context + memory-use policy | 57.1 |
| v2 | + per-option recall (full option text) | 56.4 |
| v3a | + revised policy (incomplete memory; sensitive identifiers) | 60.2 |
| v3 | + per-option recall on distinct words + raw excerpts | 60.7 |
Table 5. Accepted steps of the outer loop, scored on the 1,317 validation questions with the same stored memories. The engine patch changes what is stored and is part of every row below it.
Forgetting as retraction. In the seed engine a message such as “please forget that I take sertraline” was stored as an emphasized memory, because the extraction prompt read it as a request to remember. On questions that test forgetting the correct option is the generic one, and the seed answered none of nine development cases. Retraction with a tombstone, and a policy line that forbids relying on anything listed as forgotten, raised this to eight of nine on development and twelve of fourteen on a held-out slice.
Evidence the reader never saw. Many preferences sat in raw conversation excerpts without being extracted, and recall driven by the question could not reach them, because the question does not name the preference. Recall run once per answer option, with the words that distinguish that option, finds them. Together with the policy revision between them, the steps from v1 to v3 raised accuracy from 54% to 68% on a 50-question held-out slice.
What it costs. Writing one persona’s 32k-token history to memory costs about 225k to 260k task-model tokens (roughly 7.5 times the history) and 40k embedding tokens, amortized over 25 questions per persona. Answering costs about 6.0k prompt tokens per question, so judging one candidate on 1,317 questions with two readers takes about 16M prompt tokens. Writing memory for the 200 test personas took about 50M task-model tokens and six hours at eight-way concurrency.
Memory over a Growing History
Accuracy holds as more is written. To test whether memory degrades as a history grows, we wrote only the first 25, 50, 75 or 100% of each history for 40 personas of the benchmark split and asked the 296 questions whose evidence lies in the first quarter (Figure 7). Reglos stays between 55.7% and 60.5%, from 59.1% at the first quarter to 60.5% with the full history, and leads at every prefix, by 1.0 to 5.1 points over raw retrieval and by 3.7 to 10.5 points over the full history, both with our policy.
Figure 7. Accuracy on early-history questions as more of each history is written (296 questions, 40 personas, Qwen3.8-27B answering).
Discussion
What the loop found. Each accepted change, from how a request to forget is recorded to what recall asks for, began as a failure trace that the coding agent read and turned into code.
The ceiling and the hardest slice. In our development audit about half of the remaining errors could not be answered from the history at all, which puts the ceiling for a perfect reader near 80%, and most of the reachable half are reader decisions bounded by the task model’s ability (Zhou 2026). Preferences that belong to other people stay below chance for every system: a preference stated about a sister or a colleague is extracted as the user’s, and every later layer trusts it. The fix belongs in the write path, with provenance that survives consolidation.
Limitations. One open 27B model writes memory for every system; Reglos remains first on PersonaMem-v2 and LongMemEval-S when GPT-5.6 Luna answers. The published number we compare with uses a different reader (GPT-4.1-mini). The LoCoMo result rests on reading short histories in full, and on BEAM the systems sit within a few points of each other.
Next steps. The next step in the taxonomy of Duan et al. [5] is a loop that chooses which experience to gather. The product already records when users correct, delete or undo a memory; turning those events into the failure traces the proposer reads, behind the same evaluator, is the step we are taking next ([16, 37]). A second direction is to stop holding the model fixed. Everything here was gained with a frozen model, and most errors that memory can still fix are reader decisions, so training the model that writes and reads memory is the complementary step. Reinforcement learning on memory construction and use is an active direction ([32, 38]), an RL-trained 4B agentic memory reaches 55.2% on PersonaMem-v2 ([12]), and harness search can alternate with training on the policy ([33]). Further on, the record’s operations (add, supersede, retract, consolidate, recall) could become the training objective of a memory foundation model. A third direction is modality: in our benchmark runs images enter memory only as captions, and the record, recall and redaction should extend to images, voice and the screen, under the same rules for supersession and forgetting.
Conclusion
We presented Reglos, a personal memory agent whose two loops co-evolve at two time scales: each user’s memory evolves online in an append-only record, and the harness that turns memory into context evolves offline through patches that a coding agent proposes and a fixed evaluator scores. With one frozen open 27B model and a training-free pipeline, Reglos outperforms the memory systems we compared on PersonaMem-v2, LongMemEval-S and LoCoMo with either answering model, and exceeds the best published result under PersonaMem-v2’s official protocol. Its main limit is the reader itself: most errors that memory can still fix are decisions made with the evidence in view. We plan to feed users’ own corrections back into the outer loop as experience.
Acknowledgments
We thank Boqin Yuan for many helpful discussions on the experiments and the writing, and for advice throughout the project.
Implementation Details
This appendix gives the thresholds and limits behind § 3.
Services and storage. The kernel consists of a memory library, a memory service that exposes it over HTTP, and a model service that presents an OpenAI-compatible interface and fails over between providers on network errors, rate limits and server errors. Embeddings are 1024-dimensional columns on facts, conversation chunks and sessions. An exact scan of one user’s facts takes milliseconds. Jobs (extraction, re-indexing and Dream) are rows that workers claim under a ten-minute lease, so several instances share the work without coordinating.
The record. Every memory is a fact row with a statement, a predicate, the entity it is about, a perspective (an objective fact, a belief or preference of the user, or something the assistant said), a confidence, and the identifiers of its source messages. Two time axes are stored separately: the interval during which the fact holds (valid from, valid to) and the system’s own timeline (ingested at, and expired at once the row is retired). Only the validity and expiry fields of a row ever change. When a new statement supersedes an old one, the old row receives an end of validity and stays in the record, so a question about an earlier period can still be answered. A request to forget expires the matching facts with a reason, and a tombstone fact records the request so that recall, summaries and the profile all honor it. A fact matches when its cosine similarity to the request is at least 0.68 or its trigram overlap at least 0.6; a request to forget expires at most six facts and a correction at most two, and background
The write path. Incoming turns pass through a buffer and a redaction step that replaces keys, card numbers and identity numbers with placeholders. The model then proposes candidate facts, commitments and retractions. A candidate whose normalized key (case, width, spacing and punctuation) matches a stored fact only confirms that fact, and a single batch call decides for each remaining candidate whether it is new, a duplicate, a replacement, a coexisting fact or an enrichment of an existing one. Facts, summaries and the profile are stored in the language of the conversation.
Recall. The three content routes are dense vector search, keyword search and traversal of the entity graph. The two anchor routes match a time window, interpreted in the configured time zone against both when a fact was recorded and when its event happened, and a scene or location. A question that names no time skips the time route. Fusion is weighted reciprocal rank fusion (), cut to 45 items and packed in rank order into 8,100 tokens; both limits widen for questions that ask to enumerate. Each route has a 2.5-second timeout, and a route that times out is reported while the others’ results are returned. For every item, explain returns the routes that found it, its rank on each, its fusion contribution and its validity state.
Consolidation. Dream flushes the write buffer, summarizes each session, rebuilds the profile from the user’s current facts and rewrites it. It runs for each user once a night after an hour of inactivity, and a session pending for more than thirty hours is scheduled regardless of the hour. Consolidation never deletes rows of the record; it produces summaries and the profile, which recall draws on next to the facts and raw excerpts.
The memory-use policy. The policy is the opening block of the system message that carries the recalled memory (§ 3.3). The model receives it verbatim:

Figure policy. Prompt: memory-use policy
How to use this memory
Personalize with the user’s OWN, current preferences; prefer the response grounded in a specific remembered detail about this user.
This memory is incomplete. A response that mentions a plausible detail about the user that the memory does not contain is not wrong for that reason alone; reject a response only when the memory contradicts it.
Never rely on anything the user asked to forget (listed below). A response personalized around such a detail is wrong; prefer one that does not use it, even if it is more generic.
If a preference is marked as no longer true, do not use the old one.
Preferences of other people (friends, family, colleagues, recipients) are not the user’s own.
Do not assume preferences from demographics or stereotypes.
Never repeat sensitive identifiers back to the user (passport or ID numbers, account or card numbers, email addresses, phone numbers, home addresses, file paths or project names that reveal a person or organization, credentials). When the request contains such data, the better response withholds or redacts it.
Controls and Variants on PersonaMem-v2
Table 6 lists every PersonaMem-v2 run behind Table 1. Each baseline appears first in its standard configuration, followed by up to three variants. In a + policy row, the baseline’s answer prompt also carries the memory-use policy that Reglos gives its reader (Appendix A). An in Reglos harness row reads the baseline’s memory store through the Reglos harness, with our recall and per-option evidence in place of its own. MemOS and EverOS follow the PersonaMem-v2 setup of the OmniMemEval harness [23]: 20-message sessions and top-20 retrieval, with only the models replaced. That setup leaves out the persona description that opens each conversation, which full context, Mem0 and Reglos all receive. A + persona card row adds this description to the start of the answer prompt and answers from the same retrieved memories, without writing memory again. MemOS’s retrieved preference note carries its own one-line instruction not to violate the user’s preferences.
| System | Accuracy | Reglos lead |
| No memory | 40.0 | +21.3 |
| + policy | 43.1 | +18.2 |
| Full context (official) | 49.3 | +12.0 |
| + policy | 55.6 | +5.7 |
| Raw retrieval | 53.3 | +8.0 |
| + policy | 58.0 | +3.3 |
| in Reglos harness | 58.1 | +3.2 |
| Mem0 | 45.0 | +16.3 |
| + policy | 49.0 | +12.3 |
| in Reglos harness | 50.5 | +10.8 |
| MemOS (OmniMemEval) | 53.8 | +7.5 |
| + policy | 58.4 | +3.0 |
| + persona card | 52.3 | +9.0 |
| + policy + persona card | 57.2 | +4.1 |
| EverOS (OmniMemEval) | 53.6 | +7.7 |
| + policy | 58.9 | +2.5 |
| + persona card | 52.6 | +8.7 |
| + policy + persona card | 58.4 | +3.0 |
| Reglos | 61.3 |
Table 6. Every control and variant on PersonaMem-v2, with Qwen3.8-27B. Reglos leads all of them.
The Outer Loop in Full
The two loops as improvement loops. A self-improving system can be described by its components, with its autonomy graded in levels [5]. The components include the target the system changes, the experience it learns from, the improver and the verifier. Table 8 maps both loops of Reglos onto this framework.
| Inner loop (per user, in deployment) | Outer loop (the harness, offline) | |
| Target | that user’s record, summaries, profile | harness code and prompts: extraction rules, retraction, recall and evidence construction, answer policy |
| Experience | the user’s conversations, calendar, corrections | failure traces on development splits: context, prediction, gold, recall explanations |
| Improver | the fixed write and consolidation pipeline | a proposer coding agent (Claude Code) and a critic from a second family (Codex) |
| Strategy | fixed rules: add-only extraction, merge adjudication, retraction, Dream | cluster failures, form a hypothesis, patch, evaluate |
| Verifier | fixed write rules plus user review (inspect, correct, delete, undo) | frozen evaluator, preregistered acceptance rule, second reader |
| Inherited | the record itself (append-only history) | the accepted harness and the log of candidates and decisions |
| Humans decide | what to share, what to correct or delete | objective, splits, acceptance rule, when to freeze |
| Level | L4, environment adaptation | L2, strategy autonomy |
Table 8. The two loops of Reglos in the self-improvement framework.
Inner loop: self-evolving memory (L4). The inner loop is what the product does for every user every day. Its target is persistent state, the experience is the user’s own interaction, and the rules under which the state may change are fixed: the pipeline deletes nothing (only the user can), supersession keeps history, forgetting is a retraction with a tombstone, consolidation adds derived layers and leaves facts unchanged, and the user can override any of it. In the framework this is environment-adaptation autonomy, and it is what the broader literature calls a self-evolving memory [6] (Gao et al. 2026). The pipeline that writes memory changes only through the outer loop, which is how the two loops co-evolve.
Outer loop: recursive self-improvement of the harness (L2). The outer loop changes the code. Its target is everything between the frozen task model and the kernel: how facts are extracted and merged, how a request to forget is applied, what recall is asked for, how evidence is laid out, and what the policy says. The critic is a model from a different family than the proposer; it clusters the failures independently and checks every proposal against a shortcut rule: no logic keyed to the dataset’s option templates, to the labels of who holds a preference, or to how the generic option is constructed. The verifier is a frozen script that applies the rule of Figure 4 to every candidate after the freeze.
In the framework this is strategy autonomy, the level of Self-Harness (Zhang et al. 2026c), and Meta-Harness [14] works the same way: the coding agent decides what to change and people decide what counts. The improver and the verifier stay fixed, so the loop stops short of recursive inheritance (L5), where they too would be revised.
Splits. During development the loop tuned on small slices of the validation split and checked progress on a separate slice at milestones. After the freeze we divided the validation personas into two persona-disjoint halves and excluded every persona inspected during development, which leaves 1,317 questions.
Acceptance rules. During development a change was kept when it did not lower accuracy on the tuning slices, and it replaced the current harness once it gained about 3 points. This margin proved close to run-to-run noise, so after the freeze we adopted the stricter rule of Figure 4, with GPT-5.6 Luna as the second reader.
References
- [1]Agrawal, L. A.; Tan, S.; Soylu, D.; Ziems, N.; Khare, R.; Opsahl-Ong, K.; Singhvi, A.; Shandilya, H.; Ryan, M. J.; Jiang, M.; Potts, C.; Sen, K.; Dimakis, A. G.; Stoica, I.; Klein, D.; Zaharia, M.; and Khattab, O. 2026. GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning. In International Conference on Learning Representations (ICLR).
- [2]Anthropic. 2025. Claude Code: An Agentic Coding Tool. https://github.com/anthropics/claude-code. Accessed 2026-11-03.
- [3]Chen, Y.; Feng, Y.; Zhang, Q.; Lu, B.; Lu, J.; Wang, Z.; Xu, S.; Jin, Z.; Li, Z.; Li, C.; and Chen, Q. 2026. Capability-Driven Self-Evolution of Agent Memory. arXiv preprint arXiv:26010.06361.arxiv.org/abs/2610.06361
- [4]Chhikara, P.; Khant, D.; Aryan, S.; Singh, T.; and Yadav, D. 2025. Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory. arXiv preprint arXiv:2504.19413.arxiv.org/abs/2504.19413
- [5]Duan, Y.; Liu, Y.; Tang, Z.; Chen, H.; Zhou, J.; Liu, Y.; Xu, B.; Wu, Y.; Chen, S.; Zhou, Y.; Wang, H.; Yu, X.; Han, S.; Zhu, X.; Zhou, L.; Lu, B.; Zhou, W.; Liu, J.; Fang, N.; Tian, J.; Chen, R.; Li, Y.; Zuo, K.; Zhang, K.; Yang, Q.; Wang, Z.; Qiu, J.; He, C.; Li, G.; Zhou, B.; Liu, Z.; Wen, Z.; Kang, J.; Zhou, X.; and Wu, F. 2026. The Last AI Built by Humans: Toward Genuine Recursive Self-Improvement. arXiv preprint arXiv:2609.11873.
- [6]Fang, J.; Peng, Y.; Zhang, X.; Wang, Y.; Yi, X.; Zhang, G.; Xu, Y.; Wu, B.; Liu, S.; Li, Z.; Ren, Z.; Aletras, N.; Wang, X.; Zhou, H.; and Meng, Z. 2025. A Comprehensive Survey of Self-Evolving AI Agents: A New Paradigm Bridging Foundation Models and Lifelong Agentic Systems. arXiv preprint arXiv:2508.07407.arxiv.org/abs/2508.07407
- [11]Jiang, B.; Hao, Z.; Cho, Y.-M.; Li, B.; Yuan, Y.; Chen, S.; Ungar, L.; Taylor, C. J.; and Roth, D. 2025a. Know Me, Respond to Me: Benchmarking LLMs for Dynamic User Profiling and Personalized Responses at Scale. In Conference on Language Modeling (COLM). ArXiv:2504.14225.arxiv.org/abs/2504.14225
- [12]Jiang, B.; Yuan, Y.; Shen, M.; Hao, Z.; Xu, Z.; Chen, Z.; Liu, Z.; Vijjini, A. R.; He, J.; Yu, H.; Poovendran, R.; Wornell, G.; Ungar, L.; Roth, D.; Chen, S.; and Taylor, C. J. 2025b. PersonaMem-v2: Towards Personalized Intelligence via Learning Implicit User Personas and Agentic Memory. arXiv preprint arXiv:2512.06688.arxiv.org/abs/2512.06688
- [13]Lee, H.; Xu, J.; Seely, J.; Lee, D.; Zaharia, M.; and Tang, Y. 2026a. Recursive Harness Self-Improvement. arXiv preprint arXiv:2607.15524.arxiv.org/abs/2607.15524
- [14]Lee, Y.; Nair, R.; Zhang, Q.; Lee, K.; Khattab, O.; and Finn, C. 2026b. Meta-Harness: End-to-End Optimization of Model Harnesses. arXiv preprint arXiv:2603.28052.arxiv.org/abs/2603.28052
- [16]Liang, K.; Cui, Y.; Kong, H.; Huang, X.; Hou, G.; Kang, Q.; Chen, L.; Yin, Y.; Ye, K.; Guo, J.; Chen, D.; Zeng, L.; Peng, Y.; Yao, R.; Kai, S.; and Yuan, M. 2026a. MindMemOS: A Portable and Self-Evolving Memory Operating Layer for AI Agents. arXiv preprint arXiv:2608.12428. Liang, K.; Kruk, J.; Qian, S.; Yang, X.; Bi, S.; Yao, Y.; Nie, S.; Zhang, M.; Liu, L.; Fisac, J. F.; Zhou, S.; and Hosseini, S. 2026b. Learning Personalized Agents from Human Feedback. arXiv preprint arXiv:2602.16173.arxiv.org/abs/2608.12428
- [17]Lin, M.; Wang, Z.; Liu, Z.; Weng, Z.; He, B.; Shi, Z.; Dumoulin, B.; Zhang, X.; Wang, S.; and Lu, H. 2026. Language Models Learn to Improve Language Models. arXiv preprint arXiv:2610.23344.arxiv.org/abs/2610.23344
- [18]Liu, J.; Ye, X.; Xia, P.; Zheng, Z.; Xie, C.; Ding, M.; and Yao, H. 2026a. EvolveMem: Self-Evolving Memory Architecture via AutoResearch for LLM Agents. arXiv preprint arXiv:2605.13941.arxiv.org/abs/2605.13941
- [19]Liu, Q.; Wang, G.; Wu, W.; Huang, J.; Tao, X.; Song, D.; Zhou, J.; and He, L. 2026b. MemPro: Agentic Memory Systems as Evolvable Programs. arXiv preprint arXiv:2606.00619.arxiv.org/abs/2606.00619
- [20]Liu, X.; Liu, Y.; Li, C.; and Kun, S. 2026c. D²ACCI: A Dual-Loop Diagnostic Protocol for Evidence-Preserving Agent Memory. arXiv preprint arXiv:2608.17756.arxiv.org/abs/2608.17756
- [21]Madaan, A.; Tandon, N.; Gupta, P.; Hallinan, S.; Gao, L.; Wiegrefe, S.; Alon, U.; Dziri, N.; Prabhumoye, S.; Yang, Y.; Gupta, S.; Majumder, B. P.; Hermann, K.; Welleck, S.; Yazdanbakhsh, A.; and Clark, P. 2023. Self-Refine: Iterative Refinement with Self-Feedback. In Advances in Neural Information Processing Systems (NeurIPS). arXiv:2303.17651.arxiv.org/abs/2303.17651
- [22]Maharana, A.; Lee, D.-H.; Tulyakov, S.; Bansal, M.; Barbieri, F.; and Fang, Y. 2024. Evaluating Very Long-Term Conversational Memory of LLM Agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL). ArXiv:2402.17753.arxiv.org/abs/2402.17753
- [23]MemTensor. 2026. OmniMemEval: Evaluation Framework for Benchmarking Memory Systems. https://github.com/MemTensor/OmniMemEval. Accessed 2026-10-29.
- [24]OpenAI. 2025. Codex: A Lightweight Coding Agent That Runs in Your Terminal. https://github.com/openai/codex. Accessed 2026-11-03.
- [25]Packer, C.; Wooders, S.; Lin, K.; Fang, V.; Patil, S. G.; Stoica, I.; and Gonzalez, J. E. 2023. MemGPT: Towards LLMs as Operating Systems. arXiv preprint arXiv:2310.08560.arxiv.org/abs/2310.08560
- [26]Park, J. S.; O’Brien, J. C.; Cai, C. J.; Morris, M. R.; Liang, P.; and Bernstein, M. S. 2023. Generative Agents: Interactive Simulacra of Human Behavior. In Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology (UIST). arXiv:2304.03442.arxiv.org/abs/2304.03442
- [27]Rasmussen, P.; Paliychuk, P.; Beauvais, T.; Ryan, J.; and Chalef, D. 2025. Zep: A Temporal Knowledge Graph Architecture for Agent Memory. arXiv preprint arXiv:2501.13956.arxiv.org/abs/2501.13956
- [28]Shinn, N.; Cassano, F.; Berman, E.; Gopinath, A.; Narasimhan, K.; and Yao, S. 2023. Reflexion: Language Agents with Verbal Reinforcement Learning. In Advances in Neural Information Processing Systems (NeurIPS). ArXiv:2303.11366.arxiv.org/abs/2303.11366
- [30]Tavakoli, M.; Salemi, A.; Ye, C.; Abdalla, M.; Zamani, H.; and Mitchell, J. R. 2026. Beyond a Million Tokens: Benchmarking and Enhancing Long-Term Memory in LLMs. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2510.27246
- [31]Wang, G.; Xie, Y.; Jiang, Y.; Mandlekar, A.; Xiao, C.; Zhu, Y.; Fan, L.; and Anandkumar, A. 2024. Yogger: An Open-Ended Embodied Agent with Large Language Models. Transactions on Machine Learning Research (TMLR).arxiv.org/abs/2305.16291
- [32]Wang, Y.; Takanobu, R.; Liang, Z.; Mao, Y.; Hu, Y.; McAuley, J.; and Wu, X. 2025. Mem-M: Learning Memory Construction via Reinforcement Learning. arXiv preprint arXiv:2509.25911.arxiv.org/abs/2509.25911
- [33]Wei, Z.; Yao, W.; Peng, B.; Wang, D.; Wu, Q.; Cheng, H.; Meng, Y.; and Gao, J. 2026. Self-Evolving Coding Agents via Harness-Policy Optimization. arXiv preprint arXiv:2610.22791.arxiv.org/abs/2610.22791
- [35]Xiong, Y.; Hu, S.; and Clune, J. 2026. Learning to Continually Learn via Meta-Learning Agentic Memory Designs. arXiv preprint arXiv:2602.07755.arxiv.org/abs/2602.07755
- [37]Xue, S.; Ding, Z.; Shen, Y.; Wang, Y.; Yin, Z.; Wu, Y.; Chen, Y.; Wang, M.; and Yang, L. 2026. PAST-Bench: Benchmarking the Foundations of Recursive Self-Improvement in Personal Agents. arXiv preprint arXiv:2608.04003.arxiv.org/abs/2608.04003
- [38]Yan, S.; Yang, X.; Huang, Z.; Nie, E.; Ding, Z.; Li, Z.; Ma, X.; Bi, J.; Kersting, K.; Pan, J. Z.; Schütze, H.; Tresp, V.; and Ma, Y. 2025. Memory-R1: Enhancing Large Language Model Agents to Manage and Utilize Memories via Reinforcement Learning. arXiv preprint arXiv:2508.19828.arxiv.org/abs/2508.19828
- [39]Yang, S.; Wu, J.; Wong, D. F.; and Wang, D. 2026. SelfMem: Self-Optimizing Memory for AI Agents. arXiv preprint arXiv:2607.03726.arxiv.org/abs/2607.03726
- [40]Yuan, B.; Su, Y.; and Yao, K. 2026. Diagnosing Retrieval vs. Utilization Bottlenecks in LLM Agent Memory. In ICLR 2026 Workshop on Memory for LLM-Based Agentic Systems (MemAgents).arxiv.org/abs/2603.02473
- [41]Yue, Y.; Peng, B.; Fan, X.; Guo, J.; Li, Q.; and Zhang, Y. 2026. Mem-T: Densifying Rewards for Long-Horizon Memory Agents. arXiv preprint arXiv:2601.23014.arxiv.org/abs/2601.23014
- [42]Zhang, F.; Wu, H.; Wu, J.; Qu, H.; Lian, Z.; Luo, X.; Zheng, Y.; Zhang, B.; Li, H.; and Heng, P.-A. 2026a. RSIPO: Recursive Self-Improving Policy Optimization for Agentic Reinforcement Learning via Skill-Policy Co-Evolution. arXiv preprint arXiv:2610.15772.arxiv.org/abs/2610.15772
- [43]Zhang, G.; Ren, H.; Zhan, C.; Zhou, Z.; Wang, J.; Zhu, H.; Zhou, W.; and Yan, S. 2025. MemEvolve: Meta-Evolution of Agent Memory Systems. arXiv preprint arXiv:2512.18746.arxiv.org/abs/2512.18746
- [44]Zhang, H.; Long, Q.; Bao, J.; Feng, T.; Zhang, W.; Yue, H.; and Wang, W. 2026b. MemSkill: Learning and Evolving Memory Skills for Self-Evolving Agents. arXiv preprint arXiv:2602.02474.arxiv.org/abs/2602.02474






