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

Tencent Cloud’s open-source memory system improves AI agents’ long-session performance by efficiently compressing and managing memory through layered, humanlike recall and evidence traceability, reducing token usage by over 60% and boosting accuracy. This approach challenges the focus on expanding context windows, emphasizing smarter forgetting and local-first transparency, though challenges like memory consistency, security, and broader validation remain.

The video discusses a common frustration with AI agents during long coding sessions: the agents lose track of previous context as their memory is limited. When the input transcript grows too large, the model discards earlier information, leading to repeated questions and suggestions, which degrades performance. Increasing the context window size doesn’t solve this problem; in fact, tests by Chroma on multiple advanced models showed accuracy declines as input size grows, due to the fixed attention budget competing among tokens. Tencent Cloud’s database team proposed a novel solution, open-sourced under MIT license, that improves accuracy while drastically reducing token usage by making the agent remember less but more efficiently.

Tencent’s approach centers on compressing and managing memory smartly rather than expanding context length. Their plugin writes detailed logs and tool outputs to markdown files on disk, keeping only a compact mermaid diagram summary in the prompt. When detailed information is needed, the agent retrieves it by referencing node IDs, preserving access to evidence without cluttering the prompt. This method reduces token consumption by over 60% and improves pass rates on benchmarks from 33% to 50%, demonstrating that throwing away irrelevant information actually makes the agent smarter by focusing attention on the most relevant data.

The system also draws inspiration from psychological theories of human memory, distinguishing between episodic memory (events with time context) and semantic memory (facts without event context). Tencent’s memory model has four layers, from raw conversation to grouped scenes and persona traits, allowing the agent to recall information at different granularities. This layered memory enables better handling of multi-session conversations and evolving user preferences, with benchmarks showing significant improvements in tracking changes over time. The architecture is local-first, open-source, and designed for transparency, allowing users to inspect and manage memory files directly.

Despite these advances, challenges remain. The video highlights concerns about memory consistency and security, especially when memory becomes a shared team resource. Issues like prompt injection attacks and stale or incorrect memories can degrade agent performance silently. Additionally, the broader AI community has yet to reproduce Tencent’s results independently, and there are open questions about how memory systems will evolve as context windows continue to grow. The video suggests that while long context handling may improve, attention limitations mean efficient memory management will remain crucial.

In conclusion, Tencent’s open-source memory system represents a significant step toward more efficient and humanlike AI memory, emphasizing compression, layered recall, and evidence traceability. It challenges the prevailing focus on expanding context windows by showing that smarter forgetting can enhance performance. Users running long AI sessions are encouraged to try the system locally, while the community awaits further independent validation. The video ends by posing an important question about the portability of AI memory assets across frameworks and teams, highlighting an area for future development.