China Just Open-Sourced Humanlike Memory for AI Agents (Tencent DB)

summarized

TLDR

Tencent Cloud open-sourced an MIT-licensed memory plugin for AI agents that improves pass rates by 51% while cutting token usage by 61% on the WideSearch benchmark, using a two-pronged approach: compressing intermediate tool logs into mermaid diagrams and implementing a four-layer memory system inspired by human episodic/semantic memory consolidation. The system runs fully local on SQLite, integrates with OpenClaw in one command, and represents a broader industry shift toward memory as a structured, portable asset rather than a raw log.

Key points

  • Tencent's memory plugin for OpenClaw agents achieved a 51% relative pass rate improvement (33% to 50%) on the WideSearch benchmark while reducing token consumption from 221 million to 86 million.
  • The plugin compresses intermediate tool outputs (search results, stack traces, file dumps) into mermaid diagrams that stay in the prompt, with full details retrievable on demand via node IDs.
  • Memory is organized into four layers: L0 (raw conversation), L1 (atoms: facts/preferences), L2 (scenes: grouped tasks), and L3 (persona: user habits), mirroring the human episodic-to-semantic consolidation process.
  • On the PersonaMem benchmark tracking changing user preferences across sessions, the system improved accuracy from 48% to 76%.
  • The system uses SQLite with SQLite-vec for local storage, hybrid BM25+vector search with reciprocal rank fusion, and a 5-second timeout that skips injection rather than stalling.
  • Version 2 of the plugin transforms memory from a private cache into a shared asset with four types: chat memory, skills (versioned packages with execution rules), a wiki (markdown entity pages), and a code graph.
  • Three concerns exist: arithmetic discrepancies in their own benchmark table, lack of independent reproduction, and the fact that injecting memory changes the prompt prefix every turn, breaking provider caching and partially offsetting token savings.
  • The field is unsettled, with two separate Tencent teams shipping competing memory plugins for the same OpenClaw host framework, and portable memory (the ability to switch frameworks without losing memory assets) remains an unchecked roadmap item.

Tools mentioned

Techniques

  • Tool output compression via mermaid diagrams
  • Four-layer memory consolidation (L0-L3)
  • Hybrid BM25 + vector search with reciprocal rank fusion
  • Episodic-to-semantic memory consolidation
  • Context window threshold-based compression (50% and 85%)
  • Cold start backfill from existing codebases and docs
Transcript (captions)
Here's an agent. 40 turns into a job. It has read nine files, run 12 commands, and it is still working. And right now, it is about to ask you the exact same question it already asked you back on turn four. Every one of those turns, drag the entire history back into the prompt. Watch the token meter climb. 221 million tokens. That is a single benchmark run. Just 200 questions. The obvious fix is a bigger context window. Give the model more room and stop worrying about it. Except the research team at Chroma tested 18 Frontier models and found the opposite happening. Accuracy falls as the input grows and it starts falling long before the window is anywhere near full. So in April, Tencent Cloud's database team pushed a different answer to GitHub under an MIT license. 10,400 stars in 117 days and a benchmark table with two columns that should not both be moving. Same benchmark as the meter you just watched. Pass rate climbed from 33% to 50 and token use dropped 61% at the same time. Better results on less than half the tokens, which is a strange part here. It did not help the agent remember more. It helped it remember less. Two questions then. How does throwing information away make an agent smarter? And are these numbers real? I checked both. Start with what an agent actually is. A model with no memory plus a loop that keeps handing it the transcript. Nothing persists on its own. Between sessions, your agent is a new hireer who read the handover note and nothing else. So the loop compensates by pasting everything back in files, tool output, errors, the lot. On the SWE bench, run 10-centent used 50 coding tasks in one continuous session burned 3 and a half billion tokens for scale. That is about 3 and a half thousand full million token context windows spent on one benchmark. And the tokens are the cheap half of the problem. The expensive half is what all that text does to the model. Chroma ran its context rate study in 2025 across 18 Frontier models, GPT 4.1 and Claude 4 and Gemini 2.5 and Quinn 3 among them on tasks a child could do. Copy this text. Find this sentence. As the input grew, they got worse at it, some by 30 to 50%. A 200,000 token window can start degrading around 50,000. The number on the box is not the number you get in practice. So an agent that remembers by hoarding gets slower, pricier, and less accurate all at once. And this is where the geography in the title earns its place. The teams shipping memory infrastructure into open source right now are mostly Chinese. Tencent twice over and memos out of a Chinese lab. The frontier labs are selling bigger windows. These teams are giving away the layer that makes small windows work. Tensent engine attacks that with two ideas. The first one is about the task you are in right now and it is the blunderter of the two. In a long task, the token hogs are not your instructions. They are the intermediate logs. Search results, stack traces, file dumps. So the plug-in moves them out. Full tool output gets written to markdown files on disk. What stays in the prompt is a diagram, a mermaid graph of what happened with an ID on every node. Mermaid is that little text syntax from GitHub readmes, arrows, and boxes written as plain lines. Hundreds of thousands of tokens of log collapse into a few hundred tokens of shape. And when the agent hits an error and needs the detail, it gs the node ID and pulls the raw text straight back. That is the constraint they kept. Compress, but never lose the road back to the evidence. None of that is summarization. A summary is one way. This is a folded diagram you can open again. Two thresholds drive the folding. At half the context window, it compresses mildly. At 85%, aggressively. And the canvas itself is capped at 20% of the token budget. So the map never eats the room it is saving. Now the numbers. The headline comes from wide search, a benchmark out of biteance's seed team. 200 questions, half English, half Chinese, and all of them wide rather than deep. Not one hard fact hidden somewhere clever. A pile of easy facts that all have to be right at the same time, which is exactly the shape of task that fills a context window with junk. Baseline OpenClaw solved 33% of them with the memory plug-in 50, a 51% relative jump. Tokens fell from 221 million to 86. The saving on its own is 136 million tokens. That is roughly 100 million words. About 170 copies of War and Peace generated and then never read. The harder benchmarks moved less. SWEBench went from 58.4 to 64.2 on a third fewer tokens on a long document reasoning test from artificial analysis. 100 questions over real financial filings and legal documents 44 to 47 12 smaller gains as the task gets harder. Hold on to that. The second idea is the one the title is about and it borrows from a 50-year-old argument in psychology. In 1972, Endel Toving split human memory in two. Episodic, the events you live through with times attached. And semantic, the facts you know with the event that taught you them stripped away. You know Paris is the capital of France. You have no idea which afternoon you learned it. That is the split. And the interesting part is the arrow between them. Episodes get replayed. Patterns get pulled out. The episode itself fades. Psychologists call that consolidation. And it is not only a model. Hippocample replay during sleep is one of the mechanisms neuroscience has actually watched happen. Ebinghouse measured the other half of it back in 1885. Without review, roughly twothirds of what you learn today is gone inside a day. Forgetting is not the bug in that system. It is the compression step. Tencent's long-term side is that arrow written as four layers. L0 is the raw conversation. Everything exactly as it was said. L1 pulls out atoms, a fact, a preference, a constraint. It runs every five turns by default. L2 groups those atoms into scenes. this project, this kind of task, this recurring situation. L3 is the persona. Your habits, your conventions, your defaults rebuilt every 50 new memories. The agent reads top down persona first because that is cheap and usually enough. It drops to the atoms only when a specific fact matters and all the way down to L0 when it needs your exact wording. Same shape as Telving's arrow. Run backwards when you need it to be. The benchmark for that half is persona mem and it is a nasty one. Multi-session synthetic conversations where the user's preferences change over time. It asks whether the model tracks the change. Baseline 48% with the layers 76 28 points. The plumbing under all of it is deliberately boring. SQLite with the SQLite vec extension running on your machine. No API key, no vendor endpoint, nothing leaving the laptop unless you tell it to. Installing it into OpenClaw is one command node 22 or newer and it works with no configuration at all. Retrieval is hybrid BM25 keyword search and vector search merged with reciprocal rank fusion. Five results per recall. A 5-second timeout. And if it is slow, it skips the injection rather than stalling your turn. And every layer is a file you can open. The persona is marked down. The scenes are marked down. The task canvas is mermaid. When recall goes wrong, you read it instead of squinting at a list of cosign scores. So, problem time. Three of them and the first is sitting in their own table. Divide the SFDE bench token columns yourself. 3,474 million down to 2375. That is a 31.6% cut. The row next to it says 33.1. Small and probably a normalization choice rather than a mistake. But it is their arithmetic and it is the one row that does not divide out. The long context row divides out to the exact printed number which is the actual point here. These figures are checkable so check them. Second, every one of these results was produced by the vendor. No independent reproduction has been published yet. That is normal in this field and it is still a problem. Mem published a paper ranking memory systems against each other. Zep published a rebuttal saying its system had been misconfigured and scored itself about nine points higher than the paper gave it. Everyone benchmarks on a different data set, so each of them gets to be first. Third, and this is the one that would show up on your bill, issue 120. Injecting memory means changing the front of the prompt every single turn. Providers cash that prefix and identical opening tokens are build at a fraction of the price. Change the opening every turn and the cash stops hitting and part of your token saving walks straight back out the door. The maintainers have it open, split into two follow-ups, moving the persona and scene blocks into a stable prefix not solved. Open in public with the argument attached while you are in there. 405 open issues. The most discussed one is a search query that does not escape its operators so user input can rewrite the query. 177 comments on that single thread. a four-month-old repository moving fast with the mess visible. Read that as a maturity signal, not a scandal. Worth knowing who is paying for this though. The repo is MIT and it does run entirely local. It also ships a 10-centent cloud vector database backend and a managed agent memory service that launched 4 days before the repository existed. The Docker image defaults to Tencent's own model endpoint running DeepS v32 open core with a cloud upsell. standard practice and worth seeing clearly before you build a company on it. The stranger part is who they are competing with. Tensuan team shipped a rival memory plug-in for the same host framework weeks later. Six layers instead of four, a fast and slow dual system, 35% fewer tokens by its own numbers, two teams inside one company, two memory plugins, one host framework, which tells you how unsettled this layer still is. That host is OpenClaw, the agent runtime that ate 2026, 384,000 GitHub stars from a standing start in late 2025. It has a plug-in slot for memory, which is why every memory project alive is now writing an open claw adapter. The field roughly MEM0 at 62,000 stars. Let the mem GPT people at 24. Memos out of a Chinese lab at 10 a half thousand built over 13 months. Tencent reached the same number in under four 89 stars a day and in July it changed shape. Version two moves memory from a private cache to a shared asset in four types chat memory skills a wiki and a code graph. A skill there is not a prompt snippet. It carries a version resource files trigger boundaries execution steps and validation rules closer to a package than a note private by default shared with the team only after review. The wiki is Carpathy's idea from April. Markdown entity pages and agent writes and maintains linked to each other so the knowledge compounds instead of evaporating between sessions. The code graph indexes the codebases structure so an agent starts a task already knowing how the pieces connect. And there is a cold start path which is the part that matters if you already have a codebase. Point it at an existing repository, a folder of docs, or your old agent sessions, and it backfills the graph, the wiki, and the skills before your new agent has done a single thing. Each asset carries an owner, a version, and permissions, private, team, or a named access list. And that is the shift worth watching. Memory stops being a log and becomes an artifact with a license plate. So, should you install it? If you run long agent sessions, it is one command and it defaults to fully local. So the downside is an evening. If you want the proven version, wait for someone outside 10-centent to reproduce that table. But the idea underneath is the durable part and it is not 10 cents. Every serious memory system being built right now is converging on the same shape. Keep a sketch in context. Keep the evidence on disk. Keep the path between them intact, which is what your own head does every night while you sleep. It does leave one question their road map has not answered. When memory becomes an asset you own, what happens when you switch frameworks or leave the team that built it? Portable memory is item one on that road map and the box is still unchecked. Tell me where you land on

Frontier News · by Hyperjump Technology