New LongMemOS architecture offers deterministic memory for agents
Yi Wang introduces LongMemOS, a Rust-based memory system for AI agents that eliminates LLM calls during the write process to reduce costs and errors.
Source: Grafy Research LabEnterprise AI agents are increasingly required to maintain long-term context, but current memory methods often rely on expensive and lossy Large Language Model (LLM) calls to summarize or extract facts during every interaction. LongMemOS, a new system proposed by Yi Wang, addresses this by using a deterministic, zero-LLM write path that ensures data integrity and lowers operational costs.
How does LongMemOS manage agent memory?
Traditional agent memory pipelines typically invoke LLMs or dense embedding models at the moment of ingestion to build summaries or extract atomic facts. According to the research paper, this approach introduces several tensions in enterprise environments, including high per-turn inference costs, a dependency on external model endpoints, and the risk of "lossy iterative rewriting," where repeated summarization can cause an agent to lose specific numerical thresholds or negative constraints.
LongMemOS changes this by separating the ingestion process from the retrieval process. It uses a single-executable Rust engine that operates as a deterministic memory operating system. Instead of asking an LLM to interpret a new piece of information, the system performs an append-only write into an encrypted local store. Figure 1 shows the architecture of this system, illustrating how the write path executes deterministic, zero-LLM, and zero-embedding local ingestion into an encrypted store, while retrieval and management are handled through separate, decoupled paths.
What are the technical specifications of the write path?
To ensure that no information is lost or corrupted during the ingestion phase, LongMemOS employs several strict technical protocols. Incoming UTF-8 payloads are stored verbatim in an append-only ledger. If a payload exceeds 32 KiB, the system splits it strictly at UTF-8 character boundaries to prevent the corruption of multi-byte characters, such as those found in CJK (Chinese, Japanese, Korean) or other Unicode code points.
Each event is assigned a monotonic sequence number by the server and includes a UTC timestamp to prevent issues caused by clock drift across different hosts. Furthermore, the system uses SHA-256 digest verification to allow for evidence integrity checks. This ensures that any byte-level alteration to the stored data can be detected by comparing the recomputed digest against the original.
How does the system retrieve information?
While the write path is deterministic and model-free, the retrieval path is designed to be multi-faceted. LongMemOS uses a hybrid retrieval method that combines lexical-morphological matching with a lightweight embedded graph index. This allows the system to find information using structural anchors and temporal signals without needing to run a heavy embedding model every time a query is made.
To manage evolving information, the system uses "supersedes" version chains. Rather than overwriting old data—which would destroy the ability to audit past states—LongMemOS retains prior versions and resolves the "active truth" at the time of the query. This enables "Time-Travel" capabilities, where an agent can query the state of its memory as it existed at a specific historical timestamp.
How well does LongMemOS perform in benchmarks?
The researcher evaluated the system across five public benchmarks involving 10,957 dataset-item evaluations. The results showed high accuracy in maintaining long-term context. Specifically, the system achieved 95.40% accuracy on LongMemEval-S and 92.40% on LongMemEval-M. On the PersonaMem-v2 128k benchmark, the system reached a mean score of 75.92%, with 65.42% of evaluations receiving a judge score of 0.9 or higher.
Efficiency was also a key metric of the evaluation. Figure 3 illustrates the reported memory footprints, showing that the system maintains a relatively small physical presence. For example, the research reports a typical resident memory of approximately 75 MB, with a floor of 47.1 MiB observed, and a peak memory of about 195 MB when handling the BEAM-10M subset. Crucially, because the write path is model-free, the system reported USD 0 in write-time model charges during these evaluations.
How can researchers apply these memory concepts?
For researchers and developers working with massive datasets or long-form documents, the concept of deterministic, non-lossy ingestion is vital for maintaining accuracy. While LongMemOS is a specialized system for agentic workflows, the principles of verifiable, append-only data storage can be explored when analyzing complex research papers.
Users interested in testing how AI handles long-context information or how it manages specific details within dense documentation can use Grafy Reader to query and research large PDFs. By interacting with specialized models through Grafy Chat, researchers can observe how different architectures handle context retention and where they might encounter the "lost in the middle" degradation that LongMemOS aims to mitigate in agentic systems.
Frequently asked questions
Does LongMemOS require an LLM to save new information?
No, LongMemOS uses a zero-LLM-write architecture. It avoids invoking Large Language Models during the ingestion phase, instead opting for a deterministic, append-only local store that saves incoming UTF-8 payloads verbatim to prevent the costs and errors associated with model-based summarization.
What makes the memory in LongMemOS deterministic?
The system is deterministic because it uses a fixed, single-executable Rust engine that follows strict rules for data ingestion. It uses server-assigned monotonic sequence numbers, SHA-256 verification, and specific UTF-8 character boundary splitting to ensure that every piece of data is stored identically every time.
Can LongMemOS handle updates to existing facts?
Yes, the system handles updates through explicit supersedes version chains. Instead of deleting old information, it links new records to the older ones, allowing the system to maintain a history of changes and providing the ability to perform audits or "Time-Travel" queries to see past states.


