The LLM Proposes, a Deterministic Gate Decides: Verbatim-Grounded Memory for LLM Agents
In long-term memory for LLM agents, the LLM itself often decides what to write to memory, what to update, and what to delete. In this design, an LLM's fabrications, and external text that slips into a conversation, enter persistent memory unchecked. This paper describes a design in which the LLM only proposes memory candidates and a deterministic gate decides whether each is admitted. The gate checks only whether the string (span) a proposal cites as its evidence appears in the conversation verbatim, by substring matching after Unicode normalization (NFKC) and whitespace normalization. It then sorts proposals into three tiers by where they are grounded: (1) records grounded in the user's utterances, (2) inferences grounded only in the assistant's utterances, and (3) proposals grounded nowhere (quarantined). The decision uses no LLM self-report, no LLM or NLI judgment, and no self-consistency. Around this gate, we place an append-only ledger, non-destructive generation management, a two-layer architecture (records and read-time-derived clusters) for long-term accumulation, and context compaction without summaries that restricts window contents to verbatim ledger text and ledger references. This paper presents the design and structural properties verified by deterministic checks; benchmark evaluations are left for future work. Reference implementation (beta): https://github.com/cosmopanda432/raiya
Authors
- Mitsuro Matsuta (ORCID: https://orcid.org/0009-0008-0987-8238)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-29
- DOI
- https://doi.org/10.5281/zenodo.24647026
- Primary Topic
- Speech and dialogue systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00